← Blog
PHP2ShellPHP RCECVE-2026-109618Pre-Auth RCE

PHP2Shell: CVE-2026-109618 and CVE-2026-109619 — Critical PHP RCE, Patch Today

PHP2Shell (CVE-2026-109618, CVE-2026-109619): critical unauth PHP RCE, exploited in the wild. Full remediation — patch 8.2.35/8.3.36/8.4.27/8.5.12 per platform, EOL hosts, stopgaps.

Zero Hunt Research··17 min read

Published by Zero Hunt, an autonomous AI red team on an on-premise appliance running private AI: automated penetration testing for networks and infrastructure, black-box or gray-box, with a human approving every step that matters.

The PHP security team did something unusual on October 20: it pre-announced an emergency release before telling anyone what it fixes. Two vulnerabilities, both rated CVSS v4.0 9.2 (critical), fix scheduled for Wednesday, October 21, 2026 at 14:00 UTC. Within hours the embargo collapsed — a Hacker News post, screenshots of an exploit tool named "PHP2Shell," and a confirmation from watchTowr that the bugs are real and remotely exploitable. The release was pulled forward a full day. If you run PHP anywhere on an internet-facing path, the window between "patch exists" and "patch is applied everywhere" is where this story gets decided, and that window is measured in minutes.

Developing story — first published 12:29 CEST (10:29 UTC), October 21, 2026. Updated as the vendor and CISA publish more.

Update — October 24, 2026 10:30 CEST

A new PHP notice: CVE-2026-115560 is not fixed by the October 21 releases. On October 23 PHP published an informational advisory for an RCE path through session upload progress. It needs an unusual setup: session.serialize_handler set to php_binary or php_serialize in configuration, switched back to php with ini_set() before session_start(), with upload progress still on. PHP calls it unlikely and will fix it in the next regular release; until then it recommends session.upload_progress.enabled=0. If you already set it as a PHP2Shell stopgap, keep it. Our free php2shell-check.sh 0.2.0 now checks these conditions too. Details, per-platform commands and the check: CVE-2026-115560: the PHP RCE the PHP2Shell patch doesn't fix.

Update — October 22, 2026 22:30 CEST

One day on, the picture is clearer and more nuanced than release-day panic suggested — patch anyway. Three things changed:

  • Exploitation is real but not yet a universal drive-by. watchTowr says exploitation has been observed through its Attacker Eye honeypot network since October 21. Amazon Threat Intelligence saw an exploitation attempt in its MadPot sensors on October 17 — four days before disclosure — and now describes PHP2Shell as "broadly exploited in the wild," with October 21 payloads pointing to more than one actor. Against that, Sansec's October 22 update tempers the alarm: "The public exploits do not work against a default PHP installation," most public proofs-of-concept "need the target application to have a local file inclusion bug," and mass exploitation is so far "less likely than we expected on release day." Both are true at once: attacks are being thrown at the internet, but turning them into reliable code execution still "needs specific knowledge of the target server and specific conditions on it" (the AC:H/AT:P in the CVSS vector). This is a reprieve, not an all-clear — the root cause is public and a cleaner exploit can land any day.
  • CISA still has not listed either CVE. We checked the live KEV catalog on October 22: version 2026.10.21, neither CVE-2026-109618 nor CVE-2026-109619 present. Given confirmed in-the-wild activity on a mass-deployed runtime, a listing (with a 3-day BOD 26-04 clock for federal agencies) is plausible soon — don't wait for it.
  • Distribution packages have mostly caught up. Ondřej Surý (ppa:ondrej/php, deb.sury.org), Remi, Ubuntu, AlmaLinux and the RHEL streams are shipping the fix; the official Docker php images and FrankenPHP (1.13.2) are rebuilt on the patched runtimes. The remediation section below is now organised by how you actually deploy PHP.

The one correction to yesterday's framing: session.upload_progress.enabled=0 is a real stopgap but not the single fix — the strongest demonstrated trigger for CVE-2026-109619 is the PHP 8.5 fatal_error_backtraces path, and every stale-state route still exists until you update. Treat configuration changes as time-buying, never as the fix.

Update — October 21, 2026 18:40 CEST

It is now being exploited in the wild. Within hours of the patch, two researchers independently confirmed active attacks. watchTowr's Attacker Eye honeypot network observed exploitation on October 21, and Hadrian reports it "exploited in the wild at scale" in updates timestamped 11:35 and 14:35 UTC. The most-abused route is the session upload-progress path — the confirmed trigger for CVE-2026-109619 — so disabling it is now the single highest-value stopgap, not just one option among several. Sansec now states that "the writeups and an exploit tool are public" and expects mass exploitation; the PHP2Shell tool chains both CVEs into a no-login attack. CISA still has not listed either CVE (KEV catalog version 2026.10.21). This moved the story from "patch when you can" to "patch now, then hunt" — the At a glance box and remediation below reflect it.

Update — October 21, 2026 15:55 CEST

The patch is out. PHP shipped the security releases on October 21: 8.2.35, 8.3.36, 8.4.27, and 8.5.12. The two flaws now have full PHP advisories, and both are memory-safety bugs in the request lifecycle, not the upload parser some early mitigations implied:

  • CVE-2026-109618 — "RCE via OOM corruption" (GHSA-w8hw-w9fx-j79w): PHP uses longjmp() to bail out of an out-of-memory condition, which can abandon a request while its data is only partially initialized; request shutdown then processes that invalid state.
  • CVE-2026-109619 — "RCE via stale global state" (GHSA-6wmf-4rv5-p3rp): worker-retained global state can keep pointing at a prior request's heap after that memory is freed — a use-after-free across requests on the same FPM worker.

Both are CVSS v4.0 9.2, vector AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H — unauthenticated (PR:N) but high-complexity (AC:H/AT:P), which is why reliable exploitation is non-trivial even though the window is open. PHP 8.1 and older get no project release, but the security team published minimal source backports for 7.4, 8.0, and 8.1, and distributions are shipping their own. Neither CVE is in the CISA KEV catalog (version 2026.10.20) yet. The body below has been reconciled with these facts.

At a glance

CVE CVE-2026-109618 (RCE via OOM corruption) · CVE-2026-109619 (RCE via stale global state) · no NVD record yet; see the PHP GHSA advisories below
Product / affected versions PHP (interpreter core) · < 8.2.35 · < 8.3.36 · < 8.4.27 · < 8.5.12; all web SAPIs (PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, LiteSpeed), mod_php highest risk
Fixed in 8.2.35 · 8.3.36 · 8.4.27 · 8.5.12 · released 2026-10-21; PHP provided source-only backports for 7.4 · 8.0 · 8.1; 8.1 and older get no binary project release
CVSS 9.2 Critical (CVSS v4.0) · AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H · unauthenticated but high attack complexity
Exploited in the wild Yes · watchTowr (Attacker Eye honeypot) observes exploitation since 2026-10-21; Amazon Threat Intelligence saw an attempt on 2026-10-17 (pre-disclosure) and calls it "broadly exploited"; Cloudflare reported early attacks from 07:43 UTC. But Sansec (2026-10-22): the public exploits "do not work against a default PHP installation" — most need an app-side local file inclusion; reliable RCE still needs target-specific conditions
CISA KEV Not listed (live check 2026-10-22, catalog version 2026.10.21)
Public PoC Public tool (PHP2Shell, credited to Calif.IO) chains both CVEs, and watchTowr reproduced both; per Sansec (2026-10-22) no universal drive-by exploit has been shown against a default install
Official advisory https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w

What happened: PHP2Shell leaked before the fix

PHP ships security fixes on a coordinated schedule. This time the schedule broke. The official PHP pre-announcement on October 20 gave only the essentials: an upcoming release addressing "two critical vulnerabilities, both rated CVSS v4.0 9.2," with full details, affected versions, and fixed versions held back until the release itself. It also carried a tell — the team reserved the right to ship earlier "should details of either vulnerability become public, or should evidence of active exploitation appear in the wild."

Both conditions started to come true the same day. According to Sansec's writeup, a Hacker News post on October 20 flagged the coming disclosure, was removed, and the screenshots spread anyway — including one of an offensive tool called PHP2Shell, credited to Calif.IO, whose banner claims it works against every PHP release from 5.4.0 on. SecurityWeek reported that watchTowr's Benjamin Harris confirmed his team reproduced CVE-2026-109618 and that the bugs are genuine remote code execution. The CVE identifiers trace to the leaked material; PHP's notice lists neither, and neither is in NVD yet. The result is the worst possible disclosure shape: a confirmed, critical, unauthenticated RCE in one of the most widely deployed pieces of server software on earth, no fix yet for most people, and a working exploit already in private hands.

Who is exposed, and how to check

PHP is not one product you patch once. It is an interpreter bundled into CMS platforms, e-commerce stacks, hosting control panels, and vendor appliances. The fix covers every supported branch below 8.2.35, 8.3.36, 8.4.27, and 8.5.12 — which sweeps in Magento, Shopware, and WooCommerce — and the PHP advisories call out every web SAPI (PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, LiteSpeed), with mod_php at the highest risk.

Check what you actually run, not what you think you run:

  • php -v on every host, and the version your web SAPI uses — CLI and FPM can differ. For PHP-FPM, check each pool.
  • The PHP bundled with your CMS or commerce platform, which is often older than the system PHP.
  • Control panels (cPanel, Plesk), which ship their own PHP builds.
  • Containers and base images: docker image inspect the PHP layer; a rebuilt image is the only real fix there.
  • End-of-life PHP. The supported branches get binary releases (8.2.35 / 8.3.36 / 8.4.27 / 8.5.12); for 7.4, 8.0, and 8.1 PHP published source-only backports and distributions are shipping their own, so check your vendor rather than assuming you're stranded — but anything older still needs a supported upgrade or removal from the internet.

Remediation

This is an interpreter-level bug. You cannot fix it in your application code — the vulnerable path runs inside PHP itself, before your app or any PHP-level WAF executes. Both advisories are explicit: updating to a patched release is the only complete mitigation; no configuration change makes an installation safe (GHSA-w8hw-w9fx-j79w, GHSA-6wmf-4rv5-p3rp). Work the steps in order.

Step 1 — Find every PHP you run

Free self-check script: php2shell-check.sh does this step for you on each host: it lists every PHP build (system, PHP-FPM, cPanel, Plesk, LiteSpeed, containers), compares it with 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 and flags PHP processes that spawned a shell. Read-only, open source, runs on your machine; nothing leaves your network.

PHP is not one product you patch once. It is an interpreter bundled into CMS platforms, e-commerce stacks, hosting panels and vendor appliances, and the copy serving web requests is often older than the one on your $PATH.

  • php -v on every host — then the version your web SAPI uses, which can differ from the CLI. php -i | grep -i 'Server API' tells you the SAPI; for PHP-FPM check each pool.
  • ps aux | grep -E 'php-fpm|php-cgi|lsphp|frankenphp|httpd|apache2' to see what is actually running and as which user.
  • CMS/commerce bundles (Magento, Shopware, WooCommerce, Drupal, Laravel apps) — the PHP underneath them, not the app version.
  • Control panels (cPanel, Plesk, DirectAdmin, CloudLinux) ship their own PHP builds, often several side by side.
  • Containers and base images: docker image inspect the PHP layer. A running container keeps the old binary until you rebuild and redeploy.
  • Appliances and managed boxes with an embedded PHP you don't control — open a vendor ticket.

Treat any internet-reachable PHP as in scope. Apache mod_php is the highest-risk configuration (the advisory confirms RCE there, because .htaccess/php_value directives run before request startup); PHP-FPM is confirmed exploitable when a front end passes PHP_VALUE/PHP_ADMIN_VALUE; FrankenPHP and LiteSpeed/LSAPI are credible but less proven.

Step 2 — Patch, internet-facing first

Fixed releases, all from October 21, 2026: 8.2.35 · 8.3.36 · 8.4.27 · 8.5.12 (php.net). Apply per how you deploy:

How you run PHP What to do Verify
Debian / Ubuntu (distro) apt update && apt upgrade the php* packages; Ubuntu 22.04 ships 8.1, older releases via Ubuntu Pro zgrep CVE-2026-109618 /usr/share/doc/php*/changelog.Debian.gz
Ondřej Surý PPA / deb.sury.org apt upgrade; fixes published for 5.6, 7.4, 8.0, 8.1, 8.2–8.5 check the installed version string
RHEL / Alma / Rocky (AppStream module) dnf update php\*; AlmaLinux shipped every stream, RHEL 8/9 some streams (others in progress — check the tracker) rpm -q --changelog php-common | grep CVE-2026-109618
Remi's repository dnf update; 7.4/8.0/8.1 and 8.2–8.5 shipped (7.2/7.3 to follow) installed version
Alpine apk upgrade php*; check the distro tracker for the fixed -r build apk version php
Official Docker php image Repull the patched tag (e.g. 8.4.27-fpm, 8.3.36-apache, 8.2.35-fpm, 8.5.12-fpm, live on Docker Hub) and rebuild + redeploy; no fix exists for 8.1 or older tags image digest / php -v in the new container
FrankenPHP Upgrade to 1.13.2 (security release built on the patched PHP, 2026-10-21) frankenphp version
cPanel EasyApache 4: update all ea-php* packages (yum update ea-php*), then across versions in WHM per-version string
Plesk Update PHP handlers via Plesk Installer / plesk installer per-handler version
CloudLinux alt-php / hardened PHP yum update alt-php*; LVE/hardened-PHP users may have vendor extended coverage installed version
LiteSpeed / OpenLiteSpeed (lsphp) Update the lsphp* packages for every version, via the panel or yum/apt per-lsphp string
Windows builds Replace with the patched binary from windows.php.net php -v
Built from source Rebuild from the fixed branch tag php -v

If your package source lags, don't declare done on a version guess — confirm the changelog/CVE line is present, and fall back to your distro's security tracker if in doubt.

Step 3 — Restart every worker

The patch only takes effect in a freshly started interpreter, and CVE-2026-109619 is specifically a bug in long-lived workers reusing stale state. After updating: systemctl restart php*-fpm (every version), reload Apache (systemctl restart apache2/httpd) if you use mod_php, restart LiteSpeed, and redeploy — not just restart — any container. Then prove the running worker is patched: php -v is the CLI; for FPM/web, hit a one-line phpinfo() on a protected path (and remove it afterward) or check your panel's reported version.

Step 4 — End-of-life PHP (8.1 and older)

  • 8.1, 8.0, 7.4: no upstream binary release, but PHP published minimal source backports for these branches, and most distributions/LTS vendors (Ondřej, Remi, Ubuntu Pro, Freexian ELTS, TuxCare, ZendPHP LTS, CloudLinux) are shipping packaged fixes. Use your vendor's build or compile the backport; don't assume you're stranded.
  • 7.3 and older (back to 5.4, where the vulnerable code path originates): no fix from anyone. The only real answers are to upgrade to a supported branch or take the host off the public internet. A WAF or VPN in front of it is a containment measure, not a fix.

Step 5 — Can't patch in the next hour? Buy time (not a fix)

For a host you genuinely cannot update yet, the advisories list partial, administratively-enforced mitigations. Set them as PHP-FPM pool directives with php_admin_value[...]/php_admin_flag[...] (so an app can't override them), restart the workers, and confirm the value inside a real request:

memory_limit = -1            ; raises the bar for the OOM path (CVE-2026-109618); do NOT use RLIMIT_AS/RLIMIT_DATA instead
session.upload_progress.enabled = 0   ; removes one confirmed CVE-2026-109619 trigger
fatal_error_backtraces = 0   ; PHP 8.5 only — removes the strongest demonstrated CVE-2026-109619 trigger
post_max_size = 8M           ; smaller than your default, to make the OOM harder to force

Caveats that matter: memory_limit = -1 means one request can exhaust server memory, so pair it with a container/cgroup memory cap as an availability boundary. The session setting alone is not enough. None of this closes the hole. Sansec notes every known trigger is a multipart/form-data request, so as a heavier stopgap you can block that content type at the web server (this breaks file uploads and some checkout forms) or restrict a read-only site to GET/HEAD. Cloudflare has shipped WAF rules (free tier included) that it explicitly calls a "STOPGAP only" covering just traffic routed through it. CERT-EU's advice for anything you can't fix: isolate it from public networks until patched and verified.

"Updating to a PHP release containing the patch to this vulnerability is the only complete mitigation." — PHP security advisory GHSA-w8hw-w9fx-j79w

Step 6 — Patching the CMS is not enough

A fully updated WordPress, Drupal, Magento or Laravel remains vulnerable if the PHP underneath it is unpatched — the flaw is in the runtime, below your application and below any PHP-level plugin or WAF. Updating the app does nothing here; updating PHP (Steps 2–3) is the fix. Conversely, on shared or managed hosting where you don't control PHP, the fix is your provider's job — ask them for the running version and the patch status in writing.

Step 7 — Hunt, then eradicate and verify

See the detection section below for what to look for. If you find signs of exploitation: isolate the host, preserve web-server and PHP logs before they rotate, and hunt for web shells, unexpected files in the web root, new cron jobs or scheduled tasks and new accounts. Then patch or rebuild, and rotate every credential the PHP process could read — database passwords, API keys, session secrets — because successful RCE runs as the web user with access to all of them. Finally, re-test the exact entry path: a higher version string is not proof the hole is closed, and for an EOL host behind a network control, that re-test is what tells you the control actually holds.

Detection and hunting

No IOCs, log lines, or paths have been published yet, and we will not invent any. What defenders can watch for now is behavioral, drawn from Huntress's rapid response: RCE against a web interpreter nearly always surfaces as the interpreter spawning a child it should never spawn.

  • PHP processes (php-fpm, php-cgi, httpd, apache2) launching sh, bash, cmd.exe, or powershell.exe — classic web-shell / command-execution behavior (MITRE ATT&CK T1190 initial access, T1505.003 web shell, T1059 command execution).
  • Those same processes launching interpreters (python, perl) or download/transfer tools (curl, wget, nc, certutil.exe).
  • Command lines containing /dev/tcp/, fsockopen, or mkfifo — reverse-shell primitives.
  • Reconnaissance from a web host: whoami, id, uname -a, ipconfig.

On Linux servers without EDR, Huntress points to Florian Roth's process-watcher run in observe mode. The catch with all of it: these signals fire after code is already executing. On a flaw already being probed in the wild — and one cleaner exploit away from reliable RCE — after-the-fact process telemetry is a race you are structurally behind on.

What is not known yet

  • The full scope. Exploitation is confirmed (see the update above), but researchers have not broken down which CVE is hit in each case or how reliable RCE is versus the memory-disclosure primitive; watchTowr credits the exploitation to the pair without splitting it. The AC:H/AT:P vector still says reliable code execution is non-trivial, so the ratio of successful RCEs to probes is unknown.
  • How far the public exploit goes. Sansec confirms the writeups and an exploit tool are public, but a vetted, drop-in public RCE for every SAPI is not yet established; with the GHSA root cause now published, treat one as imminent.
  • Whether CISA adds the pair to the KEV catalog — it had not as of catalog version 2026.10.21.

We will update this post as CISA and the researchers publish more.

Surviving the 15-minute window

Sansec's warning — mass exploitation "likely within 15 minutes" of release — is the real problem statement. Nobody patches a fleet of web servers, bundled runtimes, and EOL hosts in fifteen minutes. So the question is not only "did I patch" but "will I see the instant someone lands the exploit on a box I haven't reached." As the detection section admits, host-side telemetry catches that only after the shell is already open.

This is the case Zero Hunt's AI Traffic Analysis was built for: a deep-learning model with four inference heads (suspicious traffic, malware classification, attack-type identification, application fingerprinting), trained on billions of PCAP sequences, running at a 2.7+ Gbit/s baseline locally on the appliance GPU. The exploitation attempt, the web shell's first callback, tool staging over curl/wget, the reverse-shell beacon — all cross the wire while it is happening, not in next morning's SIEM digest. When the gap between patch and exploit is minutes, seeing the attempt on the network is the difference between an incident you contain and one you read about later.

The patch race is the other half, and it's a prioritization problem. When every advisory says "critical, patch now," the useful question is which of my hosts is actually reachable and exploitable — because that is the short list you fix first. Zero Hunt runs as an autonomous AI red team on an on-premise appliance with private models and a human approval gate for every action that matters: it finds the exposed services across your estate, validates which exposures a real attack path can actually reach rather than ranking them by CVSS alone, and — the step most tools skip — re-tests the same path after you patch to prove the fix held and nothing regressed. For EOL PHP that will never get an official build, that re-verification is what tells you the network control in front of it actually holds.

To map where PHP hides in your estate — the bundled runtimes and EOL hosts the patch run always misses — start with our guide to automated penetration testing, and our team can walk through it. For the broader pattern, see our earlier analysis of wp2shell in WordPress core.

Every vulnerability CISA lists as exploited, with federal due dates: CISA KEV tracker →

Patching one CVE at a time? A CTEM program validates which exposures are actually exploitable before the next advisory: what CTEM is →

Is this exploitable in your environment?

Zero Hunt answers that on your own network: an autonomous AI red team on an on-premise appliance, running on private AI, black-box or gray-box, with a human approving every step that matters. Proof of what is exploitable, the fix, and signed evidence — your data stays on your network.