GHSA-V7HF-4GQV-HF8P
php_server with a worker match rule can serve the source of PHP scripts
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-V7HF-4GQV-HF8P divulgada · CVSS 5.9 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
When a `php_server` block has a worker with a `match` rule and the built-in file server is enabled (the default), the raw source of some scripts under the document root can be downloaded instead of executed:
- with extra script extensions declared with `split` (e.g. `split .php .phtml`), `GET /report.phtml` returns the source of `report.phtml`;
- with a rewrite running before `php_server` that produces a script path ending with `/` (for instance `/app/config.php/./` behind `handle_path` or `uri strip_prefix`), the source of any `.php` script is returned.
The leaked source can contain credentials and other secrets. Nothing is executed or modified, and files outside the document root are not reachable.
Patches
Fixed in 1.13.5.
Workarounds
Disable the built-in file server with `file_server off` in `php_server` and serve static files with a separate `file_server` directive, or don't use `match` in `worker` blocks.
Details
When a worker has a `match` pattern, `php_server` adds a `file_server` route before all its other routes, so existing static files are served before the request reaches the worker. This route excluded scripts with a hard-coded `*.php` path pattern, while the PHP route handles `*<ext>` and `*<ext>/*` for every extension listed in `split`. Paths in the second set but not the first were served as static files. For `/config.php/`, the `path` matcher keeps the trailing slash, while the `file` matcher and the file server drop it.
The exclusion now uses the same path patterns as the PHP route.
Proof of concept
http://localhost {
php_server {
root /srv/app
split .php .phtml
worker {
file /srv/worker.php
match /api/*
}
}
}$ curl http://localhost/report.phtml # returns the source of /srv/app/report.phtmlCredits
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-9HGVH264.
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 |
|---|---|---|---|---|
Gogithub.com/dunglas/frankenphp/caddy |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/php/frankenphp/security/advisories/GHSA-v7hf-4gqv-hf8pLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
