GHSA-XH92-4P94-CH7X
php_server serves the Caddyfile when it is stored in the document root
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-XH92-4P94-CH7X divulgada · CVSS 3.7 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
When the Caddyfile, or a file it imports, is stored under the document root of a `php_server` site, any client can download it with a `GET /Caddyfile` request. Values written inline in the Caddyfile, such as `env` values passed to PHP, Mercure JWT keys or `basic_auth` password hashes, are disclosed. Values referenced with `{$VAR}` or `{env.VAR}` are not.
This happens with the minimal layout shown in the documentation: a Caddyfile next to `index.php`, with no `root`, and FrankenPHP started from that directory. Caddy's `file_server` directive hides these files, and so does the `php` + `file_server` configuration documented as equivalent to `php_server`.
Patches
Fixed in 1.13.5.
Workarounds
Store the Caddyfile and its imports outside the document root, for instance by moving the PHP application to a `public/` subdirectory and setting `root`. Alternatively, block the request before `php_server`, for instance with `respond /Caddyfile 404`.
Details
Caddy's `file_server` directive adds the Caddyfile being adapted and its imports to the `hide` list of the handler. This is done in `FileServer.FinalizeUnmarshalCaddyfile()`. `php_server` builds its file server without this step, so both the file server it adds at the end of its routes and the one it adds for `worker { match }` had an empty `hide` list.
`php_server` now calls `FinalizeUnmarshalCaddyfile()` on its file server.
Proof of concept
`/srv/app/Caddyfile`:
http://localhost {
php_server {
env DATABASE_PASSWORD secret
}
}$ cd /srv/app && frankenphp run
$ curl http://localhost/Caddyfile # returns the CaddyfileCredits
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-30F8W2OH.
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-xh92-4p94-ch7xLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
