php2shell: how we protected PHP before the patch existed

Security | Updated: October 2026

Some vulnerabilities give you weeks. php2shell gave us a morning. On 21 October 2026, technical details of two critical PHP vulnerabilities leaked hours before PHP's own emergency release. Both could be reached with a single crafted upload request, before any application code runs: no login, no vulnerable plugin, no warning.

We did not wait for the patch. Before PHP published its fix, the PHP servers on our managed platform were already running an extension we had built that same morning. We open-sourced it the same day. Two days later, administrators from China to Russia are using it to protect servers that have no other fix available.

Retro CRT monitor showing php2shell with a green check for every PHP version from 5.4 to 8.5 and the status "guard active, protected"
One extension, every PHP branch from 5.4 to 8.5: the official php2shell fix, loaded into PHP without rebuilding it.

The short version: php2shell (CVE-2026-109618 and CVE-2026-109619) hits PHP while it reads an incoming request. Our extension, php_uploadprogress_guard, brings the official fix to an unpatched PHP without rebuilding it, on every version from PHP 5.4 to 8.5. Since then it also covers two newer problems that PHP itself has not shipped fixes for yet. Hosted Power customers did not have to do anything. Everyone else can use it for free.

In this article

  1. Why php2shell was different
  2. What we did in the first hours
  3. Rebuilt around the official fix
  4. Picked up worldwide
  5. The second wave
  6. The part that is specific to Hosted Power
  7. Where the extension stops helping

Why php2shell was different

Most web vulnerabilities live in an application: a plugin, a theme, a forgotten admin page. You update the application, or you put a firewall rule in front of it. php2shell was different in two ways.

It sits in PHP itself, before your application runs. The vulnerable code is in the way PHP reads an incoming request and cleans up after it. WordPress, Magento, Shopware, Laravel or your own code never get a chance to refuse the request, and to a firewall it looks like an ordinary upload.

It affects almost every PHP version in use. PHP 8.2 to 8.5 received an official fix. PHP 8.1 and older, still running on a large share of servers worldwide, got nothing ready to install. Independent monitoring published since suggests that roughly a third of PHP servers run versions that no longer receive updates.

Put those together, and a large part of the internet had a remotely exploitable hole with no clean way to close it.

What we did in the first hours

When the details leaked, our engineers traced the vulnerable code through the PHP source of every branch from 5.6 to 8.5 and built the narrowest fix we could defend: a small PHP extension that disconnected the affected session upload-progress handler as soon as PHP starts. Unlike the widely shared php.ini workaround, a website's own .user.ini or .htaccess cannot switch it back on.

We rolled it out across our managed platform, including cPanel and DirectAdmin servers, before PHP's official release. For customers, the only visible effect was a short PHP restart. Uploads, forms and sessions kept working, and nobody had to take a site offline.

Then we put it on GitHub, because the servers that needed it most were not ours.

Rebuilt around the official fix

When PHP published its advisories, the picture turned out to be broader than anyone could see that morning: the upload-progress handler was one route, but not the only one. So we rebuilt the extension around the official fix, part by part.

Version 3 carries PHP's own fixed upload parser with a memory guard, keeps the upload-progress handler disconnected, and mirrors the rest of the official fix, so request state can no longer leak from one request into the next. It recognises a PHP that already carries the fix, including updates backported by Linux distributions, and steps aside on its own.

It runs on every PHP version from 5.4 to 8.5, on Linux (x86_64 and ARM) and on Windows, without rebuilding PHP. That last part matters: most administrators of older systems cannot recompile PHP, but almost anyone can load an extension.

Meanwhile we installed PHP's official updates across our platform as soon as they were available. The extension stayed on as an extra layer.

Picked up worldwide

We published the extension to protect our own customers and to help others in the same situation. We did not expect what happened next.

  • Administrators from China to Chile filed issues, sent improvements and asked for builds for ARM servers and Windows. We built those overnight.
  • A Russian hosting provider, NetAngels, packaged the extension for its own customers' servers.
  • The independent CVE database Defensia lists it as the stopgap for PHP versions that no longer receive updates.
  • A French hosting company, Gladhost, ships it as ready-made packages for Rocky Linux 8.
  • Windows builds now go back to PHP 5.4, for a company that still runs it in production on Windows Server 2012 R2.
  • The author of a competing extension switched to ours on his own servers.
  • The press picked it up: Cybernews, Dutch IT Channel, IT-Connect and Born's Tech and Windows World covered it.

More than 130 developers starred the project on GitHub within three days. For a small extension written in a morning, that is a lot of trust, and we take it seriously.

The second wave

Within a day of PHP's emergency update, two new problems surfaced. PHP has not released fixes for either of them yet.

A memory bug in unserialize(), in every PHP version. When unserialize() cleans up, it can release memory that a running object is still using. This is the bug behind the "PHP's patch is incomplete" headlines. It is less broadly exposed than php2shell, but it affects patched PHP too. (php-src#24481)

A crash introduced by the security update itself. On PHP 8.4.27 and 8.5.12, SimpleXML can free the same memory twice, which ends in zend_mm_heap corrupted and a crashed PHP worker. The fix has been accepted into PHP's source code, but no release carries it yet. (php-src#24488)

Version 3.2 of our extension covers both, on patched and unpatched PHP alike, and we are rolling it out across our platform. That is why our advice changed: update PHP, and keep the extension installed until PHP ships these fixes itself.

A third advisory, already covered. On 23 October PHP published an informational advisory for CVE-2026-115560 and recommended switching off session upload progress until the next regular release. It is an unlikely scenario, but the mitigation is exactly what our extension has done since its very first version on 21 October: it disconnects the upload-progress handler and locks the setting, so no application or .user.ini can turn it back on. Every server running the extension was covered before the advisory existed. (php.net advisory)

Not sure where your servers stand?

Which PHP versions run where, which ones are patched, and which ones can't be updated yet: that is often harder to answer than it sounds, especially with older applications or control panels in the mix.

Request an infrastructure audit

The part that is specific to Hosted Power

The extension is open source, and anyone can use it. What made the difference for our customers is everything around it.

We had engineers who could read PHP's internals on a deadline. Tracing a vulnerability through every PHP branch from 5.6 to 8.5 in a morning is not something you improvise.

We could roll out everywhere at once. TurboStack manages every PHP version on every server the same way, so a fix written in the morning was live across the platform the same day, with monitoring that tells us it is actually loaded. We do the same one layer down, with Linux kernel live patching that closes kernel vulnerabilities without a reboot.

We had layers in front of PHP. While the extension closed the code path, TurboShield rate-limited upload requests and automatically blocked the sources of suspicious attempts.

We knew which customers needed what. Older PHP versions, custom builds, control panels: we knew where each one ran, which is why nobody had to take their site offline.

Where the extension stops helping

There are clear limits, and we prefer to state them explicitly.

It is a stopgap, not a replacement for updating PHP. The official update remains the real fix. The extension is a bridge for the servers that cannot get one yet.

It mirrors the known fixes; it does not predict the next one. It covers the published vulnerabilities and the two follow-up problems. When something new is found, we follow, as fast as we can.

It is not tested on every setup. We test every PHP branch on PHP-FPM, Apache mod_php and CGI. Other setups, such as LiteSpeed, are not part of our own tests yet, so check that the extension loads before you rely on it.

That last point is central to how we work. We would rather tell you exactly what we tested than promise protection we have not verified.

Open source, because the internet is shared

We built the extension for our own customers, and they were protected first. But a vulnerability like php2shell does not stop at our servers: every unpatched PHP server on the internet is a potential launch pad for the next attack. Sharing the fix was the obvious thing to do.

For our customers, the result is simple: protection before the patch, the official update as soon as it lands, and nothing to do on their side.

If you run PHP that you can't update yet, ask us to review your infrastructure. We'll tell you where you stand and what the safest route is: update, bridge, or migrate.

Running PHP you can't update yet?

Ask us to review your environment. We'll tell you where you stand on php2shell and the follow-up bugs, and what the safest route is: update, bridge, or migrate.

Want to learn more about these topics?