PHP2Shell and Whether PHP Still Earns Its Place
PHP2Shell refers to two critical vulnerabilities, CVE-2026-109618 and CVE-2026-109619, that can corrupt memory in the PHP runtime and potentially allow remote code execution on the server. The fixes were released on 21 October 2026 in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, while PHP 5 and 7 have no published patches. This isn't the first time a popular ecosystem has faced a vulnerability like this. Log4Shell hit Java, React2Shell affected the JavaScript ecosystem, and now PHP has its own entry. This post looks at how PHP compares with Node.js, Java, Python and Ruby, and whether PHP is still worth using for new projects or has become a legacy choice.
Contents
On 20 October the PHP security team announced that an emergency release was on its way, named a time for it, and asked everyone to get ready before anyone had even seen a patch, which is an unusual thing for a project to do. The technical details leaked anyway, so by the time fixes for two critical remote code execution bugs shipped on 21 October, Cloudflare had already spotted attack traffic and rolled out firewall rules for its customers, while one security firm was telling people to expect mass attacks within fifteen minutes of the release.
The bugs have been nicknamed PHP2Shell, and for the people who have spent years telling you that PHP is a liability they feel like a gift, although some of that celebration is deserved and some of it is a stretch. This post tries to separate the two, puts PHP next to Node, Java and the rest of the modern stack while it does so, and ends up at the question sitting underneath all the noise, which is whether you should still reach for PHP when you start something new.
What PHP2Shell actually is
PHP2Shell is the nickname for CVE-2026-109618 and CVE-2026-109619, two flaws that let an unauthenticated attacker run code on a PHP web server, and they were found by researchers from Wiz, OpenAI and Calif. The PHP team rates each of them 9.2 on the CVSS v4.0 scale, while watchTowr went as far as a full 10.0 (Wikipedia, BleepingComputer).
Both bugs grow from the same root. Whenever a request ends abnormally, for example because it blows through memory_limit, PHP bails out through an internal mechanism, and if that happens while some request data is only half built, the cleanup code that runs afterwards ends up trusting values that were never properly set up. In CVE-2026-109618 that shows up as memory corruption after an out of memory event, whereas CVE-2026-109619 comes from stale global state that opens the way to a heap use after free, memory disclosure and code execution with the privileges of the web worker (BleepingComputer, Hackread).
What makes people nervous is how far it reaches, because anything that serves web requests is affected, from the FastCGI process manager (FPM) and Apache with mod_php to CGI mode, FrankenPHP and LiteSpeed, and the researchers believe the problem goes back to PHP 5.4 even though not every release has been tested. The PHP team itself treats mod_php as the riskiest setup, since a demonstrated exploit fires before any application code gets a chance to run.
Fixes arrived in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, and as far as the advisories go nothing has been published for PHP 5 or 7 (watchTowr).
That covers what the bugs do and how far they reach, and the next thing to untangle is why an incident like this feels so much heavier than the usual PHP vulnerability headline.
Why this one stings more than the usual PHP bug
Many of the PHP incidents people remember trace back to application code and third party extensions rather than the engine, and Patchstack's 2026 report counted 11,334 new WordPress vulnerabilities in 2025, with 91 percent of them in plugins and only six in WordPress core (SWIF), so you could fairly argue that the blame sat with the code on top of PHP instead of PHP itself. PHP2Shell takes that defense away, because Imperva's analysis points out that these bugs live in PHP's own runtime and that several of them can be reached even when the application does nothing wrong (Imperva).
That forces a more honest answer to the old complaint that PHP is insecure. Plugin and application bugs still make up most of the vulnerability reports in ecosystems like WordPress, but the runtime underneath is a large C program, and large C programs have memory safety bugs, which is why Microsoft and Google have both reported that roughly 70 percent of their serious vulnerabilities come from that family, the same one Imperva places PHP2Shell in (TechRadar, Imperva). Careful PHP code can only do so much when the engine running it has a flaw.
The timeline teaches a second lesson as well. The details leaked before the coordinated disclosure, so Cloudflare saw attack traffic and switched on default firewall rules about nine hours before the public release (Cloudflare), and Wikimedia reportedly took its Phabricator instance offline as a precaution (Wikipedia). When a bug sits in a runtime that serves a huge share of the web, the gap between disclosure and patching ends up mattering about as much as the bug itself.
Before anyone reads that as a verdict on PHP alone, though, it helps to look at how the neighboring stacks have fared, because the same pattern of a nasty bug, a catchy name and a scramble to patch has played out in nearly every ecosystem.
Other ecosystems have their own shells
PHP2Shell follows a naming habit that other ecosystems started earlier. Log4Shell, back in late 2021, scored a perfect CVSS 10.0 and hit every application using log4j-core 2.x, since a single log message was enough to trigger it (Security Scientist), while Spring4Shell followed a few months later and sounded just as frightening even though it needed JDK 9 or newer plus a Tomcat WAR deployment, which meant plenty of Spring Boot apps were never exposed (same source). Cleaning up after Log4Shell took some organizations months, partly because later patches uncovered further issues (Sonatype).
The JavaScript world has had a rough stretch too, with the Next.js middleware authorization bypass in March 2025 (CVE-2025-29927) letting attackers skip checks through a crafted header (Next.js advisory), and React2Shell (CVE-2025-55182) in December 2025 giving unauthenticated remote code execution through React Server Components, with a CVSS score of 10.0 (React). On top of framework bugs, npm carries a supply chain problem of its own, and Sonatype counted a 742 percent average yearly rise in supply chain attacks since 2019 in its 2022 report (Sonatype), while vendors were still publishing npm advisories as late as September 2025 (CloverDX).
Node's own runtime has had a busy year as well, which undercuts the idea that only PHP carries engine level risk. The project shipped a March 2026 release with roughly eight CVEs including two high severity process crashes (HeroDevs), a June release covering around a dozen advisories across the 22, 24 and 26 lines (Node.js), and a July release on the 29th, after two one day delays, that fixed eleven CVEs of which three were rated high (HeroDevs). Many of these are denial of service problems or bypasses of Node's own safety checks rather than the unauthenticated code execution seen in PHP2Shell, which keeps them below it on the severity ladder, yet they end up in the same place, because somebody has to upgrade the runtime underneath the app, and the outlook is grim on retired branches, since Node 20 reached end of life on 30 April 2026 and the July update gave Node 18 and 20 nothing (HeroDevs).
Vercel shows two different kinds of trouble. The Next.js August 2026 security release disclosed a critical flaw (CVE-2026-75604) that could give unauthenticated remote code execution on Windows hosted Next.js servers, and while applications hosted on Vercel were protected, self hosted servers had no workaround besides upgrading (Vercel). Back in April, Vercel disclosed a breach that began with a compromised third party AI tool, whose OAuth access let the attacker reach a Vercel employee's Google Workspace account and then Vercel systems, where environment variables not marked as sensitive were enumerated (Strapi, Trend Micro). Vercel said no flaw in its core infrastructure was involved and found no evidence that Next.js or Turbopack were affected, which makes the incident a good reminder that many modern breaches come from the trust between services and have little to do with the language runtime.
Python and Ruby are memory safe at the language level and still walk into the same old traps, since loading untrusted data with pickle can run arbitrary code in Python, something its own documentation warns about (LWN), and unsafe parameter parsing in Rails (CVE-2013-0156) let remote attackers run arbitrary code on Rails servers back in 2013 (CVE record). The syntax is different, yet the habit of trusting input a little too much is a familiar story in PHP as well.
With those stories in mind, a side by side view makes the differences a lot easier to see.
Side by side
No stack in this table is clean, so what really changes from row to row is where the exposure sits and who has to act when a bug drops.
The last column deserves a second look, because a Node app picks up most of its fixes through its own package manager while a PHP fix often has to wait for someone else to upgrade the runtime underneath it.
All of this leaves the question most readers came here for, which is whether PHP deserves a place in a new project today or has turned into a stack you only touch because you have to.
So is PHP still worth using?
For most of the jobs PHP does today the answer is yes. Content sites, online stores, internal tools and a good share of SaaS products can run happily on PHP 8 with Laravel or Symfony, and the language has changed enough since the days people love to mock that typed properties, enums and attributes make it feel closer to a mainstream typed language than to the scripts of 2008. Hosting is easy to find, and the ecosystem around WordPress, Drupal and Magento is firmly established.
So it is not a legacy only language, although legacy is certainly where most of the pain collects, and PHP2Shell sharpens that point. The real danger sits in unmaintained installs, because none of the advisories I read mention patches for PHP 5 or 7 and the fix list starts at 8.2, which leaves every site on an older branch with a published remote code execution bug and nothing to install, a fact attackers know as well as you do.
Set that against the alternatives and the picture gets less one sided. Node's own runtime shipped security releases in March, June and July of this year, so switching stacks mostly trades one runtime for another and adds a migration's worth of fresh bugs on the way. What PHP offered this week was advance notice, a fix a day after the warning and backports to four supported branches, and that is a respectable response by any standard.
None of that makes PHP the right answer everywhere, and plenty of teams have good reasons to pick something else, so it is only fair to say plainly when that is the case.
When another stack makes more sense
There are good reasons to look elsewhere, though PHP2Shell on its own is a thin one, since Node's runtime shipped security releases in March, June and July and a single patched bug does not change what PHP is good at. If your product leans on long lived connections such as WebSockets, streaming or heavy real time features, Node, Go or Elixir fit that shape more naturally than the request per process model PHP grew up with, and if your team already writes TypeScript on both the front end and the back end, shared types and tooling can save more time than any language feature ever will. Services that need strict compile time guarantees or serious concurrency often end up in Go, Kotlin or Rust, and Rust in particular is widely seen as a way to avoid the memory safety bugs behind most C and C++ vulnerabilities (TechRadar), the same family Imperva places PHP2Shell in, at the price of a steeper learning curve.
Team skill usually tips the balance more than benchmarks do, since a group that knows Laravel well will ship a safer product in Laravel than in a framework it picked up last month, simply because patching, upgrading and reading advisories are all easier on familiar ground. Choose on fit and on who you can hire, and then spend the security effort on keeping every layer current.
Whichever way your team leans, the practical work for this week looks the same, and it starts with knowing exactly what you are running.
What to do this week
Start by finding out which PHP version you actually run, both on the command line and on the web server since the two can differ, and then upgrade to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 depending on your branch, asking your provider when the update lands if you sit on shared hosting instead of assuming it already has. While you wait, reporting on the advisory lists a low post_max_size, around 8M for apps without uploads and 32M for those that need them, as a temporary mitigation for CVE-2026-109618 (BleepingComputer), and a managed firewall adds another layer, since Cloudflare switched on default rules for its customers. If you still run PHP 5 or 7, treat the migration as an incident rather than a backlog item.
PHP2Shell will not be the last bug of its kind in any runtime, and Node, Java and PHP will each have another bad week sooner or later, so the teams that come through it calmly are the ones who can patch within hours. That ability says far more about the security of a stack than the language printed on its badge.
Sources
- Wikipedia on PHP2Shell
- BleepingComputer on the emergency patches
- Cloudflare on its WAF protections
- Imperva threat research on PHP2Shell
- watchTowr FAQ
- Hackread on the emergency fixes
- SecurityWeek on the leak
- Brandefense on PHP2Shell
- SWIF on Patchstack's WordPress security statistics
- Security Scientist on Spring4Shell and Log4Shell
- Sonatype on the 4shells
- Sonatype press release on its 2022 report
- CloverDX security advisories
- TechRadar on Chrome memory flaws
- Next.js advisory on the middleware bypass
- React team on the React Server Components vulnerability
- Vercel on the Next.js August 2026 release
- Strapi on the Vercel breach
- Trend Micro on the Vercel breach
- HeroDevs on the March 2026 Node.js release
- Node.js June 2026 security releases
- HeroDevs on the July 2026 Node.js release
- LWN on Python pickle
- CVE record for CVE-2013-0156
Source: Published Notion page
This article
Post Reactions
Join the conversation
Write a Comment
Share your thought about this article.
Comments
Loading comments...