Skip to main content
Web Security·11 min read(2,142 words)·Published 2026-10-21

PHP2Shell (CVE-2026-109618 and CVE-2026-109619): How to Patch, Mitigate and Detect Attacks

Two critical PHP flaws allow unauthenticated remote code execution. See who is affected, the fixed versions, temporary mitigations and what to watch for in your logs.

10 core sections·Technical reading pace: ~200 WPM

On 21 October 2026 the PHP project shipped emergency releases for two critical flaws in the PHP runtime itself: CVE-2026-109618 and CVE-2026-109619, nicknamed PHP2Shell. Both are rated 9.2 (Critical) under CVSS v4.0, and both can lead to remote code execution without a login (PHP.net advisory).

PHP runs a large share of the web, including most WordPress, Drupal, Joomla, Magento and Laravel sites. That makes this a priority patch for any small business with a website, any agency that manages client sites, and any admin who runs PHP on a server.

This guide explains what the two flaws are, who is affected, how to patch, what to do when you cannot patch today, and what signs of attack to look for.

What Is PHP2Shell?

PHP2Shell is the name used for two related memory-safety flaws in the core PHP runtime. They sit below your application code, so a fully updated CMS or framework does not protect you on its own. The PHP security team describes them in two advisories:

  • CVE-2026-109618, "RCE via OOM corruption": if PHP runs out of memory while it is still setting up a request, the request data is only partly initialized. Cleanup can then treat that invalid data as valid (GHSA-w8hw-w9fx-j79w).
  • CVE-2026-109619, "RCE via stale global state": internal state owned by one request can survive after its memory is freed. A later request on the same worker may then use that stale state (GHSA-6wmf-4rv5-p3rp).

Both advisories list the weakness as use after free (CWE-416), and both carry the CVSS v4.0 vector AV:N/AC:H/AT:P/PR:N/UI:N with high impact to confidentiality, integrity and availability. In plain terms: an attacker needs only network access, no account and no user action. PHP says the confirmed impact of CVE-2026-109619 is heap use after free, memory disclosure and remote code execution with the web worker's privileges.

PHP says it validated complete remote code execution over HTTP against Apache mod_php with default input and memory limits and a normal multi-worker prefork setup (PHP advisory). Help Net Security reports that a working exploit showed a single unauthenticated request can trigger the attack before any application code runs (Help Net Security).

The flaws were reported to PHP by several researchers, including Wiz Research, which disclosed them together with the PHP project (Google Cloud).

Who Is Affected

Warning

Older versions: the official advisories list only the supported 8.2 to 8.5 branches. Google Cloud says all versions from PHP 5.4 through 8.5.11 are vulnerable, and watchTowr says PHP 5, 7 and 8 are affected. Treat any end-of-life PHP as exposed until your vendor says otherwise.

According to Help Net Security and Huntress, which cite the PHP project, every PHP installation that serves web requests is affected. That includes PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed (Help Net Security, Huntress).

The official advisories list these supported branches as affected:

PHP branchAffectedFixed versionNotes
8.5Below 8.5.128.5.12Also set fatal_error_backtraces=0 if you must delay the update
8.4Below 8.4.278.4.27Supported branch
8.3Below 8.3.368.3.36Supported branch
8.2Below 8.2.358.2.35Security support ends 31 December 2026
8.1, 8.0, 7.4Reported affectedNo official releaseMinimal source backports from PHP, or fixes from your distribution or LTS vendor
5.x to 7.3Reported affectedNone from PHPEnd of life: upgrade or isolate from the internet

Timeline: From Leak to Patch

The disclosure did not go to plan. On 20 October 2026 the CVE identifiers circulated on Hacker News and social media before the planned release, according to Tenable. watchTowr confirmed the leak and said the embargo had been set for Thursday, 22 October (Tenable, Huntress).

PHP then published an advance notice and released PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 on 21 October 2026. The CVEs were assigned the same day (PHP.net, Google Cloud).

Help Net Security reports that Linux distributions and LTS vendors received patches before publication, so check your distribution's security feed as well as php.net.

Is PHP2Shell Being Exploited?

Reports on 21 October differ, so plan as if attacks have started:

  • watchTowr says it observed exploitation in the wild as of 21 October through its global honeypot network (watchTowr).
  • Tenable reports that Cloudflare is "seeing early attacks emerging," and that code claiming to exploit the flaws is circulating publicly, though Tenable had not verified it (Tenable).
  • Huntress said it had not yet seen exploitation across its partner base as of 10am ET on 21 October (Huntress).

At the time of writing, watchTowr lists CVE-2026-109618 as not yet in the CISA Known Exploited Vulnerabilities catalog. You can check the latest status for both CVEs in the CVE Search tool.

Exposure is large. Tenable cites an estimate of over 1.3 million internet-exposed hosts that are potentially vulnerable, and W3Techs data showing PHP behind 69.3% of websites whose server-side language is known (Tenable).

How to Check Your PHP Version

You cannot patch what you have not found. Check every server, container image and hosting account that runs PHP, including staging sites and forgotten microsites.

  • On a server: run php -v on the command line. Also check the version the web server actually uses, because the command-line PHP can differ from the PHP-FPM or Apache module version.
  • On WordPress: go to Tools, then Site Health, then the Info tab, and open the Server section to see the PHP version.
  • On shared or managed hosting: look in your hosting control panel, or ask your host's support team directly whether they have deployed the 21 October PHP updates.
  • In containers: check the PHP version in each image and rebuild from a patched base image. Google Cloud notes that custom images, GKE and App Engine flexible need a redeploy with patched PHP (Google Cloud).
  • From outside: some servers announce their PHP version in an X-Powered-By header. Our Security Header Analyzer shows the headers your site sends. A missing header does not prove you are safe.
Check the PHP version on a Linux server (command-line and FPM binaries can differ)
php -v
# If you run PHP-FPM, check the FPM binary too (name varies by distribution)
php-fpm -v 2>/dev/null || php-fpm8.3 -v 2>/dev/null

How to Patch PHP2Shell

PHP is clear that updating is the only complete fix. The release notes for PHP 8.5.12 say: "There are no complete mitigations, updating is the only safe choice" (PHP.net).

  • Supported branches: update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 through your operating system's package manager, your PHP repository, or the official PHP downloads page. Windows builds are available there too.
  • Restart every PHP worker after the update. A PHP-FPM pool or Apache process that keeps running still uses the old code in memory.
  • PHP 7.4, 8.0 and 8.1: PHP provided minimal source backports for people building from source or without an LTS vendor. Otherwise, ask your distribution or LTS vendor for a fix, or upgrade to a supported branch.
  • PHP 7.3 and older: there is no fix from PHP. Plan an upgrade and, until then, take the site off the public internet or place it behind a VPN or web application firewall (WAF), as Huntress advises.
  • Hosted sites: if your host manages PHP, ask them for written confirmation of the patched version and the date it was deployed.
  • Plan ahead: PHP 8.2 receives security fixes only until 31 December 2026, so schedule your move to 8.3 or newer now.

Note that one community repository, rpms.remirepo.net, had no updates on release day, according to Help Net Security. If you rely on a third-party repository, confirm the version it installs before you mark the job done.

Temporary Mitigations If You Cannot Patch Today

Warning

Test these changes on staging first. Lower upload limits and disabled upload progress can break file uploads, and PHP pairs memory_limit=-1 with a container or cgroup memory limit.

If an update has to wait for a change window, PHP lists measures that reduce exposure. PHP stresses that they "do not make an installation safe." Set them in php.ini, the FPM pool or the server configuration, then restart every worker. Do not rely on ini_set() or FPM .user.ini files.

For CVE-2026-109618 (out-of-memory corruption), the PHP advisory suggests:

  • Set memory_limit=-1 in a way applications cannot override, such as php_admin_value in the FPM pool or Apache configuration, and pair it with a container or cgroup memory limit that kills only the affected worker. Do not use RLIMIT_AS or RLIMIT_DATA.
  • Lower post_max_size to 8M if you do not need uploads, or 32M if you do, and keep upload_max_filesize below it.
  • Enforce limits at the web server or proxy on request size, input field count, multipart parts, header count and nesting depth, including for requests without a usable Content-Length.
  • Reduce max_input_nesting_level, and block multipart form data at the front end if your application does not use it.
  • For CVE-2026-109619 (stale global state): set session.upload_progress.enabled=0. On PHP 8.5, also set fatal_error_backtraces=0. Consider pm.max_requests=1 for PHP-FPM if performance allows. PHP says there is no complete generic configuration mitigation for this flaw.

Network controls help too. CERT-EU suggests isolating internet-facing applications until they are fixed, and the UK NCSC urges organizations to consider taking offline any system that cannot be fixed right away (Tenable, Help Net Security). Cloudflare has deployed an initial set of WAF rules for the known exploit vectors, but describes them as a stopgap only.

Exposure-reducing settings from the PHP advisories (not a fix; restart all workers after changing)
; php.ini or FPM pool (use php_admin_value in pools so apps cannot override)
session.upload_progress.enabled = 0
post_max_size = 8M          ; 32M if you need uploads
upload_max_filesize = 6M    ; keep below post_max_size
; PHP 8.5 only:
fatal_error_backtraces = 0

How to Detect Exploitation Attempts

At the time of writing, Huntress says no indicators of compromise have been confirmed. Its advice, based on Florian Roth's expectation, is that exploitation will most likely show up as suspicious child processes started by PHP (Huntress). Watch for:

  • Parent processes php-fpm, php-cgi, php-cgi.exe, httpd or apache2 starting sh, bash, cmd.exe, powershell.exe, python, perl, curl, wget, nc or certutil.exe.
  • Command lines that contain /dev/tcp/, fsockopen or mkfifo, which often point to a reverse shell.
  • Reconnaissance commands run by the web server user, such as whoami, id, uname -a or ipconfig.
  • New or changed PHP files in the web root, which may be web shells, plus new cron jobs, scheduled tasks or user accounts.

Huntress points to Florian Roth's process-watcher in observe mode as one way to spot this, and says it will publish Sigma and YARA rules once technical details are available. Vulnerability scanners are adding checks too: Tenable notes its PHP version detection plugins can find hosts to review now.

Preserve your web server and PHP logs before you rotate or clean anything. If you find signs of compromise, patching alone is not enough: treat the server as compromised and follow an incident response process.

Quick Linux checks after patching: shells under PHP and recently changed PHP files
# Processes whose parent is a PHP or Apache worker
ps -eo pid,ppid,user,cmd --forest | grep -A3 -E "php-fpm|php-cgi|apache2|httpd"

# PHP files changed in the last 3 days under the web root (adjust the path)
find /var/www -name "*.php" -mtime -3 -ls

Checklist for Small Business Owners and Site Admins

If you only have a few minutes, work through this list in order:

  • List every website, staging site and server you own that runs PHP, including ones an agency or freelancer built for you.
  • Check each PHP version and compare it with the fixed versions: 8.5.12, 8.4.27, 8.3.36 and 8.2.35.
  • Update PHP, or ask your host to confirm they have, and restart all PHP workers.
  • If you are on PHP 8.1 or older, ask your vendor for a backported fix and book an upgrade to a supported branch.
  • If you cannot patch today, apply the PHP mitigations, restrict access with a VPN or WAF, or take the site offline.
  • Review logs and processes for the warning signs above, and keep the logs.
  • Make sure you have a recent, offline backup of each site before and after the change.

For more ways to harden a website, browse our web security guides, and follow updates on this story in our daily cybersecurity news briefing.

Final Thoughts: Patch First, Then Verify

PHP2Shell is serious because it lives in the language runtime that so much of the web depends on, it needs no login, and its details leaked before defenders had a head start. The good news is that the fix is simple for supported versions: update PHP and restart the workers.

Patch today, confirm the running version on every site, and then spend a few minutes checking for signs that someone got in first. That short routine closes the door and tells you whether anyone walked through it.

Frequently Asked Questions

What is PHP2Shell?+

PHP2Shell is the name for two critical flaws in the core PHP runtime, CVE-2026-109618 and CVE-2026-109619. Both are rated 9.2 under CVSS v4.0 and can lead to remote code execution without authentication.

Which PHP versions fix CVE-2026-109618 and CVE-2026-109619?+

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, all released on 21 October 2026. PHP 8.1 and older get no official release, but PHP published minimal source backports for 7.4, 8.0 and 8.1.

Is my WordPress site affected by PHP2Shell?+

The flaws are in PHP itself, not in WordPress, so any WordPress site running an unpatched PHP version that serves web requests is in scope. Check your PHP version under Tools, Site Health, Info, Server, and ask your host to confirm the update.

Can I fix PHP2Shell by changing php.ini settings?+

No. PHP says updating is the only complete fix. Settings such as session.upload_progress.enabled=0 and a lower post_max_size only reduce exposure while you schedule the update.

Is PHP2Shell being exploited in the wild?+

watchTowr reports exploitation in its honeypots as of 21 October 2026, and Cloudflare reports early attacks. Huntress had not seen exploitation in its own customer base at that time. Treat it as actively targeted.

Does PHP-FPM or Nginx protect me?+

No. PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed are all listed as affected. Complete remote code execution has been shown against mod_php, and PHP calls FPM susceptible.

What should I do if I run PHP 7 or PHP 5?+

Ask your distribution or LTS vendor whether they offer a fix, or build PHP 7.4 from the PHP source backport. For older versions there is no fix, so upgrade and keep the site off the public internet or behind a VPN or WAF until then.

How do I know if my server was already attacked?+

Look for shells, downloaders or reconnaissance commands started by PHP or web server processes, new PHP files in the web root, and new cron jobs or accounts. If you find any, treat the server as compromised and start incident response.

References & Further Reading

GuideWeb Security
The eMudhra TLS Certificate Compromise Explained: What Happened, Who Is at Risk and What to Do
Eight eMudhra intermediate certificates were issued with private keys anyone can recover. Learn what that means, who is still exposed and the updates to install now.
Read more
GuideWeb Security
How to Protect Your Projects From Malicious npm Packages (and What GitHub's New Package Firewall Does)
GitHub launched a package firewall that blocks risky npm packages before they install. Learn how it works, who can use it and 10 steps any team can take today.
Read more
GuideWeb Security
How to Prevent a DDoS Attack (Step-by-Step Guide for 2026)
Protect your website infrastructure from crashing. Learn the 6 best defensive measures to block malicious traffic, implement rate limiting, and stop DDoS attacks before they cost you revenue.
Read more
GuideWeb Security
How to Check Security Headers of a Website
Learn how to check security headers of a website using browser developer tools and terminal commands to defend against clickjacking, XSS, and MIME sniffing.
Read more
ReviewSoftware & Services
Security Onion Review: Network Security Monitoring and Threat Hunting
An in-depth review of Security Onion, evaluating its network monitoring, host visibility, detection engines, management console, and deployment value.
Read more
News2026-11-11
Cybersecurity News Briefing: November 11, 2026
Today’s briefing highlights a surge in high‑impact exploits and supply‑chain breaches. Microsoft’s November Patch Tuesday delivers updates for 1,235 flaws, including a zero‑day in Outlook that demands immediate installation. Parallel incidents involve remote‑code execution in SGLang, authentication bypasses in AhsayCBS, and phishing campaigns delivering RATs across Latin America. State‑linked groups continue targeting government Exchange servers and critical infrastructure. Prioritize applying Microsoft’s patches without delay.
Read more