← Back to Blog
CVSS 9.2 · Critical Vulnerability Analysis Patch Now

PHP2Shell: The AI‑Found PHP Flaw That Sent Websites Dark Worldwide

CVE-2026-109618 and CVE-2026-109619 live in the PHP runtime itself, not in your application. One crafted HTTP request, no login, and the attacker runs code as your web worker. Here is the mechanism, the exposure math, and the response plan.

Krishna Muduli, CISSP Cybersecurity Lead Engineer October 22, 2026 19 min read
POST /any.php Content-Type: multipart/form-data no cookie · no auth no user click PHP ZEND ENGINE use-after-free www-data@web:~$ id uid=33(www-data) CVE-2026-109618 · CVE-2026-109619

Most RCE bugs live in a plugin, a framework or your own code. PHP2Shell lives one layer lower, in the interpreter every one of those runs on. That means a perfectly written app on a fully patched CMS is still exposed, until the PHP binary itself is replaced and every worker restarted.

9.2
CVSS v4.0 base score, both CVEs
0
Credentials or clicks needed
5 → 8
PHP major versions reported affected
4
Branches with an upstream fix
⚠️

Developing story. The disclosure is a day old and vendors still disagree on some points, most importantly whether attacks are already succeeding. Version numbers below match the PHP release of 21 October 2026. Confirm them against the official PHP security advisory and your OS vendor before acting.

At a Glance

CVE IDs
CVE-2026-109618
CVE-2026-109619
Severity
9.2 / 10CVSS v4.0, rated by the PHP security team
Weakness
CWE-824Access of an uninitialized pointer
Attack vector
NetworkNo privileges, no user interaction
Affected
PHP 5.4 through 8.5As reported by researchers and trackers
Fixed in
8.5.12 · 8.4.27
8.3.36 · 8.2.35

CVSS v4.0, drawn to scale

Both CVEs sit deep in the critical band (9.0 to 10.0)

LOW 0.1–3.9 MEDIUM 4.0–6.9 HIGH 7.0–8.9 CRITICAL 0 4.0 7.0 9.0 10 PHP2Shell 9.2

Marker position: 20 + 9.2 × 60 px on a 0–10 scale, so the drawing is to scale.

Why an Engine Bug Is Everyone's Bug

PHP is not one technology among many on the web. It is the default. According to W3Techs, 70.2% of all websites whose server-side language can be identified run PHP, more than every other server-side language combined. WordPress, Drupal, Joomla, Magento, Laravel and Symfony all run on it, along with a long tail of internal tools, hosting panels and vendor appliances that bundle their own copy.

How much of the web runs on PHP

Share of websites by server-side language, where the language is known

Source: W3Techs, 27 August 2026; top-1M figure from its June 2026 report. "Everything else" is the remainder.

Normally a PHP vulnerability is somebody's application bug, and your exposure depends on whether you run that app.

PHP2Shell breaks that assumption. Both flaws sit in the Zend engine and request handling, below every framework. Your code review, your WAF rules for WordPress plugins, your dependency scanner: none of them look at the interpreter binary.

Where the bug sits in your stack

Hardening the layers above does not remove a flaw in the layer they all run on

Your application
Custom code, APIs, admin panels. Reviewed, tested, maybe flawless.
Not the issue
CMS & frameworks
WordPress, Laravel, Drupal, Magento, Symfony and their plugins.
Not the issue
PHP engine + SAPI
Zend engine, session module, OPcache, fatal-error handling, run by PHP-FPM, mod_php or CGI.
PHP2Shell is here
OS / container
Decides how far a compromised worker can reach: user, filesystem, network, cgroups.
Your blast-radius control

What PHP2Shell can cause

The technical result is code execution as the web worker. In business terms, that one primitive opens up every outcome below. Which ones are realistic depends on what the server holds and what it can reach (the blast-radius section further down goes deeper).

🗄️
Data breachDatabase credentials sit in config files the worker can read. Customer records, orders and personal data follow.
💳
Card skimmingInjected JavaScript on checkout pages of PHP shops quietly copies payment details as customers type them.
🩸
Leaks of other users' dataThe disclosure half of the bug can expose data from other requests, even without full code execution.
🕸️
Defacement & SEO spamWritable web roots let attackers plant phishing pages, malware downloads and spam links under your domain.
🔐
Ransomware footholdA web server is a classic first step into a network: steal secrets, move laterally, then encrypt.
🏢
Mass compromise on shared hostingOne PHP runtime often serves hundreds of customer sites. One vulnerable binary, hundreds of victims.

Why the score is 9.2, not 10

CVSS v4.0 scores a bug from a set of base metrics. The PHP security team rated both CVEs 9.2. Identifiers that circulated before the official release carried a 10.0, which the PHP Foundation says was incorrect. The vector reported for both CVEs explains the gap:

The CVSS v4.0 metrics behind 9.2

Red pushes the score up, amber holds it below the maximum

AV · Attack VectorNetworkReachable over the internet, from anywhere
PR · Privileges RequiredNoneNo account, no login
UI · User InteractionNoneNobody has to click anything
VC / VI / VA · ImpactHigh / High / HighFull loss of confidentiality, integrity and availability on the server
AC · Attack ComplexityHighReliable exploitation takes work, such as steering memory exhaustion or a fatal error at the right moment
AT · Attack RequirementsPresentConditions outside the attacker's control must hold, such as session upload progress being enabled

Reported vector: AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H. Confirm against the NVD entry once it is published.

In plain words: everything about who can attack is as bad as it gets (anyone, remotely, with no login and no victim action), and so is the impact. The only things keeping it off a perfect 10 are that exploitation takes skill and depends on certain conditions. That is cold comfort here: upload progress is on by default, and AI tools are lowering the skill barrier, as the discovery story below shows.

Why governments said: patch now, or take it offline

On 21 October, CISA published an alert strongly urging organisations to patch both CVEs immediately. According to reports, the NSA went further and told organisations to patch or take vulnerable systems offline, and the UK's National Cyber Security Centre gave similar advice. Government and corporate websites in several countries went dark as a precaution. Advice that blunt is rare. Here is why it was given:

1
Internet-facing and pre-authEvery exposed PHP server is a target. No credentials stand in the way, and the trigger runs before any application code.
2
Details leaked before the fixInformation surfaced a day early. Reports say this included a video showing exploitation that was published by mistake, giving attackers a head start.
3
Attacks started earlyCloudflare reported attack attempts hours before patches shipped. Waiting for "confirmed exploitation" means waiting too long.
4
No fix for older PHPPHP 8.1 and earlier get no upstream patch. For those servers, offline or replaced is the only safe state.
5
AI shortens the exploit raceWiz notes these flaws existed for decades, but frontier AI lowered the bar to turning them into working exploits.
6
The scale is enormousWith PHP behind about 70% of known sites and over 22 million vulnerable instances, even a low success rate means mass compromise.
🌐

Taking a site offline is a risk decision, not panic. A few hours of downtime costs far less than a breach, a card-skimming incident or a ransomware foothold. If you cannot patch or apply the workarounds today, block public access to the PHP application until you can.

Under the Hood: The PHP Request Lifecycle

To see why this is so dangerous you need two facts about how PHP serves requests.

Fact 1: workers are reused. Under PHP-FPM a master process keeps a pool of long-lived worker processes. Each worker handles request after request (until pm.max_requests recycles it). PHP's "shared nothing" model is supposed to reset per-request state at shutdown, so request N cannot affect request N+1. Anything that survives that reset is shared, and that is the crack PHP2Shell uses.

Fact 2: some engine code runs before your script. When a multipart/form-data POST arrives, PHP parses the body (its RFC 1867 upload handler) during request startup. If session.upload_progress.enabled is on, which is the default, and the body carries a field named after session.upload_progress.name (default PHP_SESSION_UPLOAD_PROGRESS), the session module starts writing upload progress into the session while the body is still being read. No line of your application has executed yet.

One request through PHP-FPM

The red steps are reachable by an anonymous attacker before your code runs

01 · SAPI
Worker accepts request
Nginx or Apache hands the request to a reused FPM worker over FastCGI.
02 · STARTUP
Body parsing
RFC 1867 handler reads the multipart body into $_POST / $_FILES.
03 · SESSION
Upload-progress hook
Session module writes progress into the session as data streams in.
04 · EXECUTE
Your script runs
Routing, auth checks, input validation. Too late for this bug.
05 · SHUTDOWN
Cleanup & reuse
State should be wiped. An aborted request can leave some behind for the next one.
ENGINE-CONTROLLED · NO AUTH YET
APPLICATION-CONTROLLED

Abnormal endings are the trigger

When PHP hits a fatal error, including "Allowed memory size exhausted", it does not unwind politely. The engine bails out of the current execution (internally a setjmp/longjmp-style jump) and skips straight to shutdown. Code that was halfway through updating a structure never finishes. If a pointer was freed but not cleared, or a global flag was never reset, shutdown and the next request inherit it.

That is the class of bug both CVEs belong to (CWE-824, use of an uninitialized or stale pointer). The researchers credited with the discovery describe several memory safety issues across session handling, OPcache class caching and fatal-error backtrace generation, all reachable by forcing a request to end abnormally. Three of the five exploitation techniques they demonstrated use the upload-progress feature as the remote trigger.

"The application never gets a vote. The dangerous path starts during request startup and ends in a worker that will happily serve the next customer."

Why PHP2Shell is unauthenticated by design

The PHP2Shell attack chain

Conceptual flow only: no exploit steps, no payloads

Request arrives
A crafted HTTP request reaches any PHP endpoint. No account, no real session, no click.
Engine code runs first
Body parsing and session upload-progress handling execute during request startup.
Abnormal ending
The request is pushed into memory exhaustion (…618) or a fatal error (…619).
Stale state is trusted
An invalid pointer or global survives the bailout and later code treats it as valid.
Memory corruption
Heap use-after-free plus memory disclosure, a Heartbleed-style leak of neighbouring data.
Code as the worker
Commands run with the PHP worker's privileges, typically www-data or apache.

The Two CVEs Side by Side

CVE-2026-109618
Memory exhaustion route
TriggerRequest driven into memory_limit exhaustion
PrimitiveChain of weaknesses leading to memory corruption
ImpactRCE as the web worker account
ReliabilitySeveral strategies reach the condition consistently
StopgapRemove the memory ceiling as a trigger (with a cgroup cap)
CVE-2026-109619
Fatal error, stale global state
TriggerFatal error leaves global state invalid
PrimitiveHeap use-after-free read by later requests
ImpactMemory disclosure and RCE, unauthenticated
ReliabilityMultiple triggering strategies described
Stopgapsession.upload_progress.enabled = 0; on 8.5 also fatal_error_backtraces = 0

What an Attacker Gets

Code execution as the PHP worker is the entry point, not the end state. How far it goes depends on how the host was built.

Blast radius, from the engine outward

Typical post-exploitation reach. An illustration, not a measurement

1 2 3 4 1 · The engine flaw Unauthenticated entry point in PHP itself 2 · The web worker account Run commands, write uploads and caches 3 · Application secrets .env, DB credentials, API keys, co-hosted sites 4 · The network behind it Internal services, cloud metadata, lateral moves

The disclosure half matters on its own: data from other requests in the same worker can leak even where code execution is blocked.

Am I Exposed?

Upstream PHP fixed the four supported branches. Everything older gets no fix from the PHP project, and that includes the PHP 5 and 7 lines that still run plenty of production sites.

Patch status by branch

Upstream php.net releases of 21 October 2026

8.5
Patched
Fixed in 8.5.12
8.4
Patched
Fixed in 8.4.27
8.3
Patched
Fixed in 8.3.36
8.2
Patched
Fixed in 8.2.35
8.1 · 8.0
No upstream fix
Source-only backports exist. Plan an upgrade to a patched branch.
7.x · 5.x
Unpatched
End of life. Migrate; apply workarounds until you do.
Paste the version from php -v, for example 8.3.34. Runs in your browser; nothing is sent anywhere.
🧩

Distro packages break naive version checks. Debian, Ubuntu, RHEL and AlmaLinux backport security fixes without bumping the upstream version, so php -v may print an "old" number on a patched host, or a "new-looking" one on an unpatched build. On distro packages, check the package changelog for the CVE IDs (commands below) instead of trusting the version string. AlmaLinux, for example, shipped patched packages for every PHP stream on 8, 9 and 10 on 21 October.

Timeline

How it unfolded

SUMMER 2026 · DATES VARY BY REPORT
AI-assisted discovery
Calif, using OpenAI's GPT-5.6 Sol, and Wiz, independently, identify the flaws and report them. Reports place the first finding between July and late August. Roughly two months of coordinated fixing follows.
20 OCT 2026
Leak ahead of disclosure
Details of two critical PHP flaws surface before coordinated disclosure and before any patch. The PHP security team announces a release for the next day. Reports say the leak included a video showing exploitation, published by mistake. Fake proofs of concept start circulating.
21 OCT 2026 · 07:43 UTC
First attack attempts reported
Cloudflare's CTO reports early attack attempts against PHP sites, hours before any fix exists. How many succeeded is not known.
21 OCT 2026 · 14:00 UTC
Emergency release
PHP ships 8.5.12, 8.4.27, 8.3.36 and 8.2.35, rates both CVEs 9.2 and says updating is the only safe choice. The advisory itself does not mention in-the-wild exploitation. Distros start rolling packages the same day.
21 OCT 2026 · LATER THAT DAY
"Patch now or go offline"
CISA urges immediate patching. The NSA and the UK's NCSC reportedly advise patching or taking vulnerable systems offline. Government and corporate sites in several countries go dark as a precaution.
22 OCT 2026
Exploitation reported
watchTowr's tracker lists both CVEs as exploited in the wild; other vendors say it is still under investigation. Neither CVE is in CISA's KEV catalogue at the time of writing. Plan as if attacks are active.

Found With AI: What PHP2Shell Says About Vulnerability Research

PHP2Shell was not found by a lone researcher reading C code late at night. It was found with the help of AI systems built by private technology and security companies, and it was found twice. As of 22 October 2026, reports credit two independent discoveries, one by Calif and one by Wiz, alongside research by OpenAI.

Two AI-assisted discoveries, one bug

Independent teams, overlapping AI tooling, the same flaw in the PHP engine

Calif
AI cybersecurity firm
OpenAI GPT-5.6 Sol
Credited with the discovery using OpenAI's security-focused model.
Wiz
Cloud security firm, acquired by Google
Google Gemini 4 ArgonWiz AtlasOpenAI GPT-5.6 Sol
Found and reported the same flaw independently.
Coordinated disclosure
About two months of work between OpenAI, the PHP maintainers, the researchers and security vendors, ending in the 21 October release.

Why this matters more than the bug itself

Memory-safety bugs in a 30-year-old C interpreter are not new. What is new is how they were found. Reaching a stale pointer through an abnormal end of request, across session handling, OPcache and fatal-error paths, is exactly the kind of cross-module state reasoning that has traditionally needed a senior researcher and weeks of fuzzing harness work. Here, two separate teams got there with AI assistance.

🤖

Key takeaway: AI-assisted vulnerability discovery has become a practical security research capability, not just a code-review feature. For defenders, the consequence is simple: patch windows measured in weeks are no longer safe. Assume capable adversaries can use similar AI tools to build exploits from a published fix, and plan to patch internet-facing runtimes in days, or hours for critical engine bugs like this one.

The practical response is the same one the rest of this post builds toward: know where every runtime is, be able to roll a patched binary fleet-wide quickly, and contain each worker so that one compromised process cannot take the network with it.

Detection: Find What Is Vulnerable

Because the flaw is in the runtime, you find it by inventory and configuration, not by scanning application code. Start with what runs where.

1. Inventory every runtime

hosts, containers, kubernetes
# on a host: the CLI and the FPM binary can differ
php -v
php-fpm -v                      # may be php-fpm8.3, php-fpm82, ...

# every running container and its PHP
docker ps --format '{{.Names}} {{.Image}}'
docker exec <container> php -v

# kubernetes: list images that look like PHP
kubectl get pods -A -o jsonpath='{range .items[*]}{.spec.containers[*].image}{"\n"}{end}' \
  | sort -u | grep -iE 'php|wordpress|drupal|laravel|magento'

2. On distro packages, check the changelog, not the version

debian / ubuntu / rhel / alma
# Debian / Ubuntu: installed PHP packages and whether the fix is in
dpkg -l 'php*' | awk '/^ii/ {print $2, $3}' | grep -E 'fpm|common|cli'
apt changelog php8.3-common 2>/dev/null | grep -E 'CVE-2026-10961[89]'

# RHEL / AlmaLinux / Rocky
rpm -q --changelog php-common | grep -E 'CVE-2026-10961[89]'

3. Check the risky settings in the web context

effective configuration
php -i | grep -E 'upload_progress.enabled|^memory_limit|fatal_error_backtraces'

# overrides in pool, ini and .user.ini files
grep -RnE 'memory_limit|upload_progress|fatal_error_backtraces' \
  /etc/php* /usr/local/etc/php* 2>/dev/null

The CLI often loads a different php.ini than FPM or Apache. Confirm the values the web workers actually use, for example with a temporary phpinfo() page restricted to your IP, deleted straight afterwards.

4. Hunt for signs of attempted exploitation

These are generic signals I would check, based on how the bugs work. None is a confirmed indicator of compromise and each has benign causes. Use them to prioritise, then investigate.

Worker crashesRepeated SIGSEGV or abnormal worker exits in PHP-FPM or Apache logs, and bursts of memory-limit fatal errors.
Upload-progress trafficMultipart POSTs carrying the upload-progress field to endpoints that never use the feature. Check WAF or proxy body logs; access logs will not show it.
Odd request shapesVery large or malformed multipart bodies aimed at pages that normally take small requests.
New PHP filesFiles created in the web root or upload folders since 19 October.
Child processesThe web worker user spawning shells, curl, wget or package tools.
Outbound trafficNew connections from the web tier to unfamiliar hosts, or to cloud metadata endpoints.
quick triage on a linux web host
# crash and memory signals in FPM logs (path varies by distro)
grep -E 'SIGSEGV|exited on signal|Allowed memory size' /var/log/php*-fpm.log

# PHP files changed since 19 Oct under the web root
find /var/www -name '*.php' -newermt '2026-10-19' -ls

# processes owned by the web user that are not php-fpm
ps -o user,pid,ppid,cmd -u www-data | grep -v php-fpm

# where sessions live (look for large, recently written files)
php -r 'echo ini_get("session.save_path"), PHP_EOL;'

Mitigation, in Priority Order

Response ladder

Work top to bottom. Patching is the only complete fix

Now
Patch the runtime and restart every worker
Upgrade to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 (or your distro's fixed package). Rebuild images, redeploy, and restart PHP-FPM or Apache. A package update that leaves old workers running does not protect you.
Can't patch
Apply the published workarounds
Remove the memory ceiling as a trigger for …618, disable session upload progress for …619, and on PHP 8.5 disable fatal-error backtraces. Restart workers after each change.
Legacy
Treat PHP 5, 7, 8.0 and 8.1 as exceptions
Put a migration date on every instance. Until then: workarounds, restricted reachability, and a WAF or proxy that inspects request bodies.
Contain
Assume a worker will be compromised one day
Unprivileged worker user, read-only code directory, open_basedir, egress filtering from the web tier, and secrets kept out of files the worker can read.
Watch
Alert on behaviour, not only signatures
EDR or SIEM rules for a web worker spawning a shell or making unusual outbound connections. Add vendor WAF rules as they ship. Ignore random "PoCs" on GitHub; some are malware aimed at researchers.
If exposed
Treat unpatched, internet-facing hosts as possibly compromised
Hunt for web shells and new PHP files, review outbound traffic from 20 October, then rotate DB credentials, API keys and app or session secrets the worker could read.

Temporary workarounds

php-fpm pool + php.ini
; CVE-2026-109618: pool file, e.g. /etc/php/8.3/fpm/pool.d/www.conf
; php_admin_value cannot be overridden by ini_set() in application code
php_admin_value[memory_limit] = -1

; Apache mod_php equivalent, inside the vhost:
; php_admin_value memory_limit -1

; CVE-2026-109619: php.ini or a conf.d override
session.upload_progress.enabled = 0

; PHP 8.5 only: stop generating backtraces on fatal errors
fatal_error_backtraces = 0
🧯

My caution on memory_limit = -1: with no PHP limit, one runaway request can eat the host. Pair it with a hard cap outside PHP, such as a container memory limit, a systemd MemoryMax= on the FPM service, or a cgroup limit, and keep the workaround short-lived. Disabling upload progress only breaks upload progress bars, so it is the cheaper of the two.

reduce blast radius: fpm pool hardening
; run as a dedicated, unprivileged user per site
user = site1
group = site1

; confine filesystem access to the app and temp dirs
php_admin_value[open_basedir] = /var/www/site1:/tmp

; recycle workers so leaked state does not live forever
pm.max_requests = 500

; trim process-spawning functions if your app does not need them
php_admin_value[disable_functions] = exec,passthru,shell_exec,system,proc_open,popen

pm.max_requests is not a fix, but a lower value shortens how long any state left behind by an aborted request can survive in a worker. Test disable_functions carefully: some CMS features and plugins depend on proc_open or exec.

Your 24-Hour Checklist

Inventory every PHP runtime

Hosts, containers, Kubernetes images, hosting panels and appliances with bundled PHP.

Patch and restart

Fixed upstream release or distro package confirmed by changelog, then every worker restarted.

Workarounds where you can't patch

Upload progress off, memory ceiling handled with an outer cap, backtraces off on 8.5.

Hunt on internet-facing hosts

Crashes, new PHP files since 19 October, worker child processes, unusual egress.

Rotate secrets if exposure is likely

Database credentials, API keys, application and session secrets readable by the worker.

Put a date on every legacy PHP

PHP 5, 7, 8.0 and 8.1 get no upstream fix. Each needs an owner and a migration deadline.

Key Takeaways

Sources

🛡️

Written for defenders. This post contains no exploit steps and no proof of concept. Configuration values come from the sources above; confirm them against the official PHP advisory for your exact version and platform.


Share With Your Team

LinkedIn WhatsApp