GHSA-5359-VG53-5464
A failed PHP request startup can crash the server with a segmentation fault
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:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5359-VG53-5464 divulgada · CVSS 5.9 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| 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
An unauthenticated client can crash the whole FrankenPHP process, with every site and in-flight request it serves, by making PHP's request startup fail repeatedly on a regular (non-worker) thread. Two triggers were confirmed:
- A request with more query or form parameters than `max_input_vars`, whose client hangs up before the response. This needs `display_errors=1`, `display_startup_errors=1` and `output_buffering=0`, which are PHP's built-in defaults and apply when no `php.ini` is loaded, as in the official Docker images.
- A `application/x-www-form-urlencoded` POST body large enough to exhaust `memory_limit` while `$_POST` is built. This works with production settings once `post_max_size` is raised to about a quarter of `memory_limit` or more.
Scripts served by workers are not affected. A few dozen requests on two connections were enough in testing. Short of the crash, each failed startup cost a full PHP thread teardown and restart.
Patches
Fixed in 1.13.5.
Workarounds
Load a `php.ini` with `display_errors=0` or `output_buffering=4096` (both PHP templates set the latter), and keep `post_max_size` well below `memory_limit`. These close the known triggers but not the underlying failure handling.
Details
When `php_request_startup()` failed, `php_thread()` treated the thread as unhealthy: it forced `php_request_shutdown()`, freed the thread's TSRM context and started a new thread. The new thread's module globals are allocated with `malloc()` and only initialized by each extension's GINIT. ext/date sets `DATEG(last_errors)` in RINIT only, but its post-deactivate hook, which `php_request_shutdown()` always runs, frees it. When the first request of a new thread also failed during startup, before any RINIT ran, ext/date passed an uninitialized pointer to `efree()` and the process died with a segmentation fault.
A client hang-up was enough to fail the startup: the "Input variables exceeded" warning is written to the client while `$_GET` is built, and the SAPI bailed out on a closed connection because regular threads run with `ignore_user_abort=0`. A fatal error such as an exhausted `memory_limit` during `$_POST` parsing has the same effect without a hang-up.
The fix:
- The SAPI no longer bails out on a closed connection during request startup; the script's first write notices the abort, as when output buffering is on.
- A failed request startup now ends only that request, with a regular request shutdown and a 500 status if headers were not sent, and the thread keeps serving requests.
With threads no longer replaced, the uninitialized `DATEG(last_errors)` can only be reached when the very first request of a thread, including a thread added by autoscaling, fails during startup through a fatal error such as an exhausted `memory_limit`, which requires `post_max_size` above about a quarter of `memory_limit`. Keeping `post_max_size` well below `memory_limit` avoids it. ext/date should initialize it in its GINIT; this is being reported to PHP separately.
The failure handling was introduced in 1.12.2. Before that version, a failed request startup caused a Go panic that exited the process, so older versions are also affected.
Proof of concept
No `php.ini`, PHP's built-in defaults:
$ frankenphp php-server --listen 127.0.0.1:8080`hello.php`:
<?php echo "hello\n";Send, two at a time, a request to `/hello.php` with 1100 query parameters (`?v0=1&v1=1&...&v1099=1`) and close the write side of the socket right after sending it. After a few dozen requests the process exits with SIGSEGV in `zm_post_zend_deactivate_date()` called from `php_request_shutdown()`.
Credits
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-CDG8FSAB.
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-5359-vg53-5464Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
