PHP2Shell: Two 9.2-Rated Flaws Reach Back to PHP 5. Here's the Plan for EOL Teams

PHP2Shell: Two 9.2-Rated Flaws Reach Back to PHP 5. Here's the Plan for EOL Teams

BackerLeader ●67 ●391 ●579
calendar_today • schedule6 min read

PHP shipped emergency patches on October 21 for two critical flaws now known as PHP2Shell. Both are rated 9.2 under CVSS v4.0. Both can let an unauthenticated attacker run code on your server.

The fixes are in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. If you run a supported branch, update and restart your PHP workers. That part is simple.

The harder question is what to do if you run a version that no longer gets community patches. A lot of teams are in that spot.

I asked Matthew Weier O'Phinney about it. He's principal product manager for Perforce OpenLogic and Zend, and he sits on the PHP Foundation board. Perforce sells extended support for end-of-life (EOL) open source software, so keep that in mind when he talks about extended support. But he also had a close view of how this disclosure played out.

What the flaws do

CVE-2026-109618 corrupts memory when PHP hits an out-of-memory error in the middle of a request. CVE-2026-109619 involves stale global state. PHP keeps pointers to request data after that memory has been freed.

Weier O'Phinney put it in plain terms. "An attacker can create one or more payloads that simulate large file uploads, or multi-file uploads, that hit configured memory limits for the PHP application," he said. Because of how PHP handled memory and errors at that moment, the attacker could end up running system commands on the server.

The attack doesn't need a vulnerable application or a public upload form. And the timeline was tight. Details leaked on October 20, a day before the coordinated release. Security firm Sansec reports that Cloudflare saw attacks hours before the patches shipped.

It's not just mod_php

PHP's advisory named Apache's mod_php as the highest-risk configuration. Some early coverage stopped there. Weier O'Phinney says that's too narrow.

"These vulnerabilities affect every single Server API (SAPI) provided by the language, because their roots are deep within how the engine manages memory and handles errors," he said. "If you run PHP, your application is affected, plain and simple."

mod_php may be the easiest path in. But PHP has also confirmed remote code execution against PHP-FPM under the right application conditions. If you run FPM behind Nginx, you're not off the hook.

Workarounds buy time. They don't fix the problem.

The early advice was to turn off session upload progress and remove memory limits. Weier O'Phinney says those steps help, but only so much. "They just change the size of the file upload payloads the attacker needs to use to exploit the system," he said.

He's more positive about two other measures:

  • A web application firewall (WAF) that limits which paths accept uploads, or any user submission
  • AppArmor or SELinux to restrict PHP's access to system binaries

Both are good defense-in-depth. But he warns that creative attackers can still find ways around them if the PHP runtime underneath is vulnerable.

PHP says the same thing. Updating is the only complete fix. If you removed the memory limit as a stopgap, put a container or cgroup limit in place, and restore a finite limit once you've patched.

The end-of-life problem

Here's where it gets uncomfortable. According to Weier O'Phinney, every PHP version before 8.2 is past community support. And 8.2 reaches end of life at the end of this year.

These flaws trace back to the PHP 5 series. "If you're running PHP 5, PHP 7, or early PHP 8 versions, you will need to audit your applications and deployments," he said.

He sees two paths:

  1. Use a commercial long-term support (LTS) provider. Several have patched EOL versions. Perforce Zend patched PHP 7.2, 7.3, 7.4 and 8.1 in coordination with the PHP Security team. If you already have a provider, confirm it shipped patches for your version.
  2. Start migrating to a community-supported version. That means 8.2 or later. Since 8.2 is nearly at end of life itself, a migration that stops there only buys you a couple of months.

If you have neither, his advice is to pick one today.

AI changed the clock

The backstory matters here. A security audit sponsored by the Sovereign Tech Agency and the PHP Foundation found these attack vectors last year. But the security team couldn't find a practical way to trigger them. They treated the flaws as largely theoretical and kept working on them off and on.

Then, this past August, two independent researchers found the same issues within days of each other. Each was using a frontier AI model. Each built a way to exploit them. The PHP Security team had to move them to the top of the list.

That's the real shift. A bug that sat in the "theoretical" pile for a year became practical in a matter of days.

Weier O'Phinney sees the same pattern across open source. The cURL project has been handling a flood of AI-discovered reports for two years. Spring has seen a big jump in reports this year. And those reports still need people to review them. Maintainers have to confirm that each patch works, doesn't break existing behavior and doesn't add new flaws. Many AI-generated reports also overstate severity, which takes more time to sort out.

For EOL software, this is the core risk. Discovery is speeding up. Patches for unsupported versions aren't.

Migration or extended support?

Weier O'Phinney is clear that migration is the goal. Current versions get new features and security fixes first, and the rest of the ecosystem tends to follow the latest releases.

But he's also realistic. Continuous upgrades take discipline, solid testing and QA, and a DevOps team that can roll releases out and roll them back. Some companies also face regulatory reviews every time they move to a new feature release. That costs time and money, so migration gets pushed back.

"So adopt those new versions if you can, but have a plan for when you cannot," he said.

That's fair advice, and it's worth taking at face value. Extended support is a bridge, not a destination. If you're evaluating a provider, ask one simple question: how fast did it ship PHP2Shell patches for your version? The answer tells you a lot.

How the disclosure worked

Weier O'Phinney knew for a couple of months that big security patches were coming. He didn't know the details. "That's a good thing," he said. Fewer people in the loop means less chance of a leak.

The PHP Foundation now employs a small team that coordinates security work between researchers and the PHP project. One of them contacted Weier O'Phinney in his role at a commercial LTS provider to line up releases. In more than 20 years at Zend, that was a first for him. The PHP Security team worked with Zend's packaging team and reviewed its patches so both were ready on release day.

His bigger concern is capacity. The PHP Security team is small, and the volume of incoming reports keeps growing. He'd like to see it staffed well enough to coordinate like this more often. His ask: if your company depends on PHP, consider donating to the PHP Foundation.

What to do this week

  • Find every PHP runtime you have. Check servers, containers, base images and hosting accounts. Trust php -v, not your documentation.
  • Patch supported branches now. Move to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, then restart PHP workers so the new code is actually running.
  • Check EOL versions separately. If you use an LTS provider, confirm it has shipped fixes. If you don't, choose between getting one and starting a migration.
  • Treat workarounds as temporary. Undo emergency config changes once you've patched.
  • Keep the extra layers. A WAF and AppArmor or SELinux are worth having after the patch, too.
  • Plan for more of this. AI-assisted discovery isn't slowing down. Budget time for triage and upgrades, not just for incidents.

PHP2Shell will get patched on most supported systems this week. The teams still exposed next month will be the ones running PHP that nobody owns. Now is a good time to find out if that's you.

Want more #opensource & #opensource deep dives?

Join 6,176+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

AAIF Hits 10 Projects. Its CTO on What to Adopt Now and the Security Gaps Left Open

Tom Smithverified - Oct 23

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

StarlingX 13.0 Turns Two Edge Upgrades Into One Reboot. Test the Targets Yourself.

Tom Smithverified - Nov 24

What Security Teams Want From AI Agents Before They Let Them Act Alone

Tom Smithverified - Nov 18

Cloudflare Blocked My Server, So I Made My Visitors' Browsers Do the Fetching

bryanhamiltondevverified - Nov 15
chevron_left
21.7k Points • 1k Badges
304Posts
177Comments
155Connections
LLM Training & Evaluation Specialist with hands-on experience building major AI models. As one of th... Show more

Related Jobs

View all jobs →

Commenters (This Week)

23 comments
13 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!