r/PHP
•
u/Svpernova09
•
Oct 20 '26
•
1
News Upcoming Critical PHP Security Release
https://www.php.net/archive/2026.php#2026-10-20-1
731
Upvotes
View all comments
3
u/Old_Adeptness5169 Oct 21 '26 edited Oct 21 '26
Update after PHP's advisories: the session upload-progress handler is one of the confirmed routes, but not the only one. The advisories also describe out-of-memory tricks in the multipart parser, plus some routes no extension can close. v3 carries the fixed multipart parser with a memory guard and keeps the upload-progress handler out, which on typical PHP-FPM hosting closes the routes that work before any application code runs. Still a stopgap: update to 8.5.12/8.4.27/8.3.36/8.2.35 (or your distro's backport) as soon as you can. Thanks to everyone who pushed back today.
Disclosure: I'm with Hosted Power, a hosting company. Patch as soon as the release lands; this is for what you can't patch today. We have a stopgap and would love it reviewed.
The idea: ext/session installs
php_session_rfc1867_callbackinto the globalphp_rfc1867_callbackat MINIT, andmain/rfc1867.cchecks that pointer for NULL before every call. A tiny extension withZEND_MOD_OPTIONAL("session")that sets the pointer back to NULL in its own MINIT makes the upload-progress handler (where the researchers who reproduced the bugs placed them) unreachable for the life of the process.$_FILES,$_POSTand sessions behave as before; only the upload_progress entries in$_SESSIONdisappear.Why not just
session.upload_progress.enabled=Off? On a box you control, that's probably fine. On shared hosting it's a per-directory setting, so any site's.user.inican turn it back on.One C file, builds for 5.6 to 8.5 (so it also covers versions that won't get a fix), with prebuilt NTS binaries and Ansible for Debian/Sury, cPanel and DirectAdmin: https://github.com/HOSTED-POWER/php_uploadprogress_guard
It's a few hours old and only helps as far as the bugs live in that handler. We'll check it against the official advisory at 14:00 UTC and post the result. Corrections very welcome.