GHSA-PMVG-8483-MW84
http_get_last_response_headers() leaks upstream response headers across worker-mode requests
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-PMVG-8483-MW84 divulgada · CVSS 3.7 (GitHub) | |
| Remediación | Parche v1.13.4 | github.com/dunglas/frankenphp · 0 d desde divulgación | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
In worker mode, `http_get_last_response_headers()` (PHP 8.4+) returned the response headers of the last HTTP stream request made by an earlier request on the same thread, such as `Set-Cookie` or token headers sent by a backend API.
A later request, possibly from another user, can read headers fetched by an earlier one. Exploitation requires application code that calls `http_get_last_response_headers()` without making an HTTP stream request first in the same request (for example, after a fetch that failed before connecting).
Classic (non-worker) mode is not affected.
Patches
Fixed in 1.13.4 by https://github.com/php/frankenphp/commit/3fade63bb1c1d246926ed8a00520015f94cdc819: FrankenPHP now clears the last response headers between worker requests, as PHP's standard extension does at request shutdown.
As hardening, the same commit also resets the `strtok()` state and the URL rewriter variables (`output_add_rewrite_var()`) between worker requests. PHP releases them at the end of a script, but doesn't document them as request-scoped: relying on `strtok()` continuing a string from a previous request was never supported, so this is not part of the vulnerability.
Workarounds
Call `http_clear_last_response_headers()` at the start of each worker request.
Details
PHP's standard extension clears this state in its `RSHUTDOWN` handler, which does not run between worker requests. FrankenPHP already cleared `error_get_last()` and libxml errors between worker requests (see GHSA-4gfw-9v29-gp9h), but not this state.
Proof of concept
With one worker:
- `GET /?m=fetch`: the worker calls `file_get_contents()` on an upstream returning `Set-Cookie: upstream_session=victim-token`.
- `GET /?m=read`: a request that makes no outbound HTTP call. `http_get_last_response_headers()` returns the `Set-Cookie` header of step 1. In classic mode it returns `NULL`.
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.4 | 0 d | v1.13.6 no afectada |
v1.13.4Arsenal 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-pmvg-8483-mw84Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
