PHP2Shell: two critical flaws in core PHP enable unauthenticated RCE
Two CVSS 9.2 memory-safety bugs in PHP itself allow code execution and memory leaks across WordPress, Drupal, Joomla and other PHP apps.

Researchers have disclosed PHP2Shell, a family of critical memory-safety vulnerabilities in the core PHP engine. The flaws are not in a plugin, a theme or a content management system. They sit in PHP itself, which means almost any PHP application can be exposed, including a simple “Hello World” page running on an affected version. Fixed releases are available, and the PHP project says there is no complete mitigation other than upgrading.
Two CVEs, both rated 9.2
The issues are tracked as CVE-2026-109618 and CVE-2026-109619, each with a CVSS score of 9.2.
- CVE-2026-109618 is an out-of-memory (OOM) corruption bug. It can let an unauthenticated attacker execute code as the PHP web worker. Researchers demonstrated pre-authentication remote code execution on WordPress, Drupal and Joomla.
- CVE-2026-109619 involves stale global state that survives across requests. It can trigger a use-after-free that discloses worker memory or leads to code execution. Researchers showed pre-authentication RCE on WordPress and Drupal, plus remote memory disclosure that does not depend on any particular application.
The memory exposed can include passwords, authentication tokens, API keys and certificates belonging to other requests or to the server. According to the researchers, data can be stolen through memory disclosure without first achieving code execution, which can make the activity harder to spot with tools focused on malicious code.
WordPress, Drupal and Joomla were used only as representative targets. Exploitation does not require any of them. The research found affected releases going back to PHP 5.4, with nearly every PHP version affected by at least one of the issues before the fix.
AI did much of the heavy lifting
The research was carried out by Wiz Research, OpenAI Codex Security and Calif, working with the PHP security team and the Gemini team at Google. According to the report, Wiz used AI models including Gemini and GPT along with its own tooling to turn old, complex bugs into a working exploit. Calif reportedly found the same root cause using an OpenAI model as part of OpenAI’s Patch the Planet effort. Work that once required an elite team and months of effort was compressed into days.
Attack surface
PHP powers roughly 70% of websites, including WordPress, Drupal and MediaWiki, the software behind Wikipedia. A search on LeakIX returns close to 1.9 million exposed systems identified as running PHP. That does not mean all of them are vulnerable, but it gives a sense of scale.
Fixed versions
The first fixed releases per branch are:
- PHP 8.2.35
- PHP 8.3.36
- PHP 8.4.27
- PHP 8.5.12
After installing a fixed release, restart Apache, PHP-FPM and any long-running PHP workers. Updating WordPress or its plugins does not update the PHP runtime underneath. Downstream distributions will ship package updates through their usual channels.
If you cannot upgrade right away
Setting memory_limit = -1 can block some attack paths that rely on PHP’s memory-limit handling, but it hands memory exhaustion to the operating system, which may kill workers and hurt availability. If used, pair it with Linux cgroup v2 memory.max or an equivalent. Do not use RLIMIT_AS or RLIMIT_DATA as replacements, since the PHP advisory warns they can trigger the same vulnerable paths. This measure does not cover every variant.
The fix introduces a new hard memory limit. Reaching it terminates the process and prevents shutdown handlers from running, so teams should review the operational impact. Post-patch hardening suggestions include keeping post_max_size below the memory budget, limiting max_input_nesting_level, and optionally setting expose_php = 0.
Possible bypass vector
An October 23, 2026 update addressed a proof of concept circulating on GitHub and X. The vector requires an uncommon setup: session.serialize_handler set to php_binary or php_serialize, changed to php at runtime before session_start(), with session upload progress enabled. PHP recommends setting session.upload_progress.enabled = 0 until the next regular bugfix release. Applications that do not change the serialize handler at runtime are not affected, and the fixed releases remain required.
Key takeaways
- PHP2Shell affects the PHP engine itself, so patching applications or plugins is not enough.
- Upgrade to PHP 8.2.35, 8.3.36, 8.4.27 or 8.5.12 and restart all PHP workers.
- The flaws allow unauthenticated RCE and leakage of secrets from process memory.
- AI models played a major role in turning the bugs into practical exploits in days.


