$0 PHP2Shell assessment findings in 3–5 days.

Claim Yours →
Blog›Gen AI in Modernization

PHP2Shell Explained: Affected Versions, Risks, and Fixes for the Critical PHP RCE Vulnerability

In This Article

TL;DR

  • Patch every PHP 8.2 to 8.5 server today, then restart every PHP worker. The fixed releases are 8.5.12, 8.4.27, 8.3.36, and 8.2.35. A running PHP process keeps the old code until it restarts.
  • Treat PHP 8.1 end of life systems and older as permanently exposed. These versions get no official PHP2Shell fix. AI tools will keep finding new flaws in them, and none of those flaws will get an official fix either.
  • Assume passwords and keys may have leaked. PHP2Shell can expose the contents of server memory. Review exposed servers from October 17 and change the credentials they hold.
  • Use firewall rules and PHP settings to buy time. They block known attack methods for traffic that passes through them, and the flaw itself stays in PHP.
  • Plan for PHP 8.2 now. Its security support ends on December 31, 2026.

What Is PHP2Shell?

PHP2Shell is the name for two critical vulnerabilities in the PHP engine itself, CVE-2026-109618 and CVE-2026-109619. In plain terms, they can let an attacker run their own code on a PHP server without logging in. Both were disclosed and patched on October 21, 2026 [1].

The fixes cover PHP 8.2 through 8.5. PHP 8.1 end of life systems and everything older have no official patch.

PHP powers 70% of the world’s websites, according to Wiz [2]. The disclosure landed on what TechCrunch called “a very bad cybersecurity day” for the internet [3].

The official response was blunt. The NSA advised organizations running PHP to update immediately or take their systems offline until they could, and Reuters reported government websites around the world going offline.

Which PHP Versions Are Affected by PHP2Shell, and Which Are Patched

Supported PHP versions got their fix on disclosure day. Here is where each version stands after the October 21 releases:

PHP versionPHP2Shell fix status
8.5, 8.4, 8.3, 8.2Fixed October 21, 2026, in 8.5.12, 8.4.27, 8.3.36, and 8.2.35
8.1, 8.0, 7.4No official release. The PHP project published code-level fixes for teams that build PHP themselves, and some Linux distributions and long-term support (LTS) vendors ship fixed packages
5.4 to 7.3End of life. No fix from the PHP project

PHP 8.1 end of life status means no official release is coming. The same holds for PHP 7.4 end of life systems and everything older.

That covers a lot of servers. Mallory scanned 2.6 million internet-facing services that report a PHP version and found 73.5%, about 1.9 million, on PHP 8.1 or older [4]. In the US, the share is 71%, about 495,000 of 699,000 services.

These counts use the version each server reports publicly. They show the scale of the problem without confirming that each server is vulnerable.

PHP 8.2 is next. Its end of life is December 31, 2026, and after that, it gets no more security fixes.

Which PHP versions can take the PHP2Shell fix and which cannot

What Attackers Can Do With PHP2Shell: Remote Code Execution and Memory Disclosure

The PHP security team rates both PHP2Shell CVEs 9.2 out of 10 on the CVSS v4.0 scale, in the critical range. Every version since PHP 5.4 is affected by at least one of them. The flaw gives an attacker two ways in:

  • Remote code execution: PHP remote code execution means an attacker can run code on the server without logging in. On Apache with mod_php, where PHP runs inside the web server itself, the attack works before any application code runs, on default settings.
  • Memory disclosure: An attacker can read the server’s PHP memory without taking over the server. This makes PHP2Shell a PHP information disclosure vulnerability as well.

That memory can hold passwords, login tokens, API keys, and certificates. A typical PHP application server holds credentials for:

  • Databases, including the customer and transaction data behind the application
  • Cloud accounts and storage
  • Payment systems
  • Partner integrations and third-party APIs

An attacker with those credentials can get into systems that never ran PHP. One exposed PHP server can become a problem for every system it connects to.

One leaked PHP process can expose credentials for systems that never ran PHP

The flaw is in PHP itself, the software that runs your application, so the quality of your own code makes no difference. Updating WordPress, Drupal, Laravel, or any other framework leaves the flaw in place. The fix is an updated version of PHP and a restart of every PHP worker.

How to Check If Your PHP Servers Are Vulnerable to PHP2Shell

A quick version scan misses five things. These are the checks I would hand to your platform team today:

  • Check the version serving web requests. Tracking PHP vulnerabilities by version only works if you know which version serves your traffic. The command-line PHP on a server can differ from the PHP that the web server loads.
  • Check how PHP connects to the web server. Every setup that serves web requests is affected, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP, and LiteSpeed. Apache with mod_php is the most exposed, so those servers go first.
  • Check patch status with your Linux distribution. Distributions such as Debian, Ubuntu, and Red Hat often fix PHP without changing its version number. Confirm against the distribution’s own advisory.
  • Find the PHP you don’t think of as PHP. Admin tools, hosting control panels, container images, build pipelines, and appliances such as firewalls that bundle their own PHP rarely appear in an application inventory.
  • Confirm restarts and rebuilds. A running PHP-FPM service or mod_php inside Apache keeps the old code in memory until it restarts. A container keeps it until it is replaced with a rebuilt image.

Any server you find on PHP 8.1 or older can’t take the official fix, so list it separately and treat it as exposed. To run the same exercise across a whole portfolio, a legacy system audit reviews end-of-life runtimes alongside code, data, and architecture.

Do WAF Rules and PHP Config Changes Stop PHP2Shell?

If you can’t patch a server today, these measures reduce its exposure. None of them removes the flaw, so here is what each one does and where it falls short:

StopgapWhat it doesWhere it falls short
Web application firewall (WAF) rules from major providersBlock known attack methodsCover only traffic that passes through the WAF, and may miss new variants
PHP configuration changes from the advisory: memory_limit=-1, session.upload_progress.enabled=0, and on PHP 8.5 only, fatal_error_backtraces=0. Set them in php.ini or the PHP-FPM pool, then restart every workerClose specific attack pathsLeave the installation unsafe
Moving from mod_php to PHP-FPM behind a proxyRemoves the most exposed setupThe vulnerable version of PHP stays in place
Isolating or taking the application offlineRemoves it from the internet, as the NSA advised for anything that can’t be patched immediatelyThe application is unavailable
Fixed packages from Linux distributions and LTS vendorsFix PHP2Shell on some end-of-life versionsBuy time against this flaw, with no promise for the next one

Two settings need care. memory_limit=-1 removes PHP’s memory limit, which is the advisory’s instruction.

Keep session.upload_progress.enabled=0 even after you update, until the next PHP release, because a related flaw, CVE-2026-115560, was disclosed on October 23. The advisory lists the full set of steps.

The WAF gap is the easiest to miss. If your server can also be reached directly, for example by its IP address, attackers can skip the WAF entirely. Check that before you count the WAF as protection.

How to Tell If Your Servers Were Compromised Through PHP2Shell

Amazon Threat Intelligence saw a first attack attempt on October 17, four days before disclosure, and more on October 21, apparently from several different attackers [5]. Amazon says it is unclear whether those attempts would have worked against real systems, and that PHP2Shell is now broadly exploited.

As of October 23, neither CVE was in CISA’s Known Exploited Vulnerabilities catalog [6], and no confirmed compromise had been published. Recheck both before you brief your board.

Start your review from October 17, the date of the first known attack attempt. Your application’s own logs may show very little, because the attack happens inside PHP before your application code runs. Check your web server and PHP logs, and look for these three warning signs:

  • Unusual file-upload requests followed by memory-limit errors or repeated HTTP 500 errors
  • Unexpectedly large or malformed session cookies (PHPSESSID) sent back by the server
  • PHP worker processes crashing and restarting with no clear cause

On each server, also look for web shells (files an attacker plants to control the server), new files in the website’s folders, new scheduled tasks, and unexpected user accounts.

Then change the passwords and keys on every exposed server, whatever the review finds. That is my recommendation. Patching stops new attacks, and it can’t take back credentials that were already read from memory.

Running PHP You Can’t Patch? Map What Else in Your Estate Is Exposed

Dependency Map
Risk Heatmap
Modernization Plan (3-5 Days)
MedtronicClairULAB Systems+more

How Was PHP2Shell Discovered?

PHP2Shell was found by researchers using frontier AI models. The published timeline shows the speed. The first flaw was found on August 19, and a working attack on a Drupal site, with no login needed, was confirmed the next day.

The researchers reported the issues to the PHP security team on August 24, and the fixes went public on October 21. Attackers were already testing the flaws by October 17.

These flaws had been in PHP for over a decade. Turning them into a working attack took several bugs used together and a lot of trial and error, which was hard to do by hand.

Frontier AI removed that barrier for researchers and attackers alike. By that account, one researcher did in a week what used to take a world-class team months.

The same research compares PHP2Shell to Heartbleed and Log4Shell, two of the most serious security flaws of the past decade, and says it aims to make AI-driven flaw hunting routine. More findings like this are coming, and each fix will reach supported software only.

Why PHP 8.1 End of Life Systems Stay Vulnerable After PHP2Shell

The risk on PHP 8.1 EOL servers outlasts the news cycle, for three reasons:

  • More variants exist. Other tracked, and likely untracked, variants sit in the PHP codebase. Only the patched release fixes the root cause.
  • Future fixes reach supported versions only. The AI tools that found PHP2Shell will keep finding flaws in older code. Supported versions will get the fixes, and unsupported ones will get only the findings.
  • Unpatched servers become the target. Once most servers are patched, attackers will focus on the ones that can’t be.

So the risk on these servers is permanent. An end-of-life date used to mean the end of updates. Now it also marks the point where every new flaw stays open.

Fixing these two flaws is also only one part of the gap. An end-of-life release carries every vulnerability disclosed since its last fix, and that backlog grows with each new finding. Moving to a current supported version clears it and keeps the server on the fix path for whatever comes next, which makes the upgrade more secure overall than any single patch.

Old, undocumented code used to be hard for attackers to study. As we have written before, AI can now read legacy code and surface its vulnerabilities, and PHP2Shell shows what that looks like at internet scale.

Attackers do use flaws in PHP itself, and CISA’s Known Exploited Vulnerabilities catalog already lists three.

Two of them, CVE-2019-11043, a PHP-FPM vulnerability, and CVE-2024-4577 in PHP-CGI, are known to have been used in ransomware campaigns. The third, CVE-2012-1823, is an older PHP-CGI flaw that CVE-2024-4577 later found a way around.

What Unpatched PHP Means for Audits, Cyber Insurance, and Disclosure

A critical flaw you can’t fix affects more than engineering. It shows up in three places:

An auditor and an insurer will ask about these servers in different terms. That is why our security assessment for US enterprises at Legacyleap separates compliance risk from active security risk, so each answer has its own record.

PHP2Shell Action Plan Before PHP 8.2 End of Life

Here is the order I would work in, from today through the PHP 8.2 deadline:

Today

  • Patch every PHP 8.2 to 8.5 server and restart every PHP worker.
  • For PHP 8.1 and older, ask your Linux distribution or LTS vendor for a fixed package.

First 72 Hours

  • List every PHP version serving requests, including the hidden ones above.
  • Apply the advisory’s configuration changes to anything still unpatched.
  • Isolate or take offline anything you can’t patch or protect.
  • Check whether any server can be reached around the WAF.
  • Start reviewing exposed servers from October 17.
  • Change credentials on internet-facing servers that ran an affected version. This is my recommendation.

First 30 Days

  • Finish the review.
  • Decide, application by application, whether to upgrade PHP or move off it.

Before PHP 8.2 End of Life on December 31, 2026

  • Move every PHP 8.2 system to PHP 8.3 or newer.
  • Have a funded plan and timeline for everything on PHP 8.1 and older.
PHP2Shell response plan from today through December 31, 2026

How to Permanently Fix PHP2Shell on Unsupported PHP Versions

I expect more days like October 21. A supported version of PHP is the only fix that holds up across them, because supported versions get the fix for this flaw and for the ones that follow it.

For older applications, that is rarely a simple upgrade. Each major PHP release removed features that old code depends on, and upgrading PHP usually means upgrading the framework too. With thin test coverage, nobody can prove the upgraded application still behaves the same. Legacyleap helps teams prove behavioral parity before and after a PHP upgrade through its legacy application modernization platform.

Years of deferred upgrades add up as technical debt in a legacy application. Moving an old application onto a supported version becomes a real project, and projects take longer than security deadlines allow, so the work needs to start now.

Legacyleap’s PHP migration services move US enterprises off unsupported PHP in one of two ways. We upgrade PHP and the framework together for Laravel, CodeIgniter, and Symfony applications, or we rearchitect the application onto Java or .NET. In both cases, the new version is tested against the old one before it ships.

An incremental modernization approach lets the riskiest internet-facing applications move first.

Find Out What Else in Your Estate Can’t Be Patched

Legacyleap, headquartered in Plano, Texas, runs a free Security Posture Assessment for US enterprises. It maps your legacy estate, surfaces unresolvable CVEs with a risk classification, and separates compliance risk from active security risk. Findings come back in 3 to 5 days, and the work runs entirely inside your infrastructure, with no source code leaving it.

FAQs

Q1. What is the difference between CVE-2026-109618 and CVE-2026-109619?

They are two separate memory bugs in the PHP engine. In CVE-2026-109618, running out of memory can stop PHP partway through setting up a request, and the cleanup step then treats the half-built data as valid. In CVE-2026-109619, data from one request survives after its memory is freed, and a later request on the same PHP worker can use it. The PHP security team rates both 9.2 out of 10 on CVSS v4.0. The same releases fix both, so one update covers them.

Q2. Does PHP2Shell affect Windows servers?

Yes, if they run an affected PHP version to serve web requests. The advisory covers every PHP installation that serves web requests, and the PHP project published fixed Windows builds alongside the other downloads. Install the updated Windows build and restart PHP, as you would on Linux.

Q3. Is PHP2Shell being actively exploited in the wild?

Attacks are widespread. Amazon calls PHP2Shell broadly exploited, and Imperva counted 482,342 attack requests against 21,998 sites in 103 countries in the first 24 hours. As of October 24, no one had published a confirmed compromise, and as of October 23, neither CVE was in CISA’s Known Exploited Vulnerabilities catalog.

Q4. Do cloud providers like AWS, Azure, or Cloudflare automatically protect against PHP2Shell?

Only in part. Cloudflare deployed WAF rules for the known attack methods to all customers, including free plans. It called them a stopgap only, and they cover only traffic that passes through Cloudflare. AWS published WAF guidance and says no configuration-only workaround fully fixes both flaws. Managed platforms such as AWS Elastic Beanstalk and Azure App Service on Linux updated their built-in PHP images. Custom containers, virtual machines, and servers you run yourself still need you to update PHP.

Q5. Does PHP2Shell affect PHP running in Docker containers?

Yes. A container runs whatever PHP version is in its image. The official Docker php image has been updated, and a running container keeps the old PHP until you rebuild the image and redeploy. Don’t rely on a container scan alone. Mallory found that Trivy reported the same result for vulnerable and fixed official php images. Check the version with php -v inside the running container.

References

[1] PHP security advisory, October 21, 2026.

[2] Wiz Research, “PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet”.

[3] TechCrunch, “The internet is having a very bad cybersecurity day,” October 21, 2026.

[4] Mallory, “PHP2Shell CVE-2026-109618 CVE-2026-109619: Am I affected?”.

[5] Amazon Threat Intelligence, PHP2Shell exploitation prior to public disclosure.

[6] Tenable, PHP2Shell FAQ.

Book a $0 Assessment

We will scan a portion of your legacy codebase and share documentation, architecture maps, dependency graphs, in 3-5 days.

Book a Time

Book a $0 PHP Assessment

We will scan a portion of your PHP codebase and share documentation, a risk and complexity heatmap, and recommended targets, in 3-5 days.

Book a $0 PHP Assessment

Upgrade PHP or Rearchitect?

A $0 assessment sorts your PHP applications by risk and complexity and recommends a path for each, in 3-5 days.

Book a $0 PHP Assessment
Get modernization updates in your Google feed
Share the Blog

Latest Blogs

GitHub Copilot Alternative for Legacy Modernization

GitHub Copilot vs. Legacyleap for Legacy Modernization

NYDFS Part 500 MFA Requirements for Legacy Applications

NYDFS Part 500 MFA Requirements for Legacy Applications: Compensating Controls and the 500.13 Asset Inventory

PCI DSS 4.0 Compliance for Legacy Applications

PCI DSS 4.0 Compliance for Legacy Applications: Requirement 12.3.4 and Your Remediation Plan

Top PHP Migration Companies in the United States 2026

Top 8 PHP Migration Companies in the United States (2026)

How to Convert Oracle Forms to a Modern Web Application

How to Convert Oracle Forms to a Modern Web Application

Migrate Oracle Forms to Java, .NET or APEX: How to Choose

Migrate Oracle Forms to Java, .NET or APEX: How to Choose and What It Takes

Technical Demo

Book a Technical Demo

Explore how Legacyleap’s Gen AI agents analyze, refactor, and modernize your legacy applications, at unparalleled velocity.

Watch how Legacyleap’s Gen AI agents modernize legacy apps ~50-70% faster

Want an Application Modernization Cost Estimate?

Get a detailed and personalized cost estimate based on your unique application portfolio and business goals.