GHSA-2X4J-R638-WXFF
Dot segments after a PHP script let requests bypass path-based Caddy rules
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:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-2X4J-R638-WXFF divulgada · CVSS 6.5 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Remediación | Parche v1.13.5 | github.com/dunglas/frankenphp · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
Sites that restrict PHP scripts with Caddy `path` matchers (`respond`, `error`, `basic_auth`, `forward_auth`, `handle` blocks, etc.) can have these rules bypassed. Caddy's matchers resolve `.` and `..` segments, but FrankenPHP split the raw request path at the first `.php` segment. `/admin/tool.php/../../missing.php` is `/missing.php` for a `path /admin/*` rule, but FrankenPHP ran `admin/tool.php`, with the method, query string and body chosen by the client. Where a rule keeps an upload directory static-only (`handle /uploads/* { file_server }`), a client able to store a `.php` file there can get it executed.
Path matchers whose pattern contains `%` compare the escaped path, where `%2f` and `%2e%2e` are neither separators nor dot segments. With `@public path /public/%*`, `/public/tool.php%2f..%2f..%2fadmin%2ftool.php` matched the public rule but ran `admin/tool.php`. On Windows, these matchers read a backslash (`\` or `%5C`) as `%2f`.
Under `php_server`, the `try_files` rewrite replaces the path with a cleaned one when it matches, so a document root with an `index.php` and the default `try_files` is not affected. Sites without a root `index.php`, with `index off`, with a custom `try_files` list, or using the `php` directive behind path rules are affected, as are library users who route on the cleaned path. The target must be an existing PHP script under the document root.
Caddy's own FastCGI transport splits the raw path the same way; this is being reported to the Caddy project separately.
Patches
Fixed in 1.13.5.
Workarounds
Keep scripts that must not be reachable outside the document root, or reject requests whose raw path contains `/.` (or `\.` on Windows) before they reach `php_server` or `php`, for instance with a `path_regexp` or `expression` matcher on `{http.request.orig_uri.path}`.
Details
`splitCgiPath()` now resolves dot segments, keeping the trailing slash, before splitting the path, so the script run is the one Caddy's matchers evaluated. Paths without a `/.` sequence are left untouched. On Windows, segments are first normalized like Caddy does (backslashes as separators, trailing dots and spaces trimmed, so `...` becomes an empty segment). For requests with dot segments, `PATH_INFO` and `PHP_SELF` now contain the resolved path.
Requests whose escaped and decoded paths select different scripts now get a 400. On Windows, this check also covers paths containing a backslash, which Go escapes without setting `RawPath` (https://github.com/php/frankenphp/pull/2810).
Proof of concept
root /srv/app
@admin path /admin/*
respond @admin 403
php_server {
index off
}With `/srv/app/admin/tool.php`:
curl --path-as-is 'http://localhost/admin/tool.php/../../missing.php'Affected versions run `admin/tool.php`; patched versions treat the request as `/missing.php` and don't run `admin/tool.php`.
Credits
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-LJMPBIGX.
The escaped-path variant was reported by Daybreak Red.
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 |
Corregida | v1.13.5 | 0 d | v1.13.6 no afectada |
v1.13.5Arsenal 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-2x4j-r638-wxffLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
