If your website runs on PHP, this one is for you. On October 21, 2026, the PHP project shipped emergency fixes for two critical flaws in PHP itself, not in WordPress, not in a plugin, but in the language your site runs on. The pair has been nicknamed PHP2Shell, and attackers were already probing for it before the patch landed.
This is a fast-moving story, so I've kept the facts tight and noted where sources disagree. Here's what happened, why it happened, and what to do about it.
session.upload_progress helps, but only partly. It's two use-after-free bugs in PHP's core. In plain terms: PHP frees a chunk of memory, but something keeps using it afterwards. Attackers can steer what ends up in that memory, and that can turn into running their own code as your web server user, no login needed.
One of the two bugs can also leak memory on its own, a bit like Heartbleed did. Sansec's research says that leaked memory can contain passwords, session tokens, API keys and even TLS private keys from other visitors' requests.
A heads-up on confusion: early coverage tied the session upload feature to CVE-2026-109618, while later analysis (ELLIO) says that path belongs to CVE-2026-109619. The patch covers both, so it doesn't change what you do.
mod_php, where an attack can succeed before any app code runs.Any site serving web requests on PHP, which includes WordPress, Laravel, Drupal, Magento and custom PHP apps. And here's the part many people miss: updating WordPress, your theme or your plugins does not fix this. The flaw lives one layer lower, in PHP itself. (That's different from July's wp2shell, which was a WordPress core bug. I covered it in my WordPress security statistics report.)
| Your PHP branch | Fixed release |
|---|---|
| 8.5 | 8.5.12 |
| 8.4 | 8.4.27 |
| 8.3 | 8.3.36 |
| 8.2 | 8.2.35 (security fixes only until Dec 31, 2026) |
| 8.1 and older | No upstream release. Vendor backport only, or upgrade |
Follow these steps in order to secure your server against PHP2Shell:
php -v tells you the command-line version, but confirm the one serving your site matches it.sudo apt update && sudo apt install --only-upgrade 'php8.*' upgrades all PHP packages together.session.upload_progress.enabled = 0 (in php.ini, .user.ini or .htaccess). It closes the session path only, so treat it as a short-term shield, not a full fix.multipart/form-data requests on pages that never need uploads.PHP 8.1 and older got no upstream release. The honest answer is to move to a supported branch. Since 8.2 only gets security fixes until the end of 2026, aim for 8.3 or newer. As a bonus, newer PHP is also faster, which helps with the slow-site problems I wrote about here.
Reports vary, and it's changing by the hour. Cloudflare, Aikido, Patchstack's hosting partners and ELLIO all reported attack attempts on October 21. One summary published that day (SOCRadar) noted PHP itself hadn't yet confirmed in-the-wild exploitation and CISA hadn't listed the CVEs. Sansec adds that a successful attack needs specific knowledge of the target server and conditions. So not every unpatched site is instantly owned, but automated tools lower that bar quickly. Treat it as actively targeted and patch.
If you'd rather not chase your host for answers, this is the kind of thing I handle for clients. I can check which PHP version your site truly runs on, push your host for the patch, and safely upgrade your site.
Secure My Website Explore Security ServicesIs PHP2Shell the same as wp2shell?
No. wp2shell (July 2026) was a flaw in WordPress core. PHP2Shell is in the PHP runtime underneath, so it affects any PHP site, and WordPress updates don't fix it.
Is disabling session.upload_progress enough?
No. It blocks one known path only. PHP's own guidance is that patching is required.
My host hasn't patched yet. What now?
Ask for a patch date in writing, apply the stopgaps above, turn on WAF rules, and consider moving if they stall. Their silence is a risk in itself.
Which PHP version should I run?
Any patched release on a supported branch. I'd choose 8.3 or newer, since 8.2 only receives security fixes until December 31, 2026.
Cite this page: Maanju, A. (2026). PHP2Shell Vulnerability: Causes, Risks and How to Protect Your Website. ajaymaanju.com. Updated October 22, 2026.
Ajay helps businesses grow online through high-performance websites, SEO strategy and mobile application development — including WordPress builds, speed and Core Web Vitals work, and site rescues. You work directly with him, not an account manager. Explore services at ajaymaanju.com →
Automated page speed optimizations for fast site performance