← Blog

PHP2Shell: how to tell in five minutes if your PHP site is still exposed

· 5 min read · ES

On 21 October 2026 the PHP team released 8.5.12, 8.4.27, 8.3.36 and 8.2.35 with an unusual message on its site: two critical vulnerabilities that allow unauthenticated remote code execution, and a request to update immediately. The press named them PHP2Shell. Four weeks on, here is a sourced summary and a practical check for anyone who hasn’t reviewed it yet.

What was fixed

Two bugs in PHP core, not in WordPress or any plugin:

  • CVE-2026-109618, RCE via out-of-memory corruption. If a request runs out of memory at the wrong moment, the cleanup that follows can use uninitialized data. The advisory explains how multipart requests can force that state while staying within PHP’s apparent limits.
  • CVE-2026-109619, RCE via stale global state. Some internal state outlives the request that created it, and a later request on the same worker can use it after it has been freed.

PHP scores both at CVSS 4.0 9.2. Under CVSS 3.1, NVD gives the first 9.8 and the second 8.1. On 26 October CISA added both to its Known Exploited Vulnerabilities catalog, giving US federal agencies three days to act. Spain’s INCIBE-CERT rates them critical.

Who is really affected

According to php.net, every PHP installation serving web requests: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. Risk is highest on mod_php, where a demonstrated exploit fires before a single line of application code runs. For PHP-FPM, the first advisory says source analysis suggests it is susceptible, but no complete exploit has been demonstrated.

The “70% of websites” figure comes from W3Techs, which measures PHP on 68.1% of sites whose server-side language it can identify (as of 18 November 2026). That is not the same as 68.1% vulnerable: many of those sites sit on hosting that has already updated. The real risk is the small business running WordPress on a VPS someone set up years ago, the forgotten PHP 7 intranet, and the appliance with PHP inside that nobody remembers. PHP 8.1 and older no longer get official fixes; the PHP team has only published minimal source backports for 7.4, 8.0 and 8.1.

The five-minute check

1. Check the version the website runs, not the terminal. php -v may not match what Apache or FPM executes. In WordPress: Tools, Site Health, Info, Server section. Without a panel, upload a temporary v.php containing <?php echo PHP_VERSION;, open it in a browser, then delete it.

2. Compare against the fixed releases: 8.2.35, 8.3.36, 8.4.27, 8.5.12 or later. If you see 8.1 or below, you are out of support.

3. If you use distribution packages, the version number is not enough. Debian, Ubuntu and Red Hat backport fixes without bumping the main version. Look for the CVE in the package changelog:

apt-get changelog php8.2-fpm | grep -m1 CVE-2026-109618
rpm -q --changelog php-fpm | grep -m1 CVE-2026-109618

No match most likely means not patched; confirm it in your distribution’s security advisory.

4. Find out which SAPI you use. apache2ctl -M | grep -i php shows whether Apache loads mod_php. If you see php_module, you are in the highest-risk case.

5. On shared hosting, ask your provider whether their PHP builds include the 21 October fixes. It is a yes-or-no question.

If you have shell access, steps 1 to 4 plus the session.upload_progress check below are automated in php2shell-check, a read-only script I published for this: it reads versions, packages and configuration, and changes nothing. Read it before running it.

What to do

Update and restart every PHP process (systemctl restart php8.x-fpm or apache2). The PHP team is explicit that there is no complete mitigation other than updating. If you can’t today, their interim measures reduce exposure: session.upload_progress.enabled=0, a low post_max_size, and memory_limit=-1 set so the application cannot override it. Put them in php.ini, the FPM pool or the server config, never via ini_set() or a .user.ini, and restart the workers so they take effect. CISA and the FBI go further: if you can’t update, take the system offline until you can.

One detail that is easy to miss: on 23 October PHP published an informational advisory about a third RCE vector, CVE-2026-115560, unlikely in practice, to be fixed in the next release. Until then they recommend keeping session.upload_progress.enabled=0 even if you have already updated.

Then look for intrusions. CISA and the FBI recommend watching for PHP processes that spawn shells or download files. Updating closes the door, but it doesn’t remove anyone already inside: exploitation has been confirmed since 26 October.

The bug matters less than the clock

Wiz, one of the companies that found the flaws, says it used frontier AI models throughout the research, and that a single researcher did in a week what used to take a team months. Calif, which reported the first issue on 11 August, says it used no models beyond what is generally available to everyone.

Attackers have the same models. Amazon recorded an exploitation attempt on 17 October, four days before the patch, and proof-of-concept exploits hours before the embargo lifted. Its conclusion: AI-assisted analysis makes it cheaper to turn a patch into a working exploit, and patch timelines for critical internet-facing systems should be measured in hours, not days.

For years the rhythm was: patch ships, someone publishes a proof of concept days later, then mass exploitation starts. That buffer is disappearing. If your process for updating a public website depends on someone remembering on Monday, the problem isn’t PHP2Shell. It will be the next one.

Javier Morales, Staff Security Engineer

Found this useful? There's more

Get the free Detection Engineering Starter Kit: 3 production-ready detections, AI triage prompts and a detection-as-code workflow.

Or go deeper with the book: Securing Autonomous AI Agents — 17 chapters on locking down AI agents in production.

Kindle · $9.99 PDF/EPUB · $14.99