WordPress PHP Vulnerability (PHP2Shell): 7 Things to Know and How to Fix It

WordPress PHP vulnerability PHP2Shell: CVE-2026-109618 and CVE-2026-109619, patch PHP to 8.2.35, 8.3.36, 8.4.27 or 8.5.12

The WordPress PHP vulnerability making headlines this week is not a WordPress bug at all. It is a pair of critical flaws in PHP itself, nicknamed PHP2Shell and tracked as CVE-2026-109618 and CVE-2026-109619. They let an unauthenticated attacker run code on any server running a vulnerable PHP version, WordPress included. The fix is a PHP update, not a WordPress update, and you should apply it today.

What the WordPress PHP Vulnerability Actually Is

PHP2Shell is a family of memory-safety bugs in the core PHP engine, patched on October 21, 2026. PHP’s security team grouped them under two CVEs, both rated CVSS v4 9.2 (Critical). A leaked score of 10.0 that circulated before disclosure was wrong.

The root cause is the same in every variant. When a PHP request crashes at the wrong moment, usually by hitting its memory limit, PHP can leave behind pointers to memory from that dead request. The next request handled by the same worker then reuses that stale state. That turns into a use-after-free, which skilled attackers can shape into memory corruption and code execution.

CVE-2026-109618CVE-2026-109619
Bug classMemory corruption during out-of-memory handlingUse-after-free from stale global state between requests
CVSS v49.2 Critical9.2 Critical
Login neededNoNo
Demonstrated impactRCE on Apache mod_php with default settings, before any app code runsRCE on mod_php; session-path RCE on mod_php and PHP-FPM

Wiz Research, one of the reporting teams, chained the bugs into a working exploit against the stock wordpress:latest, Drupal and Joomla Docker images. They also showed a separate bug that leaks raw worker memory into the PHPSESSID cookie. That memory can hold passwords, tokens and API keys from other visitors’ requests.

Which PHP Versions Are Affected

Every supported PHP branch is affected until you upgrade to the patched release below. According to Wiz, every version back to PHP 5.4 carries at least one of the bugs.

Patched PHP versions for the WordPress PHP vulnerability: 8.2.35, 8.3.36, 8.4.27, 8.5.12
Your PHP branchPatched versionStatus
8.58.5.12Supported, update now
8.48.4.27Supported, update now
8.38.3.36Security-only, update now
8.28.2.35Security-only, update now
8.1, 8.0, 7.4Minimal source backports onlyEnd-of-life, plan an upgrade
7.3 and olderNoneEnd-of-life, vulnerable

Linux distributions and long-term-support vendors received patches in advance, so your OS package may carry the fix under its own version number. Check your vendor’s advisory, not just the PHP number.

7 Things to Know About PHP2Shell

  1. No login is needed. Both flaws are pre-authentication; an attacker only needs to send HTTP requests to your site.
  2. Your plugins don’t matter. The bug sits below the application layer. Wiz showed even a plain “Hello World” PHP page on a vulnerable version can be exploited.
  3. Apache mod_php is the highest-risk setup. There, the out-of-memory bug can fire before any WordPress code runs. PHP-FPM, php-cgi, FrankenPHP and LiteSpeed are also affected, but exploitation paths are narrower.
  4. RCE is not the only risk. One bug leaks chunks of server memory into a session cookie, Heartbleed-style. That can expose secrets without ever running code.
  5. Public exploits exist, but they’re fragile. Rapid7 found each public PoC works only for one OS, PHP version and web server combination. They have seen exploitation attempts but, as of October 22, no confirmed in-the-wild compromise.
  6. Governments are treating it as an emergency. CISA and the UK NCSC urge immediate patching. The NCSC advises taking systems offline if you can’t patch.
  7. AI changed the exploit economics. The vulnerable code sat in PHP for over a decade. Wiz says frontier AI models helped them turn it into working exploits across multiple apps in hours, work that once needed a specialist team for months.

That last point is the one to sit with. The bugs were never hidden; turning them into a reliable exploit was simply too hard. When that effort drops, “too complex to exploit” stops being a defence.

Why Updating WordPress Won’t Fix It

Updating WordPress, your theme or your plugins does nothing for this vulnerability. WordPress.org’s own notice says no WordPress update is required or planned, because the flaw affects any server hosting a PHP application.

Think of it this way: WordPress is the app, PHP is the engine that runs it. A flaw in the engine reaches every app running on it, however well that app is written. That is also why security plugins and WordPress-level firewalls can’t fully stop it; the attack lands before they load. Be wary of any “PHP2Shell fix” plugin or code snippet. The only real fix happens at the server level.

How to Check and Patch PHP on Your WordPress Site

Check your PHP version first, then update to the patched release for your branch.

  1. Check your version. In WordPress, go to Tools → Site Health → Info → Server and read the PHP version. Your hosting panel (cPanel, Plesk, hPanel) usually shows it too.
  2. Compare it to the table above. Anything below 8.2.35, 8.3.36, 8.4.27 or 8.5.12 on your branch is vulnerable.
  3. On shared or managed hosting, ask your host. Many hosts are patching their servers and adding WAF rules. Open a ticket and ask which patched PHP build you’re on; don’t assume.
  4. On your own VPS or server, update the package. Use your distribution’s patched PHP package or build from source. Then restart PHP-FPM or Apache so every worker loads the new binary.
  5. On PHP 8.1 or older, plan a real upgrade. These branches get no routine security fixes. Test your site on PHP 8.3 or 8.4 in staging, then switch.
  6. Check every PHP install, not just production. Staging sites, old subdomains, Docker images and bundled appliances all run PHP too.
  7. Rotate secrets if you were exposed. Because one bug leaks memory, change database passwords, API keys and salts in wp-config.php if you see any warning signs below.

If You Can’t Patch Yet: Temporary Mitigations

These settings reduce exposure while you schedule the update. They don’t fix the bug, and patching remains the only complete remediation.

SettingWhere to set itWhat it blocks
memory_limit=-1php_admin_value in the FPM pool or Apache config, not in app codeThe out-of-memory trigger
session.upload_progress.enabled=0php.ini or FPM pool config (ini_set() and .user.ini act too late)The session upload-progress path
fatal_error_backtraces=0php.ini, PHP 8.5 onlyThe fatal-error backtrace path
post_max_size of 8M (32M if you need uploads)php.ini plus request-size limits at the web server or proxyOversized multipart requests

Restart all PHP workers after any change, or old workers keep the old settings. Cloudflare and other CDN WAF rules help only if your origin server accepts traffic from the CDN alone. If your site is high-risk and none of this is possible, follow the NCSC’s advice and take it offline until it’s patched.

Signs Your Site Is Being Targeted

This attack runs below WordPress, so your normal security logs may show very little. Watch your web server and PHP logs for:

  • Multipart (upload-style) requests followed by “Allowed memory size exhausted” errors
  • Bursts of HTTP 500 errors with no matching change on your side
  • Unusually large or garbled PHPSESSID cookies in responses
  • PHP workers crashing or restarting without explanation

None of these proves a compromise, and their absence doesn’t prove you’re safe. If you see them, patch first, treat the server as potentially compromised, and rotate every credential it holds.

What This Means If You’re Learning Security

PHP2Shell is a textbook case of why fundamentals still matter. The concepts behind it, use-after-free, memory corruption and request lifecycles, are the same ones taught in any serious exploitation course. The difference now is that AI can do much of the slow trial-and-error that once made such bugs impractical to weaponise.

That cuts both ways. Attackers can scale exploits faster, but defenders who understand how a web server, PHP worker and session handler fit together can triage this kind of alert in minutes. They can tell a real exploitation signal from noise, and know which mitigation actually blocks which path. Tool familiarity alone doesn’t get you there. The OWASP guidance and MITRE ATT&CK technique for exploiting public-facing applications (T1190) describe exactly this class of attack.

This is the foundation Offenso’s Offenso Certified Security Analyst course builds in a real lab: web application, network and wireless penetration testing, practised hands-on. If you’re mapping out where to start, our guide on how to become an ethical hacker covers the full path. For how AI is changing offensive tooling more broadly, read our breakdown of PentestGPT.

WordPress PHP Vulnerability FAQ

What is the WordPress PHP vulnerability? It is PHP2Shell, two critical flaws in the PHP engine (CVE-2026-109618 and CVE-2026-109619) patched on October 21, 2026. They let unauthenticated attackers run code on servers running vulnerable PHP, which includes most WordPress sites.

Is WordPress itself vulnerable? No. The bug is in PHP, not WordPress core, themes or plugins. WordPress sites are exposed only because they run on PHP, and no WordPress update is planned or needed.

Is PHP 7.4 vulnerable? Yes. PHP 7.4 is end-of-life and affected. PHP released only minimal source backports for 7.4, 8.0 and 8.1, so the practical fix is upgrading to a supported branch such as 8.3 or 8.4.

What is CVE-2026-109618? It is the out-of-memory flaw in PHP2Shell, rated CVSS v4 9.2. A request that runs out of memory at the wrong moment leaves corrupted state behind, which can lead to remote code execution, especially on Apache mod_php.

How do I patch the PHP vulnerability on WordPress? Update PHP to 8.2.35, 8.3.36, 8.4.27 or 8.5.12 or later, then restart PHP workers. On shared hosting, ask your host to confirm they’ve applied the patched build.

Is PHP2Shell being exploited? Public proof-of-concept exploits exist and attackers are actively probing. As of October 22, Rapid7 had not confirmed in-the-wild compromises, but treat it as urgent; a more reliable exploit could appear anytime.