PHP2Shell Patched? Why Upgrading PHP Alone Won't Keep Webshells Out: A 7-Step Hardening Checklist

Cyber · 2026-11-20 · By H.A

PHP2Shell Patched? Why Upgrading PHP Alone Won't Keep Webshells Out: A 7-Step Hardening Checklist

Upgrading PHP is the only real fix for PHP2Shell (CVE-2026-109618/109619), but it won't remove shells planted before the patch or stop the next one: patch, hunt, lock down uploads and harden PHP.

Why this still matters

A month after PHP shipped emergency fixes for PHP2Shell, many web servers are still exposed. The two flaws, CVE-2026-109618 ("RCE via OOM corruption") and CVE-2026-109619 ("RCE via stale global state"), are each rated CVSS v4.0 9.2 and let an attacker run code on a PHP server without logging in. The PHP project released the fixes on 21 October 2026 at 18:00 Mauritius time (14:00 UTC). Exploitation in the wild was reported the same day, and CISA added both CVEs to its Known Exploited Vulnerabilities catalogue on 26 October 2026.

We covered the flaws, and how attackers used them against firewalls and gateways, in earlier articles. This one answers the question many administrators are now asking: is upgrading PHP enough?

The short answer:

Here is a practical checklist that covers both.

Step 1: Patch PHP properly

The minimum versions that fix PHP2Shell are 8.5.12, 8.4.27, 8.3.36 and 8.2.35. On 19 November 2026 PHP released 8.5.13, 8.4.28, 8.3.37 and 8.2.36 as further security releases. They fix several more session-handling flaws that can lead to remote code execution, including CVE-2026-115560, which PHP flagged in its 23 October advisory. Go straight to the 19 November versions.

Step 2: Temporary measures if you cannot patch today

These only lower the risk. The PHP project is clear that they are not a fix.

Step 3: Check whether you were already hit

Exploitation started before most servers were patched, so assume anything exposed before your upgrade may have been touched. Upgrading does not remove a webshell. Look for:

If you find something, treat the server as compromised. Isolate it, keep copies of the evidence, rotate every password, API key and database credential the site uses, and rebuild from a clean source rather than just deleting the file you found.

Step 4: Lock down upload folders

PHP2Shell is an engine bug, but most webshells, from this campaign or any other, survive because uploaded or dropped .php files can be listed and run from a public folder. Closing that path protects you against the next flaw too.

Step 5: Harden PHP itself

Step 6: Secure coding habits that block webshells

Step 7: Defence in depth

The bottom line

Upgrading PHP is required, and it is the only real fix for PHP2Shell. But it is only the first step. Patch to the latest release and restart every worker. Then check that nobody got in before you patched. Finally, lock down uploads and PHP settings so the next engine bug or code mistake does not end with a shell on your server.

Sources

REEF SENTINEL