Most website security scares happen one layer up. A WordPress plugin has a hole, a Laravel package needs a bump, and you update the app and move on. This one is different. PHP2Shell sits in PHP, the engine underneath all of those apps, and in the worst case it is triggered before your app's code has even started running. No plugin update, theme update or WordPress release can fix it. The fix is a new PHP.
The two bugs, tracked as CVE-2026-109618 and CVE-2026-109619, were found by researchers at Calif, Wiz and OpenAI and reported to PHP's security team. Both are rated 9.2 out of 10 on the CVSS v4 scale, and PHP confirms both can lead to remote code execution by an attacker who never logs in.
What PHP2Shell actually is
Both bugs come down to PHP leaving its own memory in a bad state when a web request doesn't finish the way it should. PHP's advisory describes them in plain enough terms.
- CVE-2026-109618, out-of-memory corruption. If PHP runs out of memory partway through setting up a request, some of its internal data is left half built. The clean-up code that runs afterwards treats that half-built data as valid.
- CVE-2026-109619, stale global state. Some data that belongs to one request can outlive the memory it points to. A later request handled by the same PHP worker can then pick up the leftovers. As well as code execution, PHP lists memory disclosure as a confirmed impact. In other words, one visitor's request can leak pieces of another's, including passwords, tokens and keys.
- Request arrivesFrom any visitor. No login needed.
- PHP sets up the requestReads the body, form fields and uploadsCVE-2026-109618Runs out of memory partway through and leaves data half built
- Your app runsWordPress, Laravel, Drupal or your own codeOn mod_php, the demonstrated exploit has already fired before this step
- Clean-up, then the next requestThe same worker is reusedCVE-2026-109619Leftover state points at freed memory, and the next request uses it
That is the part that makes this serious. Most web attacks need a weakness in your code. This one needs only a PHP server that accepts requests from the internet, which describes most of the web.
A leak forced an early release
The plan was a quiet, coordinated fix on 22 October. Linux distributions and long-term support vendors had already received patches in advance so they could ship on the same day. Then the CVE numbers leaked.
- An attempt, four days earlyAmazon's honeypots log an exploitation attempt before anything is public. How the attacker knew is unclear.
- The leakA Hacker News post names the flaws. It is removed, but screenshots spread and watchTowr confirms they are real.
- PHP brings it forwardThe security team announces an emergency release for 14:00 UTC the next day, a day ahead of plan.
- Fixes shipPHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Calif and Wiz publish write-ups and Cloudflare deploys WAF rules.
- Attempts reportedAmazon, Cloudflare and watchTowr report attack attempts. CISA hasn't listed the flaws as exploited.
Who is affected
The short answer is almost anyone running PHP that serves web pages. The PHP team's advisory names every common setup: PHP-FPM behind Nginx or Apache, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The longer answer depends on two things, which PHP branch you are on and how PHP is plugged into your web server.
By version
By server setup
How PHP is wired into the web server changes how much has been proven so far, but not whether you need to patch. One write-up put it bluntly: not having been demonstrated on FPM does not make it safe.
Highest risk, says PHP. Full remote code execution has been shown over HTTP, before any app code runs.
Source analysis suggests it is open to the memory bug the same app-independent way as mod_php.
Affected. No complete exploit of the memory bug shown yet. The stale-state bug has a validated path that depends on what the app does.
Behaves like FPM. App-specific exploits are considered likely but unvalidated.
Named as affected in the advisory. No separate breakdown published.
By what you run on top
Because the bug is in PHP rather than any one app, everything built on it inherits the exposure. Calif says it confirmed pre-login code execution against specific versions of WordPress, Drupal, Joomla and Magento, and Wiz demonstrated it against WordPress, Drupal and Joomla. The flaw isn't in those projects, which is why updating them won't help.
Nobody knows exactly how many servers are exposed, and the estimates show it. They measure different things, but even the lowest runs well past a million.
Is it being exploited?
The honest answer is that the reports conflict. Amazon says php2shell is now being broadly exploited and that its 21 October attempts point to several different attackers. Cloudflare's CTO said it was seeing early attacks before the patches shipped, and watchTowr says its honeypots have seen attempts against both bugs. On the other side, CISA said on 21 October that it had not seen exploitation, and as of 22 October neither bug was in its Known Exploited Vulnerabilities catalogue. Huntress hadn't seen any on its customers' systems, and no confirmed breach had been made public.
Attempts are not the same as successful break-ins, and some of what the honeypots catch is probing. But the direction of travel is clear. Proof-of-concept code is circulating, Calif and Wiz have published technical write-ups, and the UK's National Cyber Security Centre has told organisations to update immediately or take affected systems offline.
Check your version
Start with the PHP that actually serves your website, not just the one on your command line. They are often different builds, and sometimes different versions. On a server running PHP-FPM, run php-fpm8.4 -v (swap in your version). With Apache and mod_php, php -v only shows the command-line build, so check the installed Apache PHP package instead, for example with dpkg -l 'libapache2-mod-php*'. On WordPress, go to Tools → Site Health → Info → Server. Most hosting control panels show it too. Then paste it here.
What to do now
Updating PHP is the only complete fix. PHP's own advisory says no configuration change fully mitigates these flaws. What updating involves depends on who looks after your server.
- Ask your host directly whether they have applied the 21 October PHP security release to your server. Your host runs PHP for you, so the patch is theirs to roll out. Some hosts have only added interim protection, so ask whether it is patched, not just protected.
- Don't rely on WordPress, plugin or theme updates. They're still worth installing, but none of them can fix a bug in PHP.
- If you're on PHP 8.1 or older, move to 8.2 or newer. Most control panels let you switch versions yourself. Take a full backup first, try it on a staging copy if your host offers one, and check your key pages and forms afterwards.
- Treat a CDN or firewall as a seatbelt, not a fix. Cloudflare has free WAF rules for the known attack patterns, but they only cover traffic that goes through Cloudflare, and attackers can sometimes reach a server directly.
- Leave server settings to your host. The stopgap settings further down are for whoever administers the server, not for
.htaccessor plugin settings.
- Inventory every PHP install. Include ones bundled into control panels, vendor software and appliances. Internet-facing servers come first, and Apache with mod_php comes first among those.
- Update from your distribution's packages (
apt,dnfand so on), which were prepared ahead of the release. Third-party repositories lagged on day one. If yours has no update, switch to distribution packages or build from source. - Restart every PHP process. Restart PHP-FPM, Apache and any long-running workers. A new package on disk does nothing while the old code is still loaded in memory.
- Confirm it took. Re-run
-vagainst the binary that serves web traffic, or check your vendor's fixed package version if it backports. - Can't patch yet? Take the server off the internet, or put it behind a VPN or a filtering proxy until you can. That is what the UK NCSC and CISA advise, and CISA suggests the same for anything still on PHP 8.1 or older.
- Rebuild and redeploy your images. A container built last week still has last week's PHP inside it, whatever the host underneath is running.
- Pin the fixed version in your base image tag or build, such as
8.4.27or later, so a cached layer can't quietly bring the old one back. - Check your platform's status page. Managed platforms differ. Some patched in place, while on others the servers are yours to update. Don't assume it has been done for you.
- Search for strays. CI runners, staging boxes, preview environments and old side projects running PHP are easy to forget and just as reachable.
- Set
session.upload_progress.enabled=0inphp.inior the FPM pool config, not withini_set()or.user.ini. On PHP 8.5, also setfatal_error_backtraces=0. - Set
memory_limit=-1somewhere apps can't override, such asphp_admin_value, and keeppost_max_sizelow. Put a container or cgroup memory limit around PHP instead. - Cap request and upload sizes at the web server or proxy, and block multipart uploads before they reach PHP if your app doesn't take them.
- Restart every PHP worker after changing any of these.
Check you weren't hit
If a server was exposed before you patched, it is worth a look. Incident responders at Huntress suggest watching for the signs an attacker leaves when they get code running through a web server:
- PHP or web server processes (
php-fpm,php-cgi,apache2,httpd) starting shells, scripting languages or download tools such ascurlandwget. - Reconnaissance commands like
whoami,idoruname -arun from the web server account. - New or changed PHP files in your web root that you didn't put there, plus new cron jobs, scheduled tasks or user accounts.
If anything looks wrong, take the server offline and keep the web server and PHP logs before you clean up. Because the stale-state bug can leak memory, also rotate the passwords, API keys and tokens that server could see.
What happens next
The fixed releases are the easy part. The hard part is the long tail. PHP runs on millions of servers that nobody logs into from one year to the next, from old company sites to appliances whose makers stopped shipping updates years ago. Seven affected branches get no fix at all from the PHP project. Forensics expert Hal Pomeranz expects exactly that: a long tail of servers that stay vulnerable for years.
Watch for two things in the coming days. The first is CISA's exploited-vulnerabilities catalogue. If PHP2Shell is added, US federal agencies get a hard deadline, and that usually means the attacks are confirmed. The second is vendor advisories for products that bundle PHP, which are slower to arrive and easier to miss. Palo Alto Networks, Fortinet and Cisco were all checking their products when the fixes shipped.
There is also a bigger story here. Wiz says frontier AI models substantially lowered the barrier to turning these long-standing weaknesses into a working exploit. Some of the same bugs may have sat in PHP since 2012. AI tools are making old flaws in widely used software faster to find and faster to weaponise, for researchers and attackers alike. That makes boring, quick patching more valuable than it has ever been.
For today, the job is simple. Find out which PHP serves your sites, get it to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or a vendor build with the fix, and restart it.
Sources and further reading
- Tenable: php2shell FAQ for CVE-2026-109618 and CVE-2026-109619
- watchTowr: PHP2Shell FAQ, fixes and timeline
- Huntress: Rapid response to php2shell, with detection guidance
- BleepingComputer: PHP ships emergency patches for critical PHP2Shell flaws
- Help Net Security: PHP2Shell vulnerabilities patched
- DEV Community: Versions, risk by SAPI and stopgaps
- Codeable: What WordPress site owners need to do
- Canadian Centre for Cyber Security: Alert AL26-026
Related: the worm that thinks could live in a $55 TV box, on how unpatched devices could host self-copying AI, and why OpenAI pulled its next model.
