llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · vrana/adminer

GHSA-75XM-QWFQ-9WP5

Arbitrary .sql file write via unvalidated ns in sql-log plugin

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
5.4
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición135 dDesde la divulgación, 9 jul 2026, 6:19 a. m.
Detección134 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. No hay versión corregida: aplique mitigaciones.
Hoy toca orden, no heroísmo.Sin prisa pero sin pausa, como yo en el páramo.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
9 jul 26
21 nov 26
9 jul 26
12 ago 26
15 sept 26
18 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-75XM-QWFQ-9WP5 divulgada · CVSS 5.4 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

The bundled `sql-log` plugin builds its log file path from the request parameter `$_GET["ns"]` without sanitization (`plugins/sql-log.php:29`), then opens that path for appending (`plugins/sql-log.php:31`) and writes each executed query verbatim (`plugins/sql-log.php:33`). The `ns` parameter is the PostgreSQL schema selector and is normally validated by `set_schema()`, but that validation is gated on a database being selected. When the user is logged in with no database selected, `database()` returns an empty string, `ns` is never checked, and the concatenation `"" . ".$_GET[ns]" . ".sql"` places the entire path under attacker control.

An authenticated user submits any SQL query with a traversal sequence in `ns`. The plugin writes an attacker-named `.sql` file, containing attacker-controlled content, to any directory writable by the Adminer process. Adminer connects to any host on ports 1024 and above, so the attacker supplies their own database server and their own credentials to obtain the session; access to the operator's database is not required.

Result: any user who can log in to an Adminer instance running the `sql-log` plugin writes arbitrary `.sql` files with controlled content to arbitrary writable paths on the Adminer host.

Affected

vrana/adminer, `sql-log` plugin, v5.3.0 through v5.4.2 (current latest as of 2026-07-04). The vulnerable line is byte-identical on `master` HEAD. The `$_GET[ns]` concatenation was introduced on 2025-04-15 (commit 45799f460, "AdminerSqlLog: Store schema"), first shipped in v5.3.0.
Condition: the `sql-log` plugin is enabled (official Docker image: environment variable `ADMINER_PLUGINS=sql-log`, which generates `return new AdminerSqlLog();` with the default empty filename).
Not affected: default installs without the `sql-log` plugin; versions before v5.3.0.

Root cause

`plugins/sql-log.php:29` sets the log filename to `Adminer\adminer()->database() . ($_GET["ns"] != "" ? ".$_GET[ns]" : "") . ".sql"`, taking `$_GET["ns"]` directly into a filesystem path. The only validation of `ns`, `set_schema()`, is reached only through the block guarded by `DB != "" && $_GET["ns"] !== ""` at `include/connect.inc.php:120`, so with no database selected that block is skipped and `ns` reaches the sink unvalidated. `database()` then returns an empty string, collapsing the prefix to a single `.`, so a value such as `ns=/../../../tmp/x` resolves to an absolute path outside the web root. The file is opened in append mode (`plugins/sql-log.php:31`) and each executed query is written to it verbatim (`plugins/sql-log.php:33`), giving the attacker control over both the path and the file content.

Reproduction

Official `adminer:5.4.2` Docker image, PHP 8.4.23, started with `ADMINER_PLUGINS=sql-log`. The attacker uses a MySQL server they control.

  1. Log in with the driver's credentials and leave the database field empty.
POST / HTTP/1.1
Content-Type: application/x-www-form-urlencoded

auth[driver]=server&auth[server]=<attacker-db-host>&auth[username]=<user>&auth[password]=<pw>&auth[db]=
HTTP/1.1 302 Found
Location: ?server=<attacker-db-host>&username=<user>
  1. Submit any query with a path-traversal sequence in the `ns` query-string parameter.
POST /?server=<attacker-db-host>&username=<user>&sql=&ns=/../../../tmp/adminer_pwn HTTP/1.1
Content-Type: application/x-www-form-urlencoded

query=SELECT 'LFI_F1_PROOF -- attacker controls this content'&token=<csrf>
HTTP/1.1 200 OK
  1. Read the written file inside the container.
$ cat /tmp/adminer_pwn.sql
SELECT 'LFI_F1_PROOF -- attacker controls this content'

Live-verified: the `.sql` file is created outside the web root with byte-exact attacker content. A null byte (`ns=.../x.php%00`) does not escape the `.sql` suffix; PHP 8.4 rejects it and no file is written.

Impact

  • Arbitrary `.sql` file creation and append at any path writable by the Adminer process (uid 100), with attacker-controlled content.
  • Disk-exhaustion denial of service through unbounded appends.
  • Second-order SQL execution when an operator imports a poisoned `.sql` file via the "from server" import.
  • Triggered by any authenticated user with a self-supplied database; no operator-database access and no administrative role required.

Credit

Jan Kahmen, turingpoint https://www.turingpoint.de (jan@turingpoint.de)

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:L
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
8.3/ 10Alto
Vector 8.3 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida
vrana/adminer≥ 5.3.0 ≤ 5.4.2
5.3.0
5.4.2
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistvrana/adminer
Sin parche — — —
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/vrana/adminer/security/advisories/GHSA-75xm-qwfq-9wp5

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.