r/PHP • • Oct 20 '26 • Popcorn 1

News Upcoming Critical PHP Security Release

https://www.php.net/archive/2026.php#2026-10-20-1
731 Upvotes

405 comments sorted by

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_callback into the global php_rfc1867_callback at MINIT, and main/rfc1867.c checks that pointer for NULL before every call. A tiny extension with ZEND_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, $_POST and sessions behave as before; only the upload_progress entries in $_SESSION disappear.

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.ini can 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.

3

u/psihius Oct 21 '26

Sadly php core dev said that this does not work and they can't say more.

1

u/Clarksonism Oct 21 '26

Do you have a source? Would be very valuable to where you got this information

2

u/sleemanj Oct 21 '26

Nice creative way of tempfix'ing it in a more robust way,

Assuming that it's just the upload_progress is the only problem of course.

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.


Thanks! And yes, that assumption is exactly the open question. If the advisory at 14:00 UTC shows a path outside the upload-progress handler, this won't cover it and I'll say so here.

2

u/psihius Oct 21 '26

1

u/FatBook-Air Oct 21 '26

Random interwebs people are saying that POST itself is vulnerable. I don't know if that's true, but if it is, I think the only real mitigation would be having a very well tuned WAF or turning off the site.

1

u/psihius Oct 21 '26

Yeah, people i know just disabled all multipart/data post requests, others took down their services until fixes roll in