GHSA-HFXC-999W-MP67
Process crash when the autoscaler cannot create a PHP thread
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:H/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-HFXC-999W-MP67 divulgada · CVSS 3.7 (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 |
Impact
When thread autoscaling is enabled (`max_threads` greater than `num_threads`), FrankenPHP creates new PHP threads at request time. If the operating system refused to create a thread, FrankenPHP panicked and the whole process exited, stopping every site it serves. The same happened when a thread restarted at the limit, for instance after `max_requests`.
A remote, unauthenticated client can trigger this by keeping enough slow requests open (for example stalled POST bodies or requests to a slow script) for the autoscaler to reach the process thread limit. This requires `max_threads` to be high enough that the PHP threads plus the Go runtime threads exceed that limit. The systemd units shipped in the `.deb` and `.rpm` packages set `LimitNPROC=512`, and `max_threads auto` can compute a value close to 512 on hosts with a lot of memory. The client can repeat the attack after each restart.
Without autoscaling, a client can't raise the number of threads, but the crash can still happen when a thread restarts (after `max_requests`, or when workers restart) while the process is at its thread limit, since the exiting thread still counts for a moment. Small fixed pools are affected too when other processes running as the same user use up the limit. Installations without a thread limit are not affected.
Patches
Fixed in 1.13.5.
Workarounds
Set `max_threads` well below the process thread limit (`LimitNPROC`, `ulimit -u`, or the `pids` cgroup limit), or raise that limit. Setting `max_threads` equal to `num_threads` disables autoscaling, which removes the client-driven trigger only; leaving `max_requests` unset avoids most restart-time failures.
Details
`(*phpThread).boot()` panicked with `unable to create thread` when `pthread_create()` failed. Since autoscaling was added in 1.5.0, `boot()` also runs on the autoscaler goroutine through `getInactivePHPThread()`, where nothing recovers the panic.
`boot()` now puts the thread back in the reserved state and returns an error. At runtime, `getInactivePHPThread()` reports that no thread is available, and the autoscaler logs the same warning as when `max_threads` is reached. At start-up, `Init()` returns the error.
Restarting a thread (`max_requests`, worker restarts) now retries thread creation for about half a second, since the exiting thread may still count against the limit. If it still fails, the error is logged, the thread slot is released, and FrankenPHP keeps trying in the background to replace the thread, with a backoff capped at 10 seconds, until it succeeds or the server shuts down. Recreating the main PHP thread during a full restart (`RestartWorkers()`, hot reload, `opcache_reset()`) retries the same way; if that keeps failing, the process still exits.
Proof of concept
Run the server under a thread limit lower than `max_threads`:
{
frankenphp {
num_threads 4
max_threads 512
}
}
:8080 {
root public/
php_server
}With `LimitNPROC=512`, open a few hundred connections that each send the headers and part of the body of a form POST, then stall. Within about a minute the process exits with `panic: unable to create thread`.
Credits
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-JLXPASPI.
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-hfxc-999w-mp67Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
