A 438KB Request Killed the Vulnerable PHP Build. The Patched One
The author compiled the last vulnerable PHP release (8.4.26) and the fixed one (8.4.27) and sent both a 438KB multipart request with deeply nested field names. The vulnerable build died with an out-of-memory fatal error and its worker process was replaced, while the patched build rejected the request at a new multipart part limit and kept running.
Published on medium.com
This morning I downloaded php-8.4.26.tar.gz and php-8.4.27.tar.gz from php.net, compiled both with the same minimal configuration, and sent both the same 438,104-byte HTTP request: 1,200 multipart file-upload parts with empty filenames and field names nested 60 levels deep. That request is the documented trigger for…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the vulnerable build's out-of-memory handling used a longjmp that skipped cleanup, leaving a half-built hash table that teardown then trusted, while the patch removed that longjmp and added a multipart part limit.
Impact
The vulnerable build's worker process died and was replaced, and the author notes that the exploitable teardown-consumption is specific to mod_php, which they did not test; they demonstrated the trigger and worker death, not code execution.
What the attacker needed
PHP 8.4.26 or earlier; default memory_limit=128M; unauthenticated HTTP access
The fix
The patch removed the out-of-memory longjmp, added a hard memory limit, made hash operations fallible, reset request state before parsing, and introduced a multipart body parts limit; the text says it was fixed in 8.4.27.
How it was found
- Download and compile PHP 8.4.26 and 8.4.27 from php.net tarballs with the same minimal configuration.
- Configure both builds with production defaults: memory_limit=128M, post_max_size=8M, max_file_uploads=20, max_input_vars=1000.
- Build a 438,104-byte HTTP request with 1,200 multipart file-upload parts, empty filenames, and field names nested 60 levels deep.
- Send the request to the vulnerable 8.4.26 build and observe a fatal memory-exhaustion error and the worker process being replaced.
- Send the same request to the patched 8.4.27 build and observe a multipart body parts limit warning, the script running, and the worker staying alive.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
PHP is a programming language used by many websites. The author tested two versions of PHP: an older one with a known bug and a newer one where the bug was fixed. They sent a specially crafted large web request to both. The older version crashed and had to restart its worker process, while the newer version refused the request and carried on working.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.