Skip to content
All articles
PHPsecurityvulnerabilities

PHP2Shell: Two Critical PHP Flaws

Two flaws in PHP itself let attackers run code on a server without logging in. Fixed 21 Oct 2026 — here is what it means for your site and what to do.

27 Oct 2026 · 6 min read · Hazentic Quantum

PHP2Shell is the name for two critical flaws in the PHP programming language itself, disclosed and fixed on 21 October 2026. Either flaw can let an attacker run code on a web server without logging in, before your application code even runs. Both are rated CVSS 9.2. If your site runs PHP, act on this first: update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, restart every PHP worker, and then check whether anyone got in before you patched.

What actually broke

The two flaws are CVE-2026-109618 and CVE-2026-109619, both memory-safety bugs in the PHP engine — not in WordPress, Laravel, Drupal or any plugin.

CVE-2026-109618 is about out-of-memory handling. When a request pushes PHP past its memory limit, PHP aborts the request while its internal request data is only partly set up, and cleanup then treats that half-built data as valid. A crafted multipart upload can trigger this and lead to remote code execution.

CVE-2026-109619 is about stale global state. When a request ends with a fatal error, PHP does not clear some global state that points into the freed request memory, and a later request on the same worker can then use that freed memory. Session upload progress, enabled by default, is one of the paths that can feed this.

PHP rates the risk highest for Apache with mod_php, where it describes a demonstrated exploit that fires before any application code runs. PHP-FPM, php-cgi, FrankenPHP and LiteSpeed are also at risk. The blunt meaning: a fully updated application behind a login page does not save you, because the vulnerable code runs while PHP is reading the request.

Why this one is different

First, the scale. The vulnerable code paths go back to PHP 5.4, released in 2012, so every PHP version from 5.4 onward is affected by at least one flaw.

Second, how it was found. Calif researchers auditing PHP under OpenAI's Patch the Planet programme used GPT-5.6 Sol, and Wiz Research independently found the same flaws using Gemini 4 Argon, GPT-5.6 Sol and its own Wiz Atlas tool. Wiz says AI help made building and adapting exploits across applications practical in hours. The bugs hid for over a decade — and the same tools that found them are now available to attackers.

Third, the timeline was messy. Details leaked on 20 October, a day before the planned disclosure, and exploitation attempts were seen even earlier, with one account putting the first attempt on 17 October — so check logs from 17 October onward, not just from the patch date. Node.js had its own critical flaw the same week — see Node2Shell: the Brotli flaw in Node.js.

Are you affected?

If you run any PHP that serves web requests and have not updated to a fixed release, assume yes. The check itself is quick:

  • On a server you control, run php -v and compare against the fixed versions for your branch.
  • On shared hosting, ask your host which PHP version your site runs and whether it is a patched build. Some hosts ship patched packages without changing the version number, so ask the host directly.
  • On WordPress, check Tools, then Site Health, then Info, then Server. But that only covers the site you know about.

The sites people miss are the ones nobody thinks of as PHP: an old marketing site nobody touches, a staging copy, a vendor portal, a firewall login page, a storage box on the office network. The first question is not "which version are we on" but "where does PHP run at all".

PHP 8.1 and older get no official fix, though source backports exist for 7.4, 8.0 and 8.1 and some distributions and support vendors ship patched packages. If you are on an end-of-life branch, patching is a stopgap: 8.4 or 8.5 buys years of security fixes, while 8.2 stops receiving them on 31 December 2026.

What to do

Patching is the fix. Everything else is a delaying tactic.

1. Update to the fixed release for your branch, or a patched distribution package. 2. Restart every PHP worker after updating. A new binary does nothing for workers still running the old one. 3. Rebuild containers rather than patching a running one, so the fix survives the next deploy. 4. Check logs for signs of compromise going back to at least 17 October: unexpected processes, new or changed files, unexplained outbound connections, new admin accounts. 5. If you cannot update today, apply PHP's partial mitigations together — memory_limit set to -1 where applications cannot override it, a low post_max_size, session.upload_progress.enabled set to 0, and fatal_error_backtraces set to 0 on PHP 8.5 — and restart every worker. PHP is clear these block known paths only.

Config workarounds alone do not fix this: the flaws sit in how PHP handles requests at the engine level, beyond the reach of firewall rules, plugins, or application code.

What to do this week

  • List every place PHP runs for your business, including forgotten sites, staging copies and vendor-managed boxes.
  • Confirm each one is on a fixed release or a patched distribution package, in writing from the host where you do not control the server.
  • Restart all PHP workers and rebuild containers after patching.
  • Review logs from 17 October onward for signs of compromise.
  • Put a date on moving any end-of-life PHP branch to 8.4 or 8.5.

If you would rather hand the whole check to someone, our custom web apps work includes security reviews — see our work — or reach us through contact us. For the wider picture on keeping a PHP site safe, see our earlier article on PHP security issues to watch.

FAQ

Is my WordPress site affected by PHP2Shell?

If it runs on an unpatched PHP version, yes. The flaw is in PHP, not WordPress, and researchers demonstrated remote code execution against a stock WordPress image.

Does a firewall or security plugin fix it?

No. A firewall rule may block known attack patterns, but the vulnerable code runs while PHP reads the request, before your application or its plugins get involved. Only the patched PHP release fixes it.

What if I cannot update today?

Apply PHP's partial mitigations together, restart every worker, and treat the server as exposed until you update. Put the update on the calendar for this week and check the logs in the meantime.

How do I know if someone got in before I patched?

Look for new or changed files, unexpected processes, strange outbound connections, and new accounts. If you find any of them, assume compromise and get help with incident response rather than just patching over it.

Next step

Let’s find your bottleneck.

Tell us what is slowing the business down. We reply within one business day — with an honest answer, even if we are not the right fit.

Free website teardown · contact@hazenticquantum.com