Key Takeaways

  • What: two critical PHP vulnerabilities (CVE-2026-109618 / CVE-2026-109619) allow unauthenticated remote code execution.
  • Who's affected: almost every PHP version since 5.4, on PHP-FPM, Apache (mod_php), php-cgi, FrankenPHP and LiteSpeed. mod_php is highest risk.
  • Urgency: details leaked before the patch, a working exploit is public, and Japan's government has urged operators to act now.
  • Fix: upgrade to 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Until then, set session.upload_progress.enabled=0.
  • No patch coming: PHP 8.1 and earlier are end-of-life. That's almost half of PHP sites.
  • Rein customers: already protected at runtime, patched or not.

PHP2Shell is two critical vulnerabilities in PHP itself (CVE-2026-109618 / CVE-2026-109619) that let attackers run code on a web server remotely, without logging in. On October 21, 2026, Prime Minister Takaichi and Japan’s National Cybersecurity Office called on every operator of a PHP website to act urgently. We agree: this is one of the most serious vulnerabilities in recent years.

Almost every PHP version since 5.4 is affected, across every way PHP serves web requests: PHP-FPM, Apache (mod_php), php-cgi, FrankenPHP and LiteSpeed. Details leaked before the patch was released, so attackers had a head start. And almost half of PHP sites run versions that will never get a patch.

How the PHP2Shell Exploit Enables Unauthenticated RCE

The public proof-of-concept turns PHP session data into an object-injection attack in two HTTP requests. It’s a logic flaw in how PHP decodes sessions, not memory corruption, so it runs the same way every time.

  1. Seed. The attacker sends a crafted file upload with a session ID they chose. PHP’s upload-progress feature (on by default) writes attacker-controlled data into that session.
  2. Trigger. The attacker calls a second endpoint that reads the same session with a different serialization format. PHP misparses the stored data and deserializes an object the attacker injected.
  3. Execute. When that object is destroyed, its destructor runs attacker-chosen code. The command output comes back in the HTTP response.

According to the author’s notes, the attack needs a few conditions to line up: strict session mode off, upload-progress cleanup off, two parts of the app using different session serializers, and a usable “gadget” class loaded when the session starts. These settings are common in older and sprawling PHP estates. The PoC was verified on PHP 8.2.34 and 8.5.11.

Why PHP2Shell Is More Dangerous Than Typical PHP Vulnerabilities

Three things together make PHP2Shell worse than the usual web CVE:

  • No authentication. Both requests are ordinary HTTP. The attacker picks the session ID, so no login or stolen cookie is needed.
  • It’s in the runtime. Your code can be clean and still be exploitable. Every server setup that runs PHP for the web is in scope, and mod_php is considered the highest risk.
  • It goes back more than a decade. Almost every version since PHP 5.4 is affected.
  • Much of PHP will never be fixed. PHP 8.1 and earlier are end-of-life and won’t get a patch, and almost half of PHP sites run those versions.

Why PHP2Shell Requires Immediate Patching and Mitigation

The details leaked before the patch was released, and a working exploit is public. The time between disclosure and attacks is effectively zero. Attackers can scan for exposed PHP apps today.

Fixed versions are out for supported branches, but the usual playbook (test the patch, schedule the rollout) assumes you have weeks. With PHP2Shell you don’t. For sites on PHP 8.1 or earlier, there’s no patch at all, and a major-version upgrade of a legacy app can take months.

How Rein Security Blocks PHP2Shell Attacks at Runtime

Rein Security customers are already protected. Rein sees how your code actually executes, so it stops the exploit at runtime, whether or not a patch exists.

That matters here because PHP2Shell looks harmless at the network edge: a file upload, then a normal page request. The danger only shows up inside the application, when a session decode builds an object nobody’s code asked for and its destructor reaches for a shell. Rein watches that execution path and blocks the attack before the command runs. Customers stay protected until patching is done, and on versions that will never be patched.

How to Mitigate PHP2Shell Vulnerabilities and Protect PHP Servers

  1. Check whether your public websites use PHP. Inventory every app, its PHP version and how it’s served. Prioritize mod_php.
  2. Patch now. Upgrade to the fixed versions: 8.5.12, 8.4.27, 8.3.36 or 8.2.35.
  3. If you can’t patch right away, disable upload progress. Set session.upload_progress.enabled=0 and restart all workers. This is a temporary mitigation for CVE-2026-109619.
  4. Decide what to do with end-of-life PHP. PHP 8.1 and earlier won’t get a patch. As Japan’s National Cybersecurity Office advises, temporarily taking the site offline is a valid option.
  5. Harden sessions. Turn on session.use_strict_mode, and don’t mix session serialization handlers across parts of an app that share a session store.
  6. Watch for signs of attack. Look for odd multipart uploads that carry session fields, and for PHP workers spawning shells.

Rein customers: you’re already protected, and you stay protected until patching is done.

Everyone in Japan: if patching is hard or you don’t know your exposure, contact us. Rein will help for free.

And to all the engineers working late into the night on this: thank you.

Sources

FAQs

  • If any public website you run uses PHP 5.4 or later and hasn’t been upgraded to a fixed version, assume yes. Every common way of serving PHP is in scope.

  • No. The attack uses two ordinary HTTP requests, and the attacker supplies their own session ID.

  • PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35.

  • No. Those versions are end-of-life. Your options are upgrading to a supported branch, runtime protection, or temporarily taking the site offline.

  • Set session.upload_progress.enabled=0 and restart all PHP workers. This temporarily mitigates CVE-2026-109619. Also turn on session.use_strict_mode.

  • Not reliably. The requests look like a normal file upload and a normal page load. The malicious part only appears when PHP decodes the session inside the application.

  • Rein sees how code actually executes. It blocks the attack at runtime, when the injected object tries to run commands, whether or not PHP is patched.

  • Yes. If patching is hard or you don’t know your exposure, contact us. In Japan, Rein will help for free.