Tech analysis · Security

PHP2Shell: patch PHP now. Your plugins can’t fix this one.

Two critical flaws in PHP itself let an attacker run code on a web server without logging in. Fixes shipped on 21 October, a day early after the details leaked, and attack attempts are already being reported. Here is who is affected, how to check your version and what to do today.

By Paddy B23 October 2026Approx. 12 min read
PHP2Shell, CVSS 9.2. A terminal shows php-fpm 8.4.26 flagged vulnerable, then upgraded and restarted to 8.4.27 and patched. Patch to 8.5.12, 8.4.27, 8.3.36 or 8.2.35.

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.

9.2CVSS v4 score for each flaw, rated critical
69.3%of websites with a known server language run PHP (W3Techs)
2012the year PHP 5.4 shipped, the oldest release researchers found affected

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.
Figure 1
Where the two bugs sit in a web request
The life of one request inside a PHP worker. Your application only gets control at step three.
  1. Request arrivesFrom any visitor. No login needed.
  2. PHP sets up the requestReads the body, form fields and uploads
    CVE-2026-109618Runs out of memory partway through and leaves data half built
  3. Your app runsWordPress, Laravel, Drupal or your own code
    On mod_php, the demonstrated exploit has already fired before this step
  4. Clean-up, then the next requestThe same worker is reused
    CVE-2026-109619Leftover state points at freed memory, and the next request uses it
Simplified from PHP's advisory and the BleepingComputer and Help Net Security write-ups. On Apache with mod_php, PHP says a working exploit fires before any application code runs, so your app's own input checks never get a say.

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.

Figure 2
Six days in October
From the first attack attempt to the fixed releases. Times are UTC unless noted.
  1. An attempt, four days earlyAmazon's honeypots log an exploitation attempt before anything is public. How the attacker knew is unclear.
  2. The leakA Hacker News post names the flaws. It is removed, but screenshots spread and watchTowr confirms they are real.
  3. PHP brings it forwardThe security team announces an emergency release for 14:00 UTC the next day, a day ahead of plan.
  4. 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.
  5. Attempts reportedAmazon, Cloudflare and watchTowr report attack attempts. CISA hasn't listed the flaws as exploited.
Sources: Tenable, watchTowr, Huntress and Help Net Security timelines. A leaked score of 10.0 also circulated, but PHP's official rating is 9.2.

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

Figure 3
Every branch from 5.4 to 8.5 is affected. Only four get a release.
PHP release branches and what the PHP project is offering for each
5.4No fix
5.5No fix
5.6No fix
7.0No fix
7.1No fix
7.2No fix
7.3No fix
7.4Source backport
8.0Source backport
8.1Source backport
8.2Fixed in 8.2.35
8.3Fixed in 8.3.36
8.4Fixed in 8.4.27
8.5Fixed in 8.5.12
Official fixed releaseMinimal source patches only, no releaseEnd of life, nothing from the PHP project
Sources: PHP's advisories as summarised by Tenable and watchTowr. Calif traced the oldest affected code path to PHP 5.4.0. The 7.4 to 8.1 patches only help people who build PHP from source. Most people on those versions need a package from their Linux distribution, host or support vendor, or an upgrade.

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.

Figure 4
Every web setup is affected. Some are more proven than others.
How far exploitation had been shown on each setup when the fixes shipped
Apache mod_phpCommon on older and shared hosting

Highest risk, says PHP. Full remote code execution has been shown over HTTP, before any app code runs.

FrankenPHPNewer app server

Source analysis suggests it is open to the memory bug the same app-independent way as mod_php.

PHP-FPMNginx and most modern hosts

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.

LiteSpeed (LSAPI)Popular with WordPress hosts

Behaves like FPM. App-specific exploits are considered likely but unvalidated.

php-cgiSome Windows and legacy setups

Named as affected in the advisory. No separate breakdown published.

The meters are my summary of the PHP advisory as reported by Tenable, watchTowr and others. They show how much has been proven, not whether you are safe. Patch every one of these.

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.

Figure 5
If it runs on PHP, it's in scope
The kinds of software where PHP2Shell matters, from the advisories and incident-response write-ups
WordPressDrupalJoomlaMagento / Adobe CommerceLaravel and Symfony appscPanel and Plesk serversShared web hostingAppliances that bundle PHPWindows apps shipping php-cgi.exe
The last two are easy to forget. Huntress and the Dutch NCSC both warn that many vendor products and devices embed PHP. Check your vendors' advisories as well as your own servers.

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.

Figure 6
How many servers? Depends who's counting.
Internet-facing hosts, millions
Silas CutlerPotentially vulnerable hosts
1.3m
Shodan, via Henk PoleyHosts showing PHP
1.9m
VirusTotalPHP hosts exposed online
5.1m
Sources: Tenable (Cutler and Poley figures) and BleepingComputer (VirusTotal). The higher counts include every host running PHP, patched or not, so treat them as a ceiling.

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.

“One of the biggest vulns in years.”Kevin Beaumont, security researcher, via Help Net Security

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.

Check
Is my PHP version patched?
Runs in your browser. Nothing is sent anywhere.
Try:
Enter a version to see where it stands.
Linux distributions and some hosts backport fixes without changing the version number. Debian, Ubuntu, Red Hat and CloudLinux all do this, so a patched server can still report an older number. If yours shows as vulnerable, check your vendor's advisory for the fixed package version before you panic.

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.

  1. 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.
  2. Don't rely on WordPress, plugin or theme updates. They're still worth installing, but none of them can fix a bug in PHP.
  3. 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.
  4. 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.
  5. Leave server settings to your host. The stopgap settings further down are for whoever administers the server, not for .htaccess or plugin settings.
Stopgaps for server admins, while you schedule the update. These come from PHP's advisory. They reduce exposure on some attack paths, but they do not make a server safe.
  • Set session.upload_progress.enabled=0 in php.ini or the FPM pool config, not with ini_set() or .user.ini. On PHP 8.5, also set fatal_error_backtraces=0.
  • Set memory_limit=-1 somewhere apps can't override, such as php_admin_value, and keep post_max_size low. 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 as curl and wget.
  • Reconnaissance commands like whoami, id or uname -a run 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

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.