On October 21, 2026, the PHP project shipped an emergency security release that every website owner running PHP needs to pay attention to. The flaws it fixes, nicknamed PHP2Shell, live inside the PHP engine itself — not in a plugin, theme or CMS. That means a perfectly coded WordPress site can still be taken over if the server underneath it runs a vulnerable PHP version.
In this guide I break down what PHP2Shell is, how the bugs work at a high level, who is affected, and the exact steps WordPress site owners should take today.
Quick Summary (TL;DR)
- What: Two critical memory-corruption flaws in core PHP (CVSS 4.0 score 9.2) that can allow unauthenticated remote code execution (RCE) under certain conditions. Per the official PHP security release, CVE-2026-109618 involves out-of-memory handling interrupting PHP while internal request data is only partially initialised, and CVE-2026-109619 involves request-owned internal state surviving after its memory has been freed (stale request state).
- CVEs: CVE-2026-109618 and CVE-2026-109619, with severity up to CVSS 9.2 (Critical).
- Affected: Practically every PHP release of the last decade, going back as far as PHP 5.4.
- Fixed in: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35.
- Who found it: Wiz Research, with independent reports from Calif and OpenAI, using frontier AI models to build working exploits.
- What to do: Upgrade PHP immediately. A firewall rule helps in the meantime, but only the patch fully fixes it.
What Is PHP2Shell?
PHP2Shell is the name the Wiz Research team gave to a family of vulnerabilities in the PHP interpreter. PHP powers a huge share of the web — WordPress, Drupal, Joomla, MediaWiki (the software behind Wikipedia) and countless custom applications. Wiz estimates the issue touches around 70% of websites.
What makes this case unusual is that the bug is below your application. Researchers showed that even a minimal “Hello World” PHP script on an affected version could be vulnerable. Keeping WordPress core, plugins and themes updated is still essential, but it does not protect you from this one — only updating PHP does.
The Root Cause: Fatal Errors That Leave a Mess Behind
All of the PHP2Shell bugs share one pattern. When a request hits a fatal error at exactly the wrong moment — most often running out of memory (hitting memory_limit) — PHP tears down that request’s memory but forgets to clear some internal pointers that still refer to it.
PHP worker processes are reused across many requests. So the next request served by the same worker can pick up that stale pointer and treat freed memory as if it were still valid. An attacker who can shape what ends up in that freed memory can turn this into:
- Memory disclosure — reading chunks of server memory that may contain passwords, session tokens, API keys or certificates from other visitors’ requests (similar in spirit to Heartbleed).
- Memory corruption — overwriting internal structures to run arbitrary code on the server, without logging in.
The Four Bugs at a Glance
Wiz reported four concrete exploitable bugs, grouped by the PHP team under two CVEs:
| CVE | Bug | Where it happens | Impact shown |
|---|---|---|---|
| CVE-2026-109618 | Upload-progress unserializer use-after-free | Session upload-progress handling during multipart (file upload) parsing | Pre-auth RCE on WordPress, Drupal and Joomla |
| CVE-2026-109618 | Remote process-memory disclosure | Stale session ID pointer leaked back in the PHPSESSID cookie | Leak of live worker memory, on any PHP app |
| CVE-2026-109619 | Fatal-error backtrace use-after-free | PHP’s stored backtrace of the last fatal error | Pre-auth RCE on Drupal |
| CVE-2026-109619 | OPcache type confusion | OPcache shared memory between workers | Pre-auth RCE on WordPress |
1. Upload-progress unserializer use-after-free
When PHP receives a file upload, its session module can track upload progress very early — before the request is fully initialised. If an out-of-memory error strikes during this step, the unserializer’s internal bookkeeping is left pointing at freed memory. A later request on the same worker then uses that memory as if it were valid, giving an attacker a strong corruption primitive.
2. Remote process-memory disclosure
The same early upload path can store a session ID and then lose it to an out-of-memory abort. On the next multipart request, PHP reads that dangling pointer and encodes whatever now lives there into the PHPSESSID response cookie. The scary part: this works even if your application never starts a session, so it is effectively application-independent.
3. Fatal-error backtrace use-after-free
PHP keeps a copy of the backtrace from the most recent fatal error. A memory-limit crash can free the request’s memory without clearing that saved backtrace, so the worker carries a dangling reference into the next request. If that next request triggers an early warning or notice, PHP touches the stale data — and attacker-controlled memory — leading to code execution.
4. OPcache type confusion
OPcache stores compiled scripts in memory shared by all workers and hands out slots in a shared index. If memory runs out mid-way through caching a script, one worker believes certain slots are taken while the shared state believes they are free. Another worker can then reuse a slot for a different kind of object, and PHP ends up reading one data type as another. Because OPcache is enabled on almost every production WordPress host, this one is especially relevant.
Note: These four are the ones that were demonstrated. Researchers say more variants of the same pattern exist, and the PHP team’s fix addresses the underlying cause rather than just these four paths.
Why WordPress Site Owners Should Care
Wiz built a single exploit chain and showed unauthenticated code execution against the official, up-to-date Docker images of WordPress, Drupal and Joomla. In practice that means an attacker could potentially:
- Install a backdoor or web shell on your server
- Steal your
wp-config.phpdatabase credentials and salts - Grab logged-in session cookies, API keys (payment gateways, SMTP, Google, etc.) from memory
- Deface the site, inject spam or malware, or pivot to other sites on the same server
The PHP Foundation notes that on Apache with mod_php the attack can fire before any application code runs, with default settings. On PHP-FPM, code execution was also confirmed through application-level paths. Either way, assume you are exposed until you have patched.
The AI Angle: Why This Is a Turning Point
Parts of this problem were not new. The PHP Foundation says signs of the out-of-memory issue first surfaced during an external audit in 2024, but nobody had found a practical path to exploitation, and choosing a fix that didn’t break compatibility or performance proved hard.
What changed in 2026 was AI. Turning these bugs into reliable exploits means chaining several flaws and adapting to each server’s memory layout through lots of trial and error. Wiz says frontier models (Wiz Atlas, Gemini 4 Argon and GPT-5.6 Sol) cut that work from what would have been months for an expert team down to about a week for one researcher. Calif and OpenAI independently reached the same root cause around the same time.
The lesson for site owners: “too complex to exploit” is no longer a safe assumption. Expect the gap between a patch release and real-world attacks to keep shrinking.
Disclosure Timeline
| Date (2026) | Event |
|---|---|
| July 30 | Calif begins an audit of PHP under OpenAI’s Patch the Planet program |
| August 11 | Calif and OpenAI independently report the out-of-memory RCE root cause |
| August 19–21 | Wiz finds its first bug and confirms pre-auth RCE on Drupal, then WordPress |
| August 24 | Wiz reports its findings to the PHP security team |
| October 20 | CVE IDs leak online; PHP brings its pre-announcement and release forward by a day |
| October 21 | Patched PHP versions released and details made public |
The PHP Foundation also reported that a proof-of-concept video was accidentally published early and that one distributor shipped patched images hours before the embargo lifted. Public proof-of-concept code is therefore likely to mature quickly — another reason not to wait.
How to Check If Your Site Is Vulnerable
Start by finding your exact PHP version. Any of these work:
- WordPress dashboard: go to Tools → Site Health → Info → Server and look at “PHP version”.
- Hosting panel: cPanel, hPanel, Plesk and similar panels show it under “PHP Version” or “Select PHP Version”.
- SSH: run
php -v(and check the PHP-FPM version too, as CLI and web can differ).
Then compare it with this table:
| PHP branch | Vulnerable | Safe (patched) |
|---|---|---|
| 8.5 | 8.5.11 and earlier | 8.5.12 or later |
| 8.4 | 8.4.26 and earlier | 8.4.27 or later |
| 8.3 | 8.3.35 and earlier | 8.3.36 or later |
| 8.2 | 8.2.34 and earlier | 8.2.35 or later |
| 8.1 and older (incl. 7.x, 5.x) | Vulnerable | No official upstream fix — upgrade to a supported branch or use a vendor LTS build |
On Linux distributions (Ubuntu, Debian, RHEL, AlmaLinux, etc.) the version number may not change because vendors backport fixes. In that case, check your distribution’s security advisory for CVE-2026-109618 and CVE-2026-109619 and confirm your package includes the fix.
How to Fix PHP2Shell: Step-by-Step
Step 1: Update PHP (the only complete fix)
- Shared / managed hosting: most hosts are rolling out the patch automatically. Contact support and ask them to confirm your account is on a patched PHP build.
- VPS / dedicated server: update packages with your package manager (for example
apt update && apt upgradeordnf upgrade), then restart PHP-FPM and/or Apache so the new binary is actually loaded. - Docker: pull the latest official PHP or WordPress image and redeploy your containers.
- Running PHP 8.1 or older: treat this as the push to move to PHP 8.3 or 8.4. Test on a staging copy first.
Step 2: Add a WAF layer while you patch
Cloudflare, Fastly, Akamai, AWS, Google Cloud, Imperva, Vercel and others worked with the researchers ahead of disclosure to ship mitigations. If your site sits behind one of these, make sure their managed rules are enabled. This buys time, but it is not a replacement for updating PHP.
Step 3: Look for signs of attack
Because the exploit runs below WordPress, your security plugin’s logs may show very little. Check your web server and PHP logs for:
- Odd multipart (file upload) requests followed by “Allowed memory size exhausted” errors
- Bursts of HTTP 500 errors from unknown IPs
- Unusually large or garbled
PHPSESSIDcookies in responses - PHP workers crashing or restarting more often than normal
- New, unexpected PHP files in
wp-content/uploads, or new admin users you didn’t create
Step 4: If you suspect a compromise, rotate secrets
Since memory disclosure can leak credentials without leaving obvious traces, high-value sites should consider rotating secrets after patching: database password, WordPress salts in wp-config.php (which logs everyone out), admin passwords, and API keys for payment, email/SMTP and other services.
Quick Security Checklist
- ☐ Confirmed my PHP version in Site Health or hosting panel
- ☐ Upgraded to 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 (or a vendor-patched build)
- ☐ Restarted PHP-FPM / Apache after updating
- ☐ Enabled WAF managed rules if available
- ☐ Reviewed logs for memory errors and 500 spikes
- ☐ Rotated credentials if anything looked suspicious
Frequently Asked Questions
Is PHP2Shell a WordPress vulnerability?
No. It is a vulnerability in PHP itself. WordPress was used as a demonstration target, but any PHP application on an affected version is at risk. Updating WordPress, plugins or themes alone will not fix it.
Will a security plugin like Wordfence protect me?
Not reliably. Plugin-level firewalls run inside PHP, and some of these attacks trigger before any WordPress code loads. A network-level WAF (Cloudflare, etc.) is a better short-term shield, but updating PHP is what actually closes the hole.
How serious is it?
Very. The PHP project rates it CVSS 9.2 (Critical), it can be triggered without logging in, and it affects a large share of the internet. The researchers compare its potential reach to Heartbleed and Log4Shell.
I’m on PHP 7.4. What should I do?
PHP 7.4 has been end-of-life for years and has no official fix. Plan an upgrade to PHP 8.3 or 8.4 as soon as possible, test your theme and plugins on staging, and ask your host whether they offer a patched extended-support build in the meantime.
Conclusion
PHP2Shell is one of the most serious PHP security issues in years: a decade-old design weakness in the engine, turned into working pre-authentication exploits with the help of AI. The good news is that the fix is straightforward — update PHP to a patched release and restart your services. If you manage WordPress sites for yourself or clients, make this the top item on today’s to-do list.
Need help checking or updating PHP on your WordPress site? Get in touch and I’ll help you get patched safely.

Leave a Reply