GHSA-5F4M-FF4W-G458
Client disconnect with an uncommon header name crashes the process in worker mode
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5F4M-FF4W-G458 divulgada · CVSS 7.5 (GitHub) | |
| 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
An unauthenticated client can crash the whole FrankenPHP process. It sends a request with a header name FrankenPHP has not seen recently to a worker, then resets the connection before the request is handled. The process panics and exits, dropping every in-flight request on every site it serves. Repeating the request after each restart keeps the server down.
This was observed in production, triggered by scanners sending bursts of aborted requests.
Only worker mode in FrankenPHP 1.13.2 and 1.13.3 is affected. Classic mode and earlier versions are not.
Patches
Fixed in 1.13.4 by https://github.com/php/frankenphp/commit/b735dd9c39b5fbbb80b8a400b103d9cea0c249c2.
Workarounds
Use classic mode instead of worker mode, or downgrade to 1.13.1.
Details
When building `$_SERVER`, FrankenPHP converts header names to their `HTTP_*` form through a 256-entry cache (`phpheaders.GetUnCommonHeader()`), passing the request context. Since otter v2.4.0, bumped in FrankenPHP 1.13.2, `Cache.Get()` returns the context error on a cache miss once the context is canceled. `GetUnCommonHeader()` turned that error into a `panic`, which aborts the process because it happens on a thread called from C.
FrankenPHP 1.13.2 also started canceling queued requests when the client disconnects, which is what lets a request reach this code with a canceled context. The fix stops passing the request context to the cache: converting a header name is a pure string transform.
Proof of concept
Run any worker (`frankenphp { worker public/worker.php }`) and send:
import socket, struct
s = socket.create_connection(("127.0.0.1", 8080))
s.sendall(b"GET / HTTP/1.1\r\nHost: localhost\r\nX-Probe-1: 1\r\n\r\n")
s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", 1, 0))
s.close()The process exits with `panic: context canceled` in `phpheaders.GetUnCommonHeader()`. The trigger is a race with request handling, so it may take several attempts with a fast worker.
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-5f4m-ff4w-g458Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
