PHP2Shell: the flaw no plugin update can fix
On 21 October 2026 the PHP project shipped emergency patches for two critical flaws in PHP itself. They are not WordPress bugs or plugin bugs, which is exactly why they are worth understanding. Here is what happened, what it does and does not prove about CMS-based sites, and what to do this week.
What happened
PHP2Shell is the name given to two vulnerabilities in the PHP language runtime, tracked as CVE-2026-109618 and CVE-2026-109619. PHP announced a critical security release on 20 October 2026 and shipped the fixes on 21 October. Both flaws are rated 9.2 out of 10 on the CVSS 4.0 scale. The worst case is remote code execution: someone on the internet, with no login, sends a crafted web request and ends up running their own code on your server.
The fixed versions are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. The vulnerable code goes back a long way: PHP says the flaws affect PHP 5.4 and later. Branches the PHP project no longer supports, which means 8.1 and everything older, get no upstream fix.
Both bugs share one root weakness, in how PHP behaves when a request goes badly wrong. When PHP runs out of memory, or hits another fatal condition, partway through a request, it is supposed to stop and tidy up after itself. In these cases it leaves its internal state in a condition that a carefully built request can abuse. That makes it a memory-safety problem in the engine, not a mistake in anyone's website code. We are deliberately not describing the mechanics any further; the detail is in the vendor advisories listed at the end, for the people who need it to defend systems.
Who found it: researchers at the security firm Calif, using AI tooling from OpenAI, reported the flaws, and the cloud security company Wiz found them independently.
First, a correction: this is not a plugin flaw
It is tempting to read PHP2Shell as proof that plugins are the weak point. The facts do not say that. The flaws live in the PHP engine, underneath WordPress, Drupal, Joomla, Magento and every other PHP application. Researchers demonstrated unauthenticated code execution against current versions of WordPress, Drupal, Joomla and Magento 2.4.9, but that is because they all run on PHP, not because any of them contains the bug.
Three things follow. Updating WordPress core or your plugins does not close it; reporting says WordPress.org confirmed that no WordPress release is needed. A hand-written PHP site, or one built on a framework such as Laravel, is exposed in exactly the same way. And the application's own code can be perfectly clean while the site is still vulnerable. On Apache with mod_php, which PHP rates as the highest-risk setup, researchers showed code running before the application had even started.
Which server setups are affected: PHP's advisory covers PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. One analysis says no complete attack against PHP-FPM has been shown for one of the two flaws. Do not read that as safe. Patch regardless.
What it does say about CMS and plugin-based sites
What PHP2Shell does not prove
Here is the other half, because it would be easy to overclaim. Custom code is not automatically safe. A bespoke PHP site is exposed to PHP2Shell exactly as much as a WordPress one. And the stack we build on has had its own moment: in December 2025 a maximum-severity remote code execution flaw in React Server Components, known as React2Shell (CVE-2025-55182), affected React and Next.js and was being exploited in the wild within days.
What owning the stack changes is not whether flaws exist. It is who can act when one lands. When a flaw is in your own repository's dependencies, your team can upgrade, test and ship the same day, and you can see exactly what the site depends on. When it is in a layer owned by a host, a theme author and a dozen plugin vendors, you wait on all of them. That is the real argument for fewer layers, and it is a smaller claim than “plugins are insecure”.
For the record, PHP2Shell does not apply to the sites we build. Our own site runs on Next.js, not PHP, and the custom builds described on our custom code vs WordPress page are React and Next.js. That is not a claim of immunity. It only says this particular flaw is not one we have to deal with, and that we hold the patches that are ours to the same standard of urgency.
What is still disputed
This story is days old, and early reporting disagrees on several points. As of 24 October 2026:
Exploitation. watchTowr says it saw both flaws exploited through its honeypots from 21 October, and Hadrian reports exploitation at scale. Amazon's honeypots logged an attempt dated 17 October, four days before the patches. Cloudflare saw attack traffic against its customers but reported no compromises. CISA had not observed exploitation when it issued its alert and, as of 23 October, had not added either CVE to its Known Exploited Vulnerabilities catalogue. Huntress had not seen exploitation on its partners' systems.
How reliable the public exploits are. Sansec says the public exploits do not work against a default PHP installation, while others warn that a working attack path has been demonstrated, mostly against mod_php. “Does not work on defaults” is not a reason to wait.
Whether the patches are complete. One vendor, Abstract Security, claims it reproduced code execution on a fully patched 8.2.35 host through a path the fixes do not address. We found no other source that corroborates this, so treat it as unconfirmed and watch PHP's advisory for follow-up releases.
How many sites are exposed. Estimates depend on how exposure is counted. Wiz's headline figure is roughly 70% of the internet; Palo Alto Networks counted about 22.6 million exposed instances. We will update this page as the picture settles.
What to do this week
- Find out what you run. Ask your host, or check your hosting dashboard, for the PHP version and how PHP is served (mod_php, PHP-FPM and so on). If you manage your own server,
php -von the command line shows the version. - Upgrade to a fixed release. That means PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your operating system vendor's patched package for the same fix. Several Linux distributions, AlmaLinux among them, published patched packages the same week. On PHP 8.1 or older there is no upstream fix: plan the move to a supported version, and ask your host or a back-porting vendor what they offer in the meantime.
- Restart the PHP processes. Upgrading the package on disk does not change code that running workers have already loaded, so restart PHP-FPM, Apache or whatever serves PHP. On managed hosting, ask them to confirm they did it.
- Add filtering as a stopgap, not a substitute. If your site sits behind Cloudflare or a similar service, check that the PHP2Shell rules are switched on. They block known attack patterns; they do not remove the flaw.
- Check for signs, and rotate secrets if you cannot rule it out. There is no agreed list of indicators yet, so this is judgement rather than a checklist: look for unexpected new files, unfamiliar admin users, changed core or config files, and bursts of out-of-memory or fatal errors in your logs from before the patches. Researchers have also shown memory disclosure that can expose passwords, tokens and API keys, so if you suspect your site was probed, change database passwords, API keys and your CMS secret keys.
Three questions for your host or agency
Common questions
Sources and further reading
Compiled on 24 October 2026 from vendor and press write-ups published between 20 and 24 October. PHP's own advisory is the authority on affected and fixed versions.
- PHP security advisory, 21 October 2026 (php.net)
- PHP2Shell: Find, Mitigate, and Patch Now (Qualys)
- PHP2Shell: Critical PHP vulnerabilities patched, update now! (Help Net Security)
- PHP2Shell: PHP RCE (Sansec)
- PHP2Shell: AI uncovers critical RCE vulnerabilities (Wiz)
- PHP2Shell: All You Need to Know (JFrog Security Research)
- Cloudflare deploys protections against PHP2Shell (Cloudflare)
- PHP2Shell RCE Exploited (watchTowr)
- PHP2Shell Exploitation Started Days Before Patches (SecurityWeek)
- PHP2Shell: Critical PHP RCE Vulnerabilities (Abstract Security)
- React2Shell (CVE-2025-55182) (Rapid7)
Not sure what is running under your site?
Send us your site's address and we will tell you what we can see it is built on, and walk through who is responsible for patching each layer. No pitch, no obligation.