PHP2Shell refers to two critical, unauthenticated remote code execution vulnerabilities in the PHP core — CVE-2026-109618 and CVE-2026-109619 — both rated CVSS v4.0 9.2. If you run PHP anywhere in production, this is a patch-now situation, not a backlog item. Here's what the bugs actually do and the concrete steps to close them.
What CVE-2026-109618 and CVE-2026-109619 Actually Are
Both vulnerabilities live in the PHP interpreter itself, not in any specific framework, CMS, or application code:
- CVE-2026-109618 is triggered when PHP runs out of memory partway through setting up a request. The interpreter is left with half-built internal state, and the cleanup code trusts that state as if it were complete — creating a path to memory corruption and code execution. The same flaw also leaks server memory on its own: PHP's upload-progress handler can return freed worker memory to the client inside a
PHPSESSIDresponse cookie, which can expose passwords, session tokens, API keys, and TLS private keys left over from other requests on the same worker. - CVE-2026-109619 is a use-after-free. Internal state tied to one request can outlive the memory it was allocated in, and a later request handled by the same worker can reuse that freed memory before it's reset — giving an attacker a path to corrupt memory and run arbitrary code.
Both are exploitable by an unauthenticated, remote attacker — no login, no special configuration, and in many cases no application-specific vulnerability required. PHP's security team published fixes on October 21, 2026, and security researchers (watchTowr, Sansec, JFrog, Datadog, and others) have tracked active exploitation through honeypot networks since before public disclosure.
Why You Can't "Fix" This in Your Application Code
This is the point that trips teams up: PHP2Shell is not a SQL injection, XSS, or deserialization bug in your codebase. It's a defect in how the PHP engine itself manages memory during request lifecycle and worker reuse. No amount of input validation, sanitization, or framework-level hardening in your application PHP code will close it, because the vulnerable code runs underneath your application — in the interpreter that executes it.
The fix has to happen at the runtime layer: you update the PHP binary your server runs, not the PHP scripts your team writes.
Affected Versions and Patched Releases
The PHP 8.2 through 8.5 branches are affected. Patched versions:
- PHP 8.5.12
- PHP 8.4.27
- PHP 8.3.36
- PHP 8.2.35
Source-level backports are also available for the end-of-life 8.1, 8.0, and 7.4 branches, but if you're still running those versions, this is a strong signal to plan a full upgrade rather than relying on backports indefinitely — EOL branches no longer receive routine security maintenance.
Step-by-Step: How to Patch PHP2Shell
- Identify your exact PHP version in every environment. Run
php -von each server, container image, and CI/CD base image. Don't assume staging matches production — PHP2Shell checker scans have found a majority of internet-facing hosts still running pre-fix versions weeks after disclosure. - Upgrade to the patched point release for your branch. On most Linux distributions this is a package manager update:
# Debian/Ubuntu (via Ondřej Surý's PPA or your distro repo) sudo apt update && sudo apt install php8.3 # RHEL/CentOS/Rocky (via Remi repo) sudo dnf update php # Docker — pin to the patched tag FROM php:8.3.36-fpm # macOS (Homebrew) brew upgrade php@8.3 - Rebuild and redeploy container images. If PHP is baked into a Docker image, bump the base image tag to the patched version, rebuild, and redeploy — pulling a new OS package on a running container isn't enough if the image itself is cached in your registry or CI pipeline.
- Restart PHP-FPM, Apache mod_php, or your application server after the upgrade so the new interpreter binary is actually loaded:
sudo systemctl restart php8.3-fpm sudo systemctl restart apache2 # or nginx, if using FPM upstream - If you cannot patch immediately, apply mitigations — but treat them as temporary:
- Disable
session.upload_progress.enabledinphp.inito close the memory-disclosure path tied to CVE-2026-109618. - Deploy WAF or reverse-proxy rules to block malformed multipart/form-data requests designed to trigger the memory-exhaustion path during request setup.
- Reduce PHP-FPM worker reuse (lower
pm.max_requests) to shrink the exploitation window for the use-after-free in CVE-2026-109619.
- Disable
- Verify the fix. Confirm
php -vreports the patched version everywhere, and check vendor advisories (PHP's own security release notes, or your distro's changelog) to confirm the specific CVE fixes are included in the build you installed.
Why This Can't Wait
CVE-2026-109619 was added to CISA's Known Exploited Vulnerabilities (KEV) catalog on October 26, 2026, with a federal remediation deadline of October 29, 2026 — a signal of how seriously this is being treated across the industry, not just in government. Multiple honeypot networks recorded exploitation attempts as early as October 17, 2026, four days before the vulnerabilities were publicly disclosed. Unauthenticated RCE at CVSS 9.2, combined with pre-disclosure exploitation, means any internet-facing PHP host is a live target until it's patched.
Further Reading
- Tenable: PHP2Shell FAQ
- Sansec: PHP2Shell Research
- Datadog Security Labs: PHP2Shell Detection & Remediation
- JFrog Security Research: PHP2Shell Deep Dive
Need Help Patching PHP2Shell Across Your Infrastructure?
Ez IT Expert helps businesses audit PHP versions across servers, containers, and CI/CD pipelines, then coordinate safe, tested upgrades to patched PHP releases — without breaking production. If you're not sure which of your systems are exposed, we'll find out fast.
Get a Free PHP2Shell Exposure Check →