r/PHPhelp • • 15d ago

PHP2Shell

I'm fed up with all the fake and false information about the PHP2Shell vulnerability. Do you have any idea what the vulnerability actually looks like, like a memory issue or a request handling problem, what exactly is it?

0 Upvotes

7 comments sorted by

3

u/Matrix009917 15d ago

It's a problem with session using memory limits that allow an attacker to run code inside your server. Read here: https://calif.io/php2shell/ It's worse with Apache, a little difficult on php fpm. Are two different vulnerability but with the same purpose.

4

u/magicmulder 15d ago

This is the explanation by the folks who discovered it: https://calif.io/php2shell/

It’s basically a way to use carefully crafted fake upload requests to get the server to execute code.

2

u/Alone_Leading_4685 11h ago

Appreciate the direct source, the noise around this bug has been ridiculous

1

u/martinbean 15d ago

If you’ve been pwned then the telltale signs would be higher-than-usual resource usage (memory, CPU, bandwidth, etc) and maybe new user accounts that you don’t recognise (although they’re not needed if someone has root access on the server).

The only way to know for sure is to check logs of commands ran on your server. Until you’ve ruled out you’re safe, you must assume you have been compromised. And if any apps on the server deal with any personal data whatsoever, and you find evidence your server has been compromised, then you will most likely have a legal responsibility to disclose that to your country’s information office. Security isn’t a subject you have the luxury of going, “Meh, it’s probably fine.”

Then again, I’d have thought that someone showing an interest in cybersecurity and ethical hacking less than a year ago would take this far more seriously…

1

u/thejester1324 15d ago

Both, in sequence. A request pushes PHP past memory_limit while it is still parsing the body, and the crash can leave request data half-built or already freed. A later request handled by the same worker may then use that stale state. That is where the code execution comes from.

php.net's 21 Oct advisory covers both CVEs: CVE-2026-109618 is the out-of-memory one, CVE-2026-109619 is the stale state one. Fixed in 8.5.12, 8.4.27, 8.3.36 and 8.2.35. 8.1 and older are out of support. php.net has source backports for 7.4, 8.0 and 8.1, and your distro may ship a fixed package.

Full write-up of the chain: https://calif.io/php2shell/

0

u/isoAntti 15d ago

It lets basically outside people crash your php executable. There's a miniscule chance with enough tries to actually run user specified code.

If you don't need uploads drop multipart from Apache, or limit it to a certain url. And/or session cookie