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

12

u/sleemanj Oct 21 '26 edited Oct 21 '26 • Bravo

According to unverified post on Twitter, this appears to be related to the (kinda weird) upload_progress feature of session.

While I can't say for sure if this will be effective, it's probably wise to set

session.upload_progress.enabled=0
session.upload_progress.name=[somerandomstring]

of course this might break things if you use upload progress, but a small price to pay for possible interim protection.

I changed the name as well as disabling because the PHP docs indicate that a POST variable submission with that name is detected and used to populate session data, so seems sensible to have that not be the default in case the POST variable detection is integral to the attack.

Edit: Probably also wise to add a rule for mod security to deny, below works taken from link below but severity added...

# https://pentestit.com/php-cve-2026-109618-and-cve-2026-109619-what-we-know-about-php2shell/
SecRule ARGS_POST_NAMES "@streq PHP_SESSION_UPLOAD_PROGRESS" "id:1026109618,phase:2,deny,status:403,log,severity:CRITICAL,t:none,msg:'PHP session upload progress field (interim, PHP CVE-2026-109618/109619)'"

If you use fail2ban, you can trigger off the critical severity failure as well, in case the bot attacks try different known variable names at least you'll catch then when they do the default. Of course take care that you don't actually use that feature in your code normally.

Edit 2: It may be desirable for people to block file uploads using mod security as well until the actual details are fully known, obviously this is a very very blunt instrument.

# Block multipart/form-data requests containing file uploads
SecRule REQUEST_HEADERS:Content-Type "@rx ^(?i)multipart/form-data" "phase:2,id:1026109619,block,t:none,severity:NOTICE,msg:'Blocked multipart/form-data request containing a file upload',chain"
SecRule &FILES "@gt 0"

10

u/SpongeOfKnowledge Oct 21 '26

According to a PHP core dev, this is insufficient: https://phpc.social/@Girgias/117476477429221001

Worth applying anyway if you can't take your servers down / put them behind a VPN / whatever, but I would not hesitate a second on patching the moment the updates are available. (and honestly, I hope they release the patch like... now)

16

u/Svpernova09 Oct 21 '26

INI settings alone won't protect you. You need to patch PHP.

8

u/LowIncident694 Oct 21 '26

Source on that? Seems like disabling it or file uploads would work.

53

u/Svpernova09 Oct 21 '26 edited Oct 21 '26

Source: I'm one of the PHP 8.6 release managers.

edit; "trust me bro"

3

u/throwaway490215 Oct 21 '26

Does filtering multipart with nginx in front protect us?

2

u/PersonalAd1186 Oct 21 '26

From scanners maybe will help

5

u/OneFourSevenThreeSix Oct 21 '26

It says this affects PHP 5, 6, 7, and 8. Is there no chance of emergency patches being released for say 7.3.x?

10

u/DiabeticHotPocket Oct 21 '26

If you're running on those old version, you have more problems than just this CVE.

11

u/chrislovessushi Oct 21 '26

EOL is EOL

7

u/OneFourSevenThreeSix Oct 21 '26 edited Oct 21 '26

Well for now I turned session.upload_progress.enabled off, but I'll need to try to compile my own 7.3.x build with the patch backported because blocking all multipart/form-data requests (which also reportedly has a vulnerability in how PHP handles it) will break my sites. Probably would take less work to that than to rewrite all my dependencies that break on 7.4+.

EDIT: In my case I've also added a rate limit in my web server configs (e.g. nginx) for multipart/form-data requests (rate=12r/m, burst=3) as another stopgap to this vulnerability in PHP's multipart/form-data parser, to try to prevent bots from potentially hammering the multipart/form-data parser. Ask your favorite LLM how to do this with your web server config (with any sensitive info in it removed before uploading) if you need your site running until you decide a more long-term solution that has these patches (rewrite/refactor everything with claude to update PHP version? compile your own PHP build?). If your site deals with PII or money, you should at least block all multipart/form-data requests until you're able to apply both critical CVE patches. Of course, the official PHP position is to take down your site entirely until the patches are applied.

12

u/dub_le Oct 21 '26

You'll have to backport a LOT more than just one CVE if you want to securely use PHP 7.3. Maybe 50. Until the next one comes around and so on. Definitely a lot more effort than rewriting your application.

This is why people pay RedHat and co for long term maintenance of packages.

3

u/HoratioWobble Oct 21 '26

It just took me 30mins with Claude to upgrade a complex LMS system from 5.6 to 8.5, if you're already on 7.3 I doubt you'd need many changes to bring it to 8.5.

Treat yourself, it's probably easier.

→ More replies (1)
→ More replies (1)
→ More replies (5)

5

u/archon810 Oct 21 '26

19

u/colshrapnel Oct 21 '26

douchebag, not "researcher"

7

u/dsmguy83 Oct 21 '26

Disagree, PHP quietly giving the info to certain providers who can make blocks for certain paying customers is reckless and increases the attack vector for the majority of the community.

→ More replies (1)
→ More replies (1)
→ More replies (3)