GHSA-R9R5-J5Q8-8C59
Adminer RCE via UTF-8 BOM Bypass of SQLite ATTACH/VACUUM INTO Restrictions
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-R9R5-J5Q8-8C59 divulgada · CVSS 7.2 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
An authenticated Adminer user with SQLite access can bypass the application's `ATTACH` and `VACUUM INTO` restrictions by prefixing the SQL statement with a UTF-8 byte-order mark (`EF BB BF`). Adminer's filter does not recognize the statement, but SQLite removes the BOM and executes it.
This permits creation of a SQLite file at an arbitrary path writable by PHP. If that path is served by a PHP-enabled web server, PHP code embedded in a table name executes as the web-server user.
### Details
Adminer blocks dangerous SQLite statements only when the keyword appears after its own definition of whitespace or comments:
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:$line_comment)[^\n]*\n?|--\r?\n)";
if (JUSH == "sqlite" && preg_match(
"~^$space*+(ATTACH|VACUUM\\b.*\\bINTO)\\b~is",
$q,
$match
) !== 0) {
// reject
} else {
connection()->multi_query($q);
}The regex does not consume `EF BB BF`, so it returns no match. SQLite accepts the same bytes as a leading BOM and executes the following `ATTACH` or `VACUUM INTO` statement.
### PoC
1. Run Adminer 6.1.0 with the SQLite driver and log in to an existing SQLite database.
2. Ensure the PHP process can write a new file in a PHP-served directory, such as `/var/www/html/`.
3. Open SQL command, then use the browser console to submit a query whose first character is a BOM:
const q = document.querySelector('textarea[name="query"]');
q.value = "\uFEFFATTACH DATABASE '/var/www/html/adminer-bom.php' AS p; " +
"CREATE TABLE p.\"<?php echo 'ADMINER_BOM_OK'; ?>\" (x);";
q.form.requestSubmit();- Adminer reports both statements as successfully executed. The same query without `\uFEFF` is rejected as unsupported.
- Request `/adminer-bom.php`. The response contains `ADMINER_BOM_OK`, confirming PHP execution.
### Impact
An authenticated database user can execute arbitrary PHP or shell execution (if enabled) as the web server account.
### Recommendation
Normalize a leading UTF-8 BOM before inspecting every SQLite statement and treat regex errors as rejection. Prefer enforcing the restriction through SQLite's authorizer API so alternate syntax and parser normalization cannot bypass it.
### Credit
Discovered by Fariskhi Vidyan (IDNSEC https://idnsec.com/) with AI harness and manual verification.
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 |
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-r9r5-j5q8-8c59Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
