Cyber Security
|
On October 21, PHP shipped emergency fixes for two bugs in the language itself, CVE-2026-109618 and CVE-2026-109619. Together they're being called PHP2Shell. Both can lead to remote code execution with no login. PHP rates each one 9.2 on CVSS v4.0.
We've had bad PHP bugs before. What makes this one stick with me is not the score. It's that the flaw sat in PHP for over a decade, and the bug class looked too hard to weaponize. Then researchers working with frontier AI models showed it was. That's the part every security leader should sit with. The bar for "exploitable" just moved. What actually brokeThe short version: PHP doesn't clean up properly when it gives up on a request. When a PHP request runs out of memory or hits a fatal error, PHP abandons it on the spot. Engineers call this a "bailout." It's fast, but it skips cleanup. Some internal state gets left half built or pointing at memory that's already been freed. The two CVEs are two ways that leftover mess becomes dangerous:
Two things make this worse than a typical app bug. First, it's in the runtime, so your code can be perfectly written and still exposed. Second, on Apache with mod_php, the problem can be reached during request startup, before any of your application code runs. PHP-FPM is exposed too. PHP's advisory confirms code execution on FPM for CVE-2026-109619. For CVE-2026-109618, the FPM risk comes from code analysis rather than a working exploit. Beyond code execution, researchers also showed worker crashes and leaks of server memory. That last one matters for responders, and I'll come back to it. One note of caution: vendor write-ups and PHP's own advisories group the individual techniques under the two CVE numbers a little differently. If you're mapping detections to a specific CVE, go by PHP's advisories. The AI story, minus the hypeThe headlines say AI found PHP2Shell. That's close, but not quite right, and the difference matters. Here's what the reporting supports:
Now the nuance. Calif itself gives a lot of the credit to a human. Its team knew a PHP exploitation technique from 2004, and that knowledge is what pointed the model in the right direction. Calif also pushed back on the idea that a model can surface every bug from simple prompts. So my read is this. AI didn't magically discover a new class of flaw. It took a weakness that was known, deemed too hard to weaponize, and made weaponizing it cheap, in days instead of months. That's not hype. That's an economics shift, and it's the real story. About that "70% of the Internet" lineIt traces back to W3Techs, which reports that about 69% of websites with a detectable server side language use PHP. That's a share of websites, not of the Internet, and not of vulnerable machines. A lot of those sites sit behind managed hosts that patched within hours, or behind WAFs that had rules live before disclosure. The more honest measure is internet facing hosts running PHP. Estimates there range from about 1.3 million (researcher Silas Cutler) to 5.1 million (VirusTotal) depending on method. Mallory's analysis of Shodan banners found about 884,000 hosts advertising PHP 8.1 or older. The number I'd actually worry about is the old stuff. About 35% of WordPress sites still run unsupported PHP. Upstream fixes only ship as releases for 8.2 through 8.5, with source patches for 7.4, 8.0 and 8.1. Anything older gets nothing. That long tail is where the real exposure lives. How it unfoldedThe coordinated disclosure was planned for October 22. It broke two days early. Times are UTC, and a few vary by source.
The response was dramatic. Wikimedia took PHP systems offline as a precaution. In the Netherlands, the national cyber agency pulled its own site, and other government and hospital sites went down too. As of October 21, there were attempts but no publicly confirmed breaches, and neither CVE was on CISA's KEV list. What I'd do this weekIf I were walking into a leadership sync tomorrow, this is the list I'd bring.
Quick checks you can run todayThese assume a Debian or Ubuntu style Linux host. Adjust paths for your setup and try them on one box before rolling them out. Find every PHP runtime on a host, including the ones hiding inside vendor software:
Check whether a PHP build is on a fixed upstream release:
Distro packages often keep the old version number, so look for the CVE IDs in the changelog instead:
No match means the fix isn't in that package yet. Check container images too, since each one carries its own PHP:
After patching, restart workers and confirm nothing old is still running:
If you truly can't patch yet, PHP's advisories list partial workarounds for CVE-2026-109619. Those settings do nothing for CVE-2026-109618, which has its own partial workarounds in its advisory, such as a low post_max_size and request size limits at the front end. Treat all of them as a stopgap:
One script to check a hostIf you'd rather run one thing, here's a read-only script that pulls the checks above together. It finds PHP binaries and mod_php modules, compares each version to the fixed release for its branch, looks for distro backports in package changelogs, flags workers still running a binary that was replaced on disk, and optionally checks local Docker images. It exits 1 if anything needs attention, so it drops into a fleet tool or CI job easily. I tested it on Ubuntu 24.04 against real and simulated PHP 7.2, 8.1, 8.3, 8.4 and 8.5 builds, and it passes ShellCheck.
A clean result means you're patched, not that you weren't hit. The next section covers that second question. The forensics question: were we hit before we patched?Patching closes the door. It doesn't tell you whether someone already walked through it. A few principles I'd hold the team to:
Starter triage commandsRun these before patching or restarting anything, and keep the output with your case notes. Preserve logs and config with hashes so they hold up later:
Look for PHP files and override files created or changed since the leak:
Count memory exhaustion errors with no script attached, plus worker crashes:
Flag any shell or download tool started directly by a PHP or web worker:
Check persistence the web user could have planted:
These aren't vendor confirmed indicators. They're a reasonable first pass while the industry publishes proper Sigma and YARA rules. That last point about secrets is the forensics lesson in this whole episode. "No webshell found" is not the same as "nothing was taken." The bigger takeawayFor years, a lot of risk decisions quietly leaned on one assumption: this bug is real, but nobody will bother to weaponize it. Too hard, too fiddly, not worth the effort. PHP2Shell is a clear sign that assumption is aging out. The flaw sat in PHP for over a decade. A skilled researcher plus a frontier model turned it into a working chain in days. So here's what I'd change in how we run programs:
Defenders have the same models attackers do. The teams that use them to find and fix old bugs first will be the ones writing the calm postmortems next time. Sources
0 Comments
Leave a Reply. |

RSS Feed