PHP2Shell: Two PHP Flaws Allow Unauthenticated RCE
PHP2Shell is two memory-safety flaws (CVE-2026-109618, CVE-2026-109619) that allow unauthenticated RCE on PHP web servers. CVSS 9.2 and actively exploited.
TL;DR — PHP2Shell is two critical PHP flaws, CVE-2026-109618 and CVE-2026-109619, that allow unauthenticated remote code execution on PHP web servers. Both score CVSS 4.0 9.2 and both are in CISA's exploited list. Upgrade to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 and restart every worker.
What is PHP2Shell?#
PHP2Shell is two memory-safety bugs in PHP's request handling, published by the PHP project on 21 October 2026. Both give code execution as the web worker account, with no login.
The bugs are in the PHP engine, not in any application. Wiz Research, which found them, says even a simple "Hello World" app on an affected version can be vulnerable. Wiz confirmed code execution against Drupal and WordPress in August 2026 and reported the bugs to PHP on 24 August.
What are CVE-2026-109618 and CVE-2026-109619?#
CVE-2026-109618 is out-of-memory corruption (GHSA-w8hw-w9fx-j79w). PHP uses longjmp() to bail out when memory runs out. Some request memory is reachable before it is set up, so the early exit leaves it invalid and request shutdown reads it. Multipart requests with many headers, empty file fields or nested field names can force the memory exhaustion.
CVE-2026-109619 is stale global state (GHSA-6wmf-4rv5-p3rp). A persistent worker can keep error, session or extension state that points into the memory of a request that has already ended. A later request on the same worker reads that freed memory. Confirmed paths include session upload progress, which is on by default.
Both advisories list CWE-416 (Use After Free), CWE-755, CWE-824, CWE-1325 and CWE-1419, and both are rated CVSS 4.0 9.2 by the PHP project. NVD scores CVE-2026-109618 at CVSS 3.1 9.8 and CVE-2026-109619 at 8.1.
Which PHP versions and servers are affected?#
Every branch before the October fixes is affected. NVD lists CVE-2026-109618 from PHP 7.3 and CVE-2026-109619 from PHP 5.4.
| Branch | Fixed version |
|---|---|
| PHP 8.5 | 8.5.12 |
| PHP 8.4 | 8.4.27 |
| PHP 8.3 | 8.3.36 |
| PHP 8.2 | 8.2.35 |
| PHP 8.1 and older | No fix: end of life |
According to php.net, PHP 8.1 reached end of life on 31 December 2025, 8.0 on 26 November 2023 and 7.4 on 28 November 2022. They get no patch.
Exposure by server setup, from the advisories:
| Server setup | Exposure |
|---|---|
| Apache mod_php | Highest. Code execution confirmed for both CVEs |
| PHP-FPM | CVE-2026-109619 exploitable via session upload progress; CVE-2026-109618 susceptible by source review |
| FrankenPHP | CVE-2026-109618 likely susceptible; no default path found for CVE-2026-109619 |
| LiteSpeed (LSAPI) | Conditional for both |
CISA says the flaws affect all PHP installations serving web requests, and also names php-cgi.
Is PHP2Shell being exploited?#
Yes, and details leaked before the release. Recorded Future records Patchstack reporting active exploitation incidents from hosting partners at 07:34 UTC on 21 October, before PHP shipped the fixes at 13:52 UTC.
On 26 October, BleepingComputer reported confirmed code execution in the wild against Apache mod_php running PHP 8.4.26. The same day, CISA added both CVEs to its Known Exploited Vulnerabilities catalogue, with a due date of 29 October 2026.
Can a php.ini setting stop PHP2Shell?#
No. Both advisories say updating is the only complete fix. Some settings reduce risk while you patch:
- For CVE-2026-109618,
memory_limit=-1is the main configuration mitigation, but it is not complete. Keeppost_max_sizelow and limit input nesting, variables and uploads. - For CVE-2026-109619, set
session.upload_progress.enabled=0, and on PHP 8.5fatal_error_backtraces=0. Each blocks one known path, not all of them. - If your app does not use multipart forms, block them before they reach PHP.
Restart all workers after any change. CISA says a web application firewall "may provide some protection" until you patch.
What should you do this week?#
- List every PHP install, including vendor appliances, internal tools, test servers and PHP embedded in other software.
- Check the version the web server runs. The CLI
php -vcan differ from what mod_php or PHP-FPM loads, so checkphpinfo()or the package manager. - Upgrade to the fixed version for your branch, starting with internet-facing systems. Rebuild container images and force a fresh base image.
- Restart every PHP worker; running workers keep the old code.
- If you cannot patch now, or run PHP 8.1 or older, take the system offline until it is updated, as CISA advises.
- Hunt for compromise. Look for oversized or deeply nested multipart requests, workers hitting their memory limit, PHP processes launching shells, new PHP files in web roots, and new cron jobs.
If you find signs of compromise, follow your incident response plan. Our penetration testing service checks the exposure is closed, advises your team on fixes and retests. You can also start with a free Exposure Check.
Frequently asked questions#
Does a reverse proxy protect us?#
No. A reverse proxy forwards requests to PHP, and a normal configuration does not block the requests that trigger these bugs. Patch PHP itself.
Should we disable session upload progress?#
Yes, if you do not need it. It blocks one confirmed path for CVE-2026-109619, but not the others and not CVE-2026-109618, so it is not a fix.
Is PHP 7.x affected?#
Yes. NVD lists affected versions back to PHP 7.3 and 5.4, and PHP 7.x is end of life, so it will get no patch. Move to PHP 8.2 or later.
How do we confirm we are patched?#
Check the version the web server loads, not only the CLI: it should be 8.5.12, 8.4.27, 8.3.36, 8.2.35 or later. Then restart every worker.
Sources#
- PHP, GHSA-w8hw-w9fx-j79w: RCE via OOM corruption (CVE-2026-109618)
- PHP, GHSA-6wmf-4rv5-p3rp: RCE via stale global state (CVE-2026-109619)
- NVD, CVE-2026-109618
- NVD, CVE-2026-109619
- CISA, Critical vulnerabilities in PHP require immediate patching
- CISA, Known Exploited Vulnerabilities catalogue
- PHP, Unsupported branches
- Wiz Research, PHP2Shell
- Recorded Future, PHP2Shell exploitation
- BleepingComputer, PHP2Shell flaws now exploited in the wild
Penetration Testing
We try to break in before attackers do.

