Skip to content

Report requests that PHP-FPM fails to start as errors - #2226

Open
GrahamCampbell wants to merge 1 commit into
brefphp:masterfrom
GrahamCampbell:fpm-empty-response
Open

GrahamCampbell wants to merge 1 commit into
brefphp:masterfrom
GrahamCampbell:fpm-empty-response

Conversation

@GrahamCampbell

@GrahamCampbell GrahamCampbell commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

When PHP-FPM fails to start a request, for example because PHP runs out of memory while parsing the request body, the worker ends the FastCGI request without writing any output and exits with code 70 (see php_request_startup() in sapi/fpm/fpm/fpm_main.c). Bref turns that empty output into a 200 with an empty body, so the failure is invisible to clients and to the Lambda error metrics. PHP-FPM writes at least the blank line that ends the headers for any request it actually runs, so empty output can only mean the request never started, and this now throws FastCgiCommunicationFailed like the other PHP-FPM failures. The advisory for CVE-2026-109618 describes request bodies crafted to run PHP out of memory during request startup, which on PHP-FPM end up on exactly this path. The test runs PHP-FPM with a low memory limit and posts enough small form variables to exceed it while the body is parsed.

@GrahamCampbell
GrahamCampbell marked this pull request as ready for review October 21, 2026 15:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant