Guide · checked 30 October 2026

Old PHP was always a risk. Now the holes are found faster.

On 21 October 2026, PHP fixed PHP2Shell: two critical flaws that let attackers run code on a web server without logging in. Almost every PHP version back to 5.4 is affected, but official fixes only came for PHP 8.2 to 8.5. AI tools helped find the flaws and turn them into working attacks, and they're speeding up vulnerability discovery across the industry. If your application runs on unsupported PHP, here's what that means and what to do.

php2shell.yml
cves: CVE-2026-109618, CVE-2026-109619
severity: critical, CVSS 4.0 score 9.2 each
impact: remote code execution, no login needed
affected: nearly every PHP version back to 5.4
fixed_in: 8.5.12, 8.4.27, 8.3.36, 8.2.35
php_8.1_and_older: no official release
31 December 2026PHP 8.2, the oldest version that got a PHP2Shell fix, reaches end of life
PHP2Shell in plain English

What happened in October.

01

What it is

Two flaws in how PHP cleans up after memory errors. They let an attacker who can send requests to your site run their own code on the server, with no login needed. Both are rated critical: 9.2 out of 10.

02

Who's affected

Every PHP installation that serves web pages, whether through PHP-FPM, Apache mod_php, CGI, FrankenPHP or LiteSpeed. Security researchers report that nearly every version back to PHP 5.4 is vulnerable.

03

How fast it was attacked

Researchers reported attempts to exploit both flaws within hours of disclosure. Amazon's threat intelligence team logged an attempt four days before the fix was even published.

04

Where AI came in

OpenAI's Codex Security team helped find the flaws. The researchers say AI models let one person turn them into working exploits in about a week, work that would otherwise take a team months.

05

What got fixed

The PHP project released fixed versions for PHP 8.2, 8.3, 8.4 and 8.5, the only versions it still supports. For PHP 7.4, 8.0 and 8.1 it published source code patches, for people who build PHP themselves.

06

What didn't

PHP 5.x and 7.0 to 7.3 got nothing. Workarounds exist, but the PHP project says they don't make an installation safe. On these versions, the flaw stays open unless you upgrade.

Is my version fixed?

PHP2Shell fixes, by PHP version.

Not sure which version you run? Run php -v on the server, or look for the version in your hosting control panel. Linux distributions sometimes ship fixes under older-looking version numbers, so check your package's changelog for the CVE numbers too.

PHP versionPHP project supportPHP2Shell fix
5.4 to 5.6, 7.0 to 7.3Unsupported for yearsNone. Upgrade, or isolate the application
7.4 and 8.0UnsupportedSource code patch only. No official release; ask your host or LTS vendor
8.1Unsupported since 31 December 2025Source code patch only. No official release; ask your host or LTS vendor
8.2Security fixes until 31 December 2026Fixed in 8.2.35, but this is likely one of its last fixes
8.3Security fixes until 31 December 2027Fixed in 8.3.36
8.4Security fixes until 31 December 2028Fixed in 8.4.27
8.5Security fixes until 31 December 2029Fixed in 8.5.12
The bigger picture

Flaws are being found, and used, faster.

Google's Threat Intelligence Group published these figures on 30 September 2026, in a report on vulnerability trends in the AI era. It expects both discovery and exploitation to keep increasing in the short to medium term. It calls the risk from AI-discovered flaws an early sign rather than an established trend, but says that risk isn't just theoretical.

  • 2×Vulnerabilities disclosed per month: 5,045 in January 2026, 10,740 in August
  • 18 / monthVulnerabilities exploited by attackers in January to August 2026, up from 10.5 a month in 2025
  • 141Exploited vulnerabilities in the first eight months of 2026, more than the 127 in all of 2025
  • 50%Share of AI-discovered vulnerabilities that allow remote code execution, against 26% of all disclosures

Why this hits legacy PHP hardest

Supported software gets a fix shortly after a flaw is published. Unsupported software doesn't, so every new flaw found in old PHP, an old framework or an old Composer package stays open. As flaws are found faster, the list of open holes in an old application grows faster too.

Old code is also exactly what AI tools are good at reading at scale. The same tools that help defenders review code help attackers turn published fixes into exploits for anyone who hasn't applied them.

In fairness

Google is clear that raw counts overstate the risk. Part of the rise comes from automated CVE assignment, and only about 1 in 431 vulnerabilities disclosed in 2026 was seen being exploited.

The question isn't whether every flaw will be used against you. It's whether you can patch the ones that are. On unsupported PHP, you often can't.

Your options

Patch, buy time or modernise.

Most organisations need a mix: an immediate fix, cover for the months an upgrade takes, and the upgrade itself.

This week

Patch or contain

For every PHP site you run

On PHP 8.2 to 8.5, update to the fixed version. On older PHP, apply the workarounds PHP lists, such as turning off session upload progress and limiting request sizes, and restrict who can reach the application. These reduce the risk; they don't remove it.

Buy time

Commercial PHP support

While an upgrade is planned

Some Linux distributions and long-term support vendors keep patching PHP after the PHP project stops. Zend PHP LTS by Perforce covers PHP 7.2 to 8.1 but not PHP 5, 7.0 or 7.1. HeroDevs also offers NES for PHP, so check its documentation for the versions it covers. It's a bridge, not a fix for old code.

Fix it properly

Modernise the application

PHP 8.4 or 8.5, supported to 2028–2029

Move the code up to a supported PHP version, with its framework and libraries, in safe steps. Most legacy applications can be modernised in place, without a rewrite.

How I'd do it

Legacy PHP to PHP 8.x, step by step.

I've spent years on legacy PHP modernisation. The trick is never to change everything at once: each step is tested and released before the next one starts.

  1. Assessment

    Code scanned for PHP version compatibility, Composer dependencies audited for known vulnerabilities and abandoned packages, and the hosting reviewed. You get a written risk report and an upgrade plan with costs.

  2. Contain the risk now

    Available patches and PHP's recommended workarounds applied, access restricted, and monitoring added, while the upgrade is planned.

  3. Build a safety net

    Tests added around the parts of the application that matter most, so every later change can be checked against how it behaves today.

  4. Upgrade in steps

    PHP raised one version at a time, with Rector doing the repetitive rewrites and PHPStan catching what it misses. Frameworks and libraries move up alongside.

  5. Modern hosting

    The application moved to a supported operating system and PHP 8.4 or 8.5, often in containers, so future PHP updates become routine.

  6. Release and keep it current

    Released through staging with a rollback plan, then kept up to date on a maintenance plan, so it doesn't become legacy again.

Questions

Frequently asked.

Our application has run fine for years. Why change now?

Running fine and being secure aren't the same thing. PHP2Shell is in PHP itself, not in your code, and on PHP 8.1 or older there's no official fixed release. As AI tools speed up how flaws are found, more like it will follow, and unsupported versions won't get fixes for any of them.

We're on PHP 7.4. Are we affected by PHP2Shell?

Yes. The PHP project published a source code patch for 7.4 but no official release. Your host, Linux distribution or a commercial PHP support vendor may have shipped a patched build, so ask them and check the package changelog for CVE-2026-109618 and CVE-2026-109619. Otherwise, apply PHP's workarounds and plan the upgrade.

Isn't a web application firewall enough?

It helps, but it isn't a fix. During PHP2Shell, Cloudflare reported attackers changing their payloads to get around its firewall rules. A firewall buys time while you patch or upgrade; it doesn't replace either.

Do we need a complete rewrite?

Usually not. Most legacy PHP applications can be upgraded in place, step by step, with tests and automated refactoring. A rewrite is only worth it when the assessment shows the code can't be saved for less.

Does running old PHP affect our data protection obligations?

It can. UK GDPR requires appropriate security for personal data, and running software with known, unfixed vulnerabilities makes that harder to show. If the application holds personal data, talk to your data protection lead. I can supply the technical assessment they need.

Legacy PHP applications

Find out where your application stands.

Tell me which PHP version and framework you run. I'll come back with the risk, the fastest way to contain it and a fixed price for the upgrade. The first conversation is free and comes with no obligation.