PHP has shipped emergency security updates to fix two critical vulnerabilities in the language runtime. Together, the researchers call them PHP2Shell. The flaws let an unauthenticated attacker execute code on a web server, and exploitation attempts started before many organizations could even download the fix.

The PHP team released patched versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35 on October 21, 2026. It states clearly that updating is the only complete protection.

Why PHP2Shell Is Different

Most web vulnerabilities live inside a specific application, plugin, or framework. PHP2Shell does not. Instead, the flaws sit in the PHP engine that runs beneath those applications. As a result, a website with perfectly written code is still exposed if it runs on a vulnerable PHP version. Even a basic “Hello World” page can become an entry point.

The scope is also unusually wide. The flaws affect almost every PHP version back to PHP 5.4, which means the vulnerable code has lived in the language for more than a decade. Considering how much of the web runs on PHP, the potential attack surface is enormous.

Both vulnerabilities carry a CVSS v4.0 score of 9.2:

  • CVE-2026-109618 stems from an out-of-memory condition in the PHP engine.
  • CVE-2026-109619 involves session handling, including the session upload progress feature, which PHP enables by default.

Who Is at Risk

Every PHP installation that serves web requests is in scope. That includes PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed.

However, the risk is not identical across setups. Servers running Apache’s mod_php face the highest danger. Researchers demonstrated that a single unauthenticated request can trigger the attack there before any application code runs.

PHP-FPM behaves somewhat differently, because it shuts down a worker when a request fails early in setup. For CVE-2026-109618, PHP’s analysis indicates that FPM is susceptible, although no one has shown a complete FPM exploit yet. For CVE-2026-109619, researchers reached code execution on both mod_php and PHP-FPM. On FPM, however, that path depends on a specific operation inside the running application.

Code execution is not the only concern. Attackers can also read memory from the PHP worker process without first taking control of the server. That memory may hold passwords, session tokens, API keys and certificates that belong to other users’ requests. Researchers demonstrated this against applications they did not control, so the leak does not depend on what software runs on top of PHP.

What to Patch

Organizations must update the PHP runtime itself and then restart Apache, PHP-FPM and any long-running PHP workers. Notably, updating WordPress, Laravel, Drupal or any other application does not update PHP. The runtime comes from the server package, the hosting provider, or the container image.

PHP BranchVulnerable VersionsFirst Fixed Version
8.5Below 8.5.128.5.12
8.4Below 8.4.278.4.27
8.3Below 8.3.368.3.36
8.2Below 8.2.358.2.35

The PHP project no longer maintains PHP 8.1 and older, and PHP 8.2 reaches end of life on December 31, 2026. Nevertheless, the PHP security team has published source backports for PHP 7.4, 8.0 and 8.1 to support teams that build from source or are waiting on a vendor.

Additionally, Linux distributions and long-term-support vendors received the patches in advance. Therefore, a distribution package may contain the fix even if its version number looks old. Administrators should check the package changelog for the CVE identifiers rather than relying on the version string alone.

Temporary Measures If You Cannot Update Yet

PHP stresses that the following steps only reduce exposure to specific attack paths. They do not make a server safe.

For CVE-2026-109618:

  • Set memory_limit=-1 so applications cannot override it.
  • Keep post_max_size low.
  • Enforce request-size limits at the web server or reverse proxy.
  • Avoid using RLIMIT_AS or RLIMIT_DATA as a substitute, because they can trigger the same vulnerable path.

For CVE-2026-109619:

  • Set session.upload_progress.enabled=0 and restart every worker.
  • On PHP 8.5, also set fatal_error_backtraces=0.

Teams should treat the session upload progress workaround with caution. It circulated widely before the patch, yet it only blocks the confirmed session-based paths for CVE-2026-109619. It does nothing for CVE-2026-109618. PHP’s core developers were blunt on this point: patching is the only real mitigation.

After You Patch

The fix introduces a new hard memory limit. When a process hits it, PHP terminates the process and skips shutdown handlers. Consequently, teams should review memory_limit and post_max_size against what their applications actually need, so the patch does not cause unexpected failures.

If you suspect compromise before patching, watch for these warning signs:

  • Unusual multipart requests followed by memory-limit errors or repeated HTTP 500 responses
  • Abnormally large PHPSESSID cookies in server responses
  • Unexplained restarts of PHP workers

Is PHP2Shell Being Exploited?

Attackers moved fast. Before the patch even shipped, Cloudflare reported early exploitation attempts and deployed firewall rules by default as a stopgap. Meanwhile, it watched attackers modify their payloads to bypass those rules. Security firm watchTowr initially reported no exploitation, but later on October 21 it confirmed active exploitation attempts against both vulnerabilities.

So far, no source has confirmed a successful break-in of a specific server. Even so, the threat felt real enough that several organizations took systems offline as a precaution. HR platform BambooHR suspended its service across the United States, Canada and Ireland and warned of payroll disruption. In the Netherlands, several government portals, the parliament’s website, the national cybersecurity centre and multiple education systems went offline temporarily.

A Disclosure That Fell Apart

Researchers from Wiz, Calif and OpenAI’s Codex Security team found and reported the flaws, while the PHP security team and Google’s Gemini team worked on the fix. They planned a coordinated disclosure for October 22. However, that plan unraveled.

On October 20, a public post leaked the CVE identifiers and the planned disclosure date. That same evening, a researcher mistakenly published a video of a working proof of concept. Then, roughly six hours before the official release, a vendor published container images that already contained the patch, which let anyone study the fix early. As a result, PHP pulled the release forward to October 21.

The PHP Foundation also acknowledged that the problem was not entirely new. A core developer spotted early signs of the out-of-memory flaw during an external audit in 2024. At the time, however, no one found a concrete route to code execution. Competing fixes risked breaking compatibility or creating new problems, and the small team could not agree on an approach. The Foundation called the resulting delay a structural failure of its decision process and resources, and says it has since added staff, tooling and a new decision model.

The AI Factor

This case also signals a shift in how vulnerabilities get weaponized. The researchers say AI models helped turn long-standing, obscure flaws into working exploits. According to them, one researcher achieved in about a week what would otherwise have taken a team months.

That said, human expertise still mattered. The bug traces back to PHP research from 2004, and the researchers note that current AI models do not reliably uncover such old, obscure primitives on their own. Even so, the direction is clear: the window between disclosure and exploitation is shrinking, and defenders must move faster.

What This Means for Organizations in the UAE and GCC

Across the region, PHP powers a large share of corporate websites, customer portals, e-commerce platforms and government-facing services. Many of these run on shared hosting, managed platforms or containers, where the PHP version is easy to overlook. Therefore, security leaders should act on three priorities:

  1. Build an accurate inventory. Identify every system running PHP, including those managed by hosting providers, agencies and third-party vendors.
  2. Patch the runtime, not just the application. Confirm with each provider that the PHP engine itself is updated and that workers have restarted.
  3. Hunt for early compromise. Because exploitation attempts began before the patch, review logs for the warning signs above, and rotate credentials and API keys on exposed systems where you find suspicious activity.

PHP2Shell is a reminder that secure code alone cannot protect an organization when the foundation beneath it is vulnerable. Visibility across the full technology stack, including the parts that third parties manage, is now a core part of cyber resilience.