What happened
On October 21, PHP shipped emergency updates for two critical bugs in PHP itself. The pair has been nicknamed PHP2Shell, because that’s what it gives an attacker: a shell on your web server, with no login needed.
This isn’t a WordPress plugin bug or a problem in one app. It’s in the PHP engine, so anything running on an unpatched PHP version is in scope: WordPress, Drupal, Joomla, Laravel, Magento, or a homegrown site. PHP-FPM, Apache mod_php, php-cgi, LiteSpeed and FrankenPHP are all affected. PHP says mod_php is the worst case: there, one crafted request can trigger the attack before any of your own code runs.
Security firms, including watchTowr, report that attackers are already trying it on real servers. CISA said on October 21 that it hadn’t confirmed exploitation yet, but told everyone to patch immediately anyway. Don’t wait for that to change.
The two CVEs
| CVE | What goes wrong | Severity |
|---|---|---|
| CVE-2026-109618 RCE via OOM corruption | If PHP runs out of memory at the wrong moment while reading a request, it leaves that request’s data half set up, then treats it as valid during cleanup. | Critical, CVSS 9.2 |
| CVE-2026-109619 RCE via stale global state | After a fatal error, PHP can keep pointers to memory it has already freed. The next request on the same worker can then use that leftover data. | Critical, CVSS 9.2 |
How to check if your server is vulnerable
You’re vulnerable if your PHP is older than the fixed release for its branch:
| Your branch | Safe from | Status |
|---|---|---|
| 8.5 | 8.5.12 | Supported |
| 8.4 | 8.4.27 | Supported |
| 8.3 | 8.3.36 | Supported |
| 8.2 | 8.2.35 | Security fixes until Dec 31, 2026 |
| 8.1 and older | No official release | End of life: use a distro package or upgrade |
Check the PHP that actually serves your website, not just the one on the command line. They are often different.
$ php -vPHP 8.3.30 (cli) (built: Sep 2 2026)# 8.3.30 is older than 8.3.36 → vulnerable$ php-fpm8.3 -vPHP 8.3.30 (fpm-fcgi) (built: Sep 2 2026)$ dpkg -l | grep php8.3-fpmii php8.3-fpm 8.3.30-1 amd64 server-side, HTML-embedded scripting...
Three gotchas worth knowing:
- Distro packages can be patched without the number changing. Ubuntu and Red Hat often backport fixes into an older version number. If you use their packages, check your package version against their CVE page (linked at the end), not just PHP’s table above.
- On shared hosting or cPanel, look at the PHP version in your control panel. On WordPress it’s under Tools → Site Health → Info → Server.
- Docker images are only patched when you rebuild them. An old
php:8.3-fpmimage stays vulnerable until you pull and redeploy.
How to fix it
Update PHP, then restart every PHP process. The restart matters: workers that are already running keep the old, vulnerable code in memory.
# Debian / Ubuntu$ sudo apt update && sudo apt upgrade$ sudo systemctl restart php8.3-fpm# mod_php? restart apache2 instead # RHEL / AlmaLinux / Rocky$ sudo dnf upgrade 'php*'$ sudo systemctl restart php-fpm# mod_php? restart httpd instead # Then confirm$ php-fpm8.3 -vPHP 8.3.36 (fpm-fcgi) ✓ patched
- Shared or managed hosting: you can’t patch PHP yourself. Open a ticket and ask, in writing, whether PHP2Shell (CVE-2026-109618 and CVE-2026-109619) is patched on your server.
- Plesk or cPanel: apply the panel’s PHP updates. Plesk has a specific article for its bundled PHP.
- Still on 8.1 or older: use your distro’s patched package if there is one. Otherwise, this is the push to move to 8.3 or 8.4.
If you can’t patch today
PHP is blunt about this: there are no complete mitigations, updating is the only safe choice. These settings from the advisory block the known attack paths and buy you a day or two, nothing more:
- Set
session.upload_progress.enabled=0inphp.inior the FPM pool (not in.user.inior withini_set()), then restart all workers. - On PHP 8.5, also set
fatal_error_backtraces=0. - Keep
post_max_sizelow: 8M if you don’t take uploads, 32M if you do. - Turn on your web application firewall and keep the server behind it.
- Watch for PHP worker processes starting shells or downloading tools (
sh,bash,curl,wgetas children ofphp-fpmorapache2). That’s the clearest sign someone got in.
If a server can’t be patched at all, CISA’s advice is to take it off the internet until it can.
Official links
- PHP security announcement and downloads
- GitHub advisories: CVE-2026-109618 · CVE-2026-109619
- CISA alert
- CVE records: CVE-2026-109618 · CVE-2026-109619
- Your distro: Ubuntu · Debian · Red Hat
- PHP supported versions
Quick answers
Is my WordPress site affected by PHP2Shell?
Probably, if it runs on an unpatched PHP version. The bug is in PHP itself, not in WordPress or a plugin, so updating WordPress does not fix it. Check the PHP version under Tools → Site Health → Info → Server, then ask your host to confirm they have applied the patch.
Does a firewall or Cloudflare protect me from PHP2Shell?
A web application firewall can block some attack attempts and is worth turning on while you patch, but it is not a fix. PHP says plainly that there are no complete mitigations and updating is the only safe choice.
Is PHP 8.1 or 7.4 getting a fix for PHP2Shell?
Not as an official release. PHP 8.1 and older are out of support, but the PHP security team published minimal source backports for 7.4, 8.0 and 8.1, and many Linux distributions ship patched packages. The real answer is to move to a supported branch.
My site doesn't use PHP. Do I need to do anything?
No. PHP2Shell only affects servers running PHP. Sites built on Node.js, Next.js, Python or static hosting are not affected — though it is worth checking that nothing else on the same server, like an old admin panel or a forgotten WordPress install, is running PHP.