GHSA-J45X-H238-H4XX
"request_body_timeout" does not stop slow request bodies
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:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-J45X-H238-H4XX divulgada · CVSS 5.3 (GitHub) | |
| 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 |
Summary
Caddy replaces FrankenPHP's read deadline, making `request_body_timeout` ineffective against slow request bodies.
Details
`go_read_post` sets the configured deadline before PHP reads the body. Caddy 2.11.7 wraps the body with `IdleTimeoutReader`, which replaces that deadline before the network read.
Proof of concept
Run FrankenPHP with two threads and:
php_server {
request_body_timeout 100ms
}Open two HTTP/1.1 connections. On each, send a `POST` with `Content-Length: 100`, send one body byte, then stop. After one second, request a fast PHP endpoint with a two-second timeout.
The fast request times out. Both threads remain blocked until the slow clients close.
Impact
An unauthenticated client can block every PHP thread with one slow connection per thread. Occasional body bytes can extend the block.
Status
caddyserver/caddy#8145, which this advisory was closed on, only lets handler write deadlines cap Caddy's idle write timeout. The read side is unchanged: `IdleTimeoutReader` still sets its own deadline before each body read, so `request_body_timeout` has no effect behind Caddy, whose `read_body` idle timeout (1 minute by default) applies instead. This was confirmed again on 1.13.4.
Patches
- caddyserver/caddy#8284 makes Caddy's idle body reader keep a read deadline set by a handler as a ceiling, instead of replacing it before each read. This alone fixes the proof of concept above.
- FrankenPHP no longer clears the read deadline once it has expired. Without this, when a script writes more than the response buffer after a timed-out read, `net/http` drains the rest of the body on the PHP thread with no deadline, behind Caddy and with the library alike.
The fix ships in the first FrankenPHP release built with a Caddy version that includes caddyserver/caddy#8284.
Bodies that PHP doesn't read at request startup (`PUT`, `PATCH`, `DELETE`, or `POST` with `enable_post_data_reading=Off`) are still drained without a deadline when the script writes more than the response buffer or calls `flush()` before reading them. This is tracked separately.
Workarounds
Lower Caddy's own body idle timeout, which is the one in effect behind Caddy:
{
servers {
timeouts {
read_body 10s
}
}
}Credits
Reported by @alexandre-daubois. Also discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-SOADHUU9.
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-j45x-h238-h4xxLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
