GHSA-2725-RH2W-9J9W
HTTP/2 host header field overrides $_SERVER['HTTP_HOST'] set from the routed host
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-2725-RH2W-9J9W divulgada · CVSS 4.8 (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
Over HTTP/2, a client can set `$_SERVER['HTTP_HOST']` to any value while Caddy routes and access-checks the request under another host name. It does so by sending a regular `host` header field next to the `:authority` pseudo-header. `apache_request_headers()` and `getallheaders()` return the same value. HTTP/1.1 and HTTP/3 are not affected: Go removes `Host` from the HTTP/1 headers, and quic-go rejects a `host` field that differs from `:authority`.
Applications that select a tenant or an area from `HTTP_HOST`, or use it to build absolute URLs, password reset links or cache keys, can be made to act on a host the request was not routed on. For instance, with an `admin.example.com` site restricted by `remote_ip` and a public `www.example.com` site sharing the same root, a request routed through `www.example.com` reaches the admin code with `HTTP_HOST=admin.example.com`.
`SERVER_NAME` and `SERVER_PORT` are not affected. TLS sites using Caddy's default protocols are affected; cleartext sites only when `h2c` is enabled. HTTP/1.1 is not affected: `net/http` rejects duplicate `Host` lines.
Patches
Fixed in 1.13.5.
Workarounds
Use `$_SERVER['SERVER_NAME']` instead of `HTTP_HOST` for security decisions, or disable HTTP/2 for sites where the application trusts `HTTP_HOST`.
Details
FrankenPHP writes `HTTP_HOST` twice per request. `addKnownVariablesToServer()` sets it from `request.Host`, the host Caddy matched on. `addHeadersToServer()` then registers every entry of `request.Header`, and a `Host` entry overwrote the first value. `net/http` removes `Host` from the header map for HTTP/1.1, but its HTTP/2 server keeps a regular `host` field there and never compares it with `:authority`.
The fix skips `Host` when registering request headers and makes `apache_request_headers()` report `request.Host` for that field.
Caddy's `fastcgi` transport, used with PHP-FPM, builds `HTTP_HOST` in a similar way.
Proof of concept
www.example.com {
root /srv/app
php_server
}`/srv/app/index.php`:
<?php echo $_SERVER['HTTP_HOST'], ' ', $_SERVER['SERVER_NAME'];Send an HTTP/2 request with these header fields (for instance with a raw HTTP/2 client such as the Python `h2` library):
:method: GET
:scheme: https
:authority: www.example.com
:path: /index.php
host: admin.example.comThe response is `admin.example.com www.example.com`.
Credits
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-I4TNNU7U.
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-2725-rh2w-9j9wLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
