PHP2Shell: The PHP Flaws Under Attack and What to Do Now

Two critical bugs in PHP itself, and exploitation started before the patch

Featured image

Most critical web bugs live in a plugin, a CMS or one vendor’s appliance. PHP2Shell is different: the flaws are in PHP itself, the language runtime behind WordPress, WooCommerce, Magento, Drupal, Joomla, Laravel apps and countless custom portals. Before a single line of your application code runs, one unauthenticated HTTP request may be enough to reach the vulnerable code.

PHP shipped emergency fixes on 21 October 2026. Attackers got there first. Amazon’s honeypots logged an exploitation attempt on 17 October, four days before the patch, and scanning has been broad ever since.

TL;DR / Key takeaways

  • CVE-2026-109618 and CVE-2026-109619 (“PHP2Shell”) are memory-safety flaws in PHP core, each rated CVSS 9.2, that can lead to unauthenticated remote code execution as the web server user.
  • Every PHP install that serves web requests is in scope: PHP-FPM, Apache mod_php (highest risk), php-cgi, FrankenPHP and LiteSpeed.
  • Fixed versions: PHP 8.5.12, 8.4.27, 8.3.36, 8.2.35. PHP 7.4/8.0/8.1 get source backports only, and PHP 7.3 and older have no fix at all.
  • Exploitation attempts began before disclosure. Reports on whether any attacks have succeeded still conflict, so assume it is only a matter of time.
  • Patch and restart every worker. Config tweaks and WAF rules only reduce exposure. They don’t fix the bugs.

What happened

On 21 October 2026, Wiz Research disclosed PHP2Shell together with the PHP security team, Calif and OpenAI, and patched PHP releases came out the same day (Wiz, BleepingComputer). Wiz described the findings as ranking “among the most severe vulnerabilities discovered in PHP, and arguably in software history” (Help Net Security). Kevin Beaumont called it “one of the biggest vulns in years” and predicted a “mass of incidents”.

AI played a big part on the research side. Wiz says frontier models (Gemini 4 Argon and GPT-5.6 Sol, alongside its own tooling) helped with discovery, exploit development and patch validation. In its view, AI substantially lowered the expertise needed to turn a very complex bug chain into a working exploit (Wiz). Defenders should take that seriously, because the same lowered barrier applies to attackers.

Timeline

Date (2026) Event
19 Aug Wiz finds the first bug. Unauthenticated RCE confirmed against Drupal (20 Aug) and WordPress (21 Aug).
24 Aug Reported to the PHP security team.
21 Sep PHP acknowledges and begins a coordinated fix. Linux distributions receive patches ahead of release.
17 Oct Amazon’s MadPot honeypot records the first exploitation attempt, four days before disclosure.
20 Oct PHP warns administrators that emergency patches for two critical flaws are coming.
21 Oct, ~02:00 UTC Proof-of-concept exploits appear while the embargo is still in place. Details had leaked, so PHP brings the release forward by a day.
21 Oct, ~14:00 UTC Embargo lifts. PHP 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35 released. Broad exploitation attempts follow within hours. CISA urges organisations to patch or consider taking systems offline.
22 Oct Palo Alto Networks says all PAN-OS and Panorama versions are affected, with fixes pending. Fortinet and Cisco are reviewing their products.
23 Oct PHP discloses a third, unpatched RCE (CVE-2026-115560) that affects only unusual configurations, and recommends session.upload_progress.enabled=0.

Sources: Wiz, AWS Security Blog, The Hacker News, Help Net Security, BleepingComputer.

How the flaws work (conceptually)

Both bugs come from the same root problem. When a PHP request ends abnormally, especially through an out-of-memory error, PHP can leave its internal memory in an inconsistent state (BleepingComputer).

The exploit chains aren’t trivial. They need precise request sizing and an ASLR bypass. Wiz showed a memory-disclosure primitive that works even if the app never calls session_start(), and it demonstrated RCE against stock latest container images of WordPress, Drupal and Joomla (Wiz). In other words, “it’s hard to exploit” isn’t a reason to wait.

Am I affected?

Almost certainly yes, if you run PHP on anything internet-facing. The affected and fixed versions are:

PHP branch Status What to do
8.5 Vulnerable before 8.5.12 Upgrade to 8.5.12
8.4 Vulnerable before 8.4.27 Upgrade to 8.4.27
8.3 Vulnerable before 8.3.36 Upgrade to 8.3.36
8.2 Vulnerable before 8.2.35 Upgrade to 8.2.35
7.4, 8.0, 8.1 All versions vulnerable, end-of-life Distro/LTS vendor package, PHP’s source backport, or migrate
7.3 and older (incl. 5.x) All versions vulnerable, no fix Migrate, or isolate from the internet

Sources: watchTowr FAQ, Datadog.

Keep these in mind:

The exposure problem

The installed base is huge and old. VulnCheck counted 2,608,039 internet-facing PHP hosts, with over 700,000 running PHP 3.x–7.3 and about 400,000 on 7.4–8.1 (The Hacker News). A separate Shodan-based count found that 59% of hosts that report a version run a branch with no official fix (CybelAngel). Researcher Hal Pomeranz warned of a “long tail” of embedded and unmaintained installs that will never be patched (Help Net Security).

Exploitation status: what we know (and don’t)

Detection: what to look for

None of these signals is conclusive on its own. Combine them, and remember that a successful exploit may return HTTP 200 without crashing anything (Datadog). Investigations should start from 17 October, not the disclosure date (AWS).

1. The strongest signal: web workers spawning shells. A www-data/apache/PHP-FPM process that launches sh, bash, curl or wget deserves immediate attention. Here’s a Sigma-style rule for Linux process telemetry (auditd, Sysmon for Linux, EDR):

title: Shell or downloader spawned by PHP / web server process
status: experimental
logsource:
  product: linux
  category: process_creation
detection:
  parent:
    ParentImage|endswith:
      ~|-| '/php~|-|fpm'
      ~|-| '/php~|-|fpm8.2'
      ~|-| '/php~|-|fpm8.3'
      ~|-| '/php~|-|fpm8.4'
      ~|-| '/php~|-|fpm8.5'
      ~|-| '/apache2'
      ~|-| '/httpd'
      ~|-| '/lsphp'
      ~|-| '/frankenphp'
  child:
    Image|endswith:
      ~|-| '/sh'
      ~|-| '/bash'
      ~|-| '/dash'
      ~|-| '/curl'
      ~|-| '/wget'
      ~|-| '/python3'
      ~|-| '/perl'
  condition: parent and child
falsepositives:
  ~|-| Applications that legitimately call system commands (baseline first)
level: high

2. PHP error logs: memory exhaustion during request start-up. Datadog points to fatal out-of-memory errors that report in Unknown on line 0, which means the memory ran out before any script line executed:

grep ~|-|E "Allowed memory size of [0~|-|9]+ bytes exhausted.*in Unknown on line 0" \
  /var/log/php*~|-|fpm.log /var/log/apache2/error.log /var/log/httpd/error_log 2>/dev/null

3. Worker crashes. Failed attempts often crash workers, for example AH00052: child pid ... exit signal Segmentation fault (11) in Apache logs, or unexplained PHP-FPM worker churn (Datadog, Wiz).

grep ~|-|E "Segmentation fault|exited on signal (11|6)" \
  /var/log/apache2/error.log /var/log/php*~|-|fpm.log 2>/dev/null | tail ~|-|50

4. Suspicious request shapes (WAF, reverse proxy or full-body logs):

A Splunk example for proxy or WAF logs (adjust field names to your sourcetype):

index~|=|web (method~|=|POST) earliest~|=|10/17/2026:00:00:00
| eval big_body~|=|if(bytes_in > 2000000, 1, 0)
| where big_body~|=|1 OR (like(cookie, "%PHPSESSID~|=|%") AND len(cookie) > 512)
| stats count values(status) as statuses dc(uri_path) as paths by src_ip, host
| sort ~|-| count

5. Published infrastructure. AWS published these IPs as observed sources. They belong to shared anonymisation services, so AWS recommends investigating activity from them rather than blocking them outright (AWS):

103.216.220.92    (17 Oct 2026)
31.223.184.166    (21 Oct 2026)
37.19.200.5       (21 Oct 2026)
134.209.159.64    (21 Oct 2026)
103.114.163.188   (21 Oct 2026)
95.217.98.37      (21 Oct 2026)

Also check for new or modified PHP files in web roots and upload directories since 17 October. Web shells are the usual follow-on from a PHP RCE.

Prioritised action checklist

Immediate (today)

  1. Inventory every PHP runtime that serves web traffic, internet-facing first. Include containers, control panels, appliances and anything a hosting provider manages for you.
  2. Patch to 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35, or apply your distribution’s fixed package.
  3. Restart or replace every PHP worker (PHP-FPM pools, Apache) and rebuild container images. A patched binary on disk doesn’t protect a process that’s still running the old code (Datadog).
  4. Anything you can’t patch today: restrict it from the internet. The UK NCSC advises considering taking it offline (Help Net Security).

Interim hardening (only while you patch, never instead of it)

These settings reduce exposure but don’t fully fix the bugs. Both PHP core developers and AWS say patching is the only complete remediation (BleepingComputer, AWS). Test them on staging first, because they can affect uploads and memory behaviour.

; php.ini / pool config ~|-| temporary PHP2Shell exposure reduction
session.upload_progress.enabled ~|=| 0   ; CVE~|-|2026~|-|109619 path, also the advice for CVE~|-|2026~|-|115560
fatal_error_backtraces ~|=| 0            ; PHP 8.5 only
post_max_size ~|=| 8M                    ; 32M if your app needs uploads
memory_limit ~|=| ~|-|1                     ; CVE~|-|2026~|-|109618: pair with container/cgroup memory limits

Put a limit on request size in front of PHP too, and make sure your WAF inspects large bodies without truncating them. Cloudflare, Fastly, Google, Vercel and AWS WAF have published rules or guidance, but Cloudflare itself stresses that these protections are temporary (BleepingComputer, Wiz).

This week

Longer term

OffensioX perspective

PHP2Shell matters for two reasons beyond its blast radius. First, it sits beneath the application layer: your WAF tuning, plugin hygiene and strong admin passwords don’t change the fact that the interpreter itself parses an attacker’s request. Second, it shows how fast AI is compressing the vulnerability lifecycle. Researchers used frontier models to turn a deeply complex memory bug into reliable RCE, details leaked before the embargo lifted, and attackers were probing honeypots four days before the patch. As AWS put it, “An embargo protects defenders only until someone else finds the same bug.” For businesses in Pakistan and across South Asia, where a large share of e-commerce stores, school and university portals and SME websites run on PHP, often on shared hosting or legacy 7.x stacks nobody remembers to upgrade, the long tail is the real risk. Don’t assume your host has patched. Verify it. If you’d like a second pair of eyes, OffensioX offers penetration testing and web application security assessments that can confirm your exposure and harden what sits in front of it.

References