GHSA-8386-64GM-3M8Q
Per-request environment variables leak into later 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:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-8386-64GM-3M8Q divulgada · CVSS 4.8 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Remediación | Parche v1.13.4 | github.com/dunglas/frankenphp · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
In worker mode, environment variables set for a single request stayed visible to later requests on the same PHP thread. This covers variables set by the Caddy `env` directive using request placeholders (such as `{http.request.header.*}`), by route-specific `env` blocks, and by `frankenphp.WithRequestEnv()` and `frankenphp.WithRequestPreparedEnv()` in the Go API.
- `getenv()` returned values from an earlier request.
- `$_SERVER` contained variables that only an earlier request had set.
- After the first `putenv()` on a thread, `getenv()` kept returning the values of the request that called it, hiding the values of later requests.
A request can read values computed for another user's request, and an application relying on these variables (for routing, tenant selection or authorization) can act on the wrong values.
Applications whose environment variables are the same for every request are not affected. Classic mode is not affected.
Patches
Fixed in 1.13.4 by https://github.com/php/frankenphp/commit/72f9366de07093ba3f524af3e6c73451012e5199. FrankenPHP now releases per-request variables after each worker request, keeps `$_ENV` limited to the environment of the worker script, and stores `putenv()` writes as overrides on top of the other layers.
Workarounds
Don't use per-request environment variables for worker routes, or read the values from request headers or `$_SERVER` keys that are set on every request.
Details
Per-request variables were stored in a thread-local table that was only released when the worker script ended, not after each request. Each request only updated the keys it set, and the first `putenv()` copied the table into the `putenv()` sandbox.
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-8386-64gm-3m8qLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
