GHSA-G7PW-WHV8-97J7
php_server in a Caddy named route runs with the root, env and workers of another site
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:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-G7PW-WHV8-97J7 divulgada · CVSS 4.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
A `php_server` or `php` directive written in a Caddy named route (`&(name) { ... }`, used with `invoke`) can be attached to the PHP server of an unrelated `php_server` declared in a site block. Requests to the site invoking the named route then run the other site's PHP application, with its document root, `env` values and workers, and bypass the access rules of that other site.
For instance, if an intranet site restricted with `remote_ip` holds the first `php_server` of the site blocks, and a public site invokes a named route holding the first `php_server` of the named routes, any client of the public site reaches the intranet's front controller and the secrets it receives through `env`.
Only configurations using `php_server` or `php` inside named routes are affected.
Patches
Fixed in 1.13.5.
Workarounds
Don't use `php_server` or `php` in named routes: write the directive in the site blocks, or in a snippet imported with `import`.
Details
Each `php_server` directive gets a `server_index`, so the routes it generates (including the ones added for `worker { match }`) share one PHP server and its workers. The index is counted in `httpcaddyfile.Helper.State`, but Caddy adapts named routes with a `State` map of their own, so the n-th directive of the named routes got the same index as the n-th directive of the site blocks. At start-up, FrankenPHP reused the server already registered under that index and ignored the root, environment and workers of the second module.
FrankenPHP now shares a server only between modules whose configuration, index included, is identical before provisioning, and that use the same Mercure hub.
Proof of concept
&(shop) {
php_server {
root /srv/shop
}
}
http://intranet.example.com {
@outside not remote_ip 192.0.2.0/24
respond @outside 403
php_server {
root /srv/intranet
env DATABASE_PASSWORD secret
}
}
http://shop.example.com {
invoke shop
}$ curl http://intranet.example.com/ # 403
$ curl http://shop.example.com/ # runs /srv/intranet/index.php, with DATABASE_PASSWORD in $_SERVERCredits
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-24JPX8J2.
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-g7pw-whv8-97j7Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
