PHP2Shell, and why a Worker has no shell to give
On 21 October 2026 PHP shipped emergency releases for PHP2Shell (CVE-2026-109618 and CVE-2026-109619): a crafted request turns into a shell on almost any PHP server. Hosts are patching through the night. A WordPress site on Cloudflare Workers does not need to: there is no server, no shell and no writable code to take over. That is not a patch for this bug. It is how the platform is built, so it holds for the next one too.
What happened
The two flaws were found in August 2026 by Calif and, independently, by Wiz. Details leaked on 20 October, a day before the coordinated release, and exploitation in the wild was reported within a day. Both are rated 9.2 (critical) under CVSS v4.0.
- CVE-2026-109618, memory corruption on out of memory. When an allocation fails, PHP abandons the request and its cleanup works on half-initialized data. A crafted form post or upload can trigger it while staying inside the configured size limits.
- CVE-2026-109619, stale state across requests. A PHP worker can keep pointers to memory freed by an earlier request; the next request on the same worker uses them. Session upload progress, on by default, is one way in.
Every web-facing PHP setup is affected (PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, LiteSpeed) from PHP 5.4 up to the fixed releases 8.2.35, 8.3.36, 8.4.27 and 8.5.12. With mod_php the attack runs before WordPress loads, so no security plugin ever sees it.
Why a server falls
The bug itself is a few corrupted bytes in PHP's memory. What makes it a disaster is everything a server hands over afterwards:
- A shell. PHP runs as a native process next to
/bin/sh,curlandwget. - A writable code directory. A backdoor in a plugin file, a must-use plugin or
wp-config.phpsurvives the PHP update and every reboot. - Neighbours. On shared hosting, the same user can read other sites, their
.envfiles and database dumps. - Server secrets. SSH keys, cloud credentials, the database password in plain text.
- Time. The server keeps running for months, and so does whatever got in.
That is why the advice today is to patch, hunt for backdoors, rotate every credential, and take sites offline that cannot be patched.
Why a Worker does not
HostlessWP runs WordPress on Cloudflare Workers with PHP compiled to WebAssembly. Each thing a server hands over after an exploit is simply missing.
| After exploiting PHP | PHP on a server | HostlessWP on Workers |
|---|---|---|
| Run native code | Yes, as the web server user | No. PHP is WebAssembly in a V8 isolate: it can only call the functions the sandbox gives it and cannot make memory executable |
| Get a shell, start a process | Yes | No. There is no operating system, no /bin/sh, no process to start. exec, system and proc_open are disabled on top |
| Plant a backdoor in the code | Yes, in any writable PHP file | No. The code is a read-only bundle built at deploy time; the in-memory file system is thrown away with the isolate |
| Upload a web shell | Yes, if the uploads folder runs PHP | No. Uploads live in R2 or S3 and are served straight from the bucket; PHP never runs them |
| Reach other sites | Often, on shared hosting | No. Each site is its own Worker in its owner's Cloudflare account, with its own isolates and memory |
| Steal server secrets | Yes: SSH keys, .env files, database dumps | None exist. The database password is not in PHP at all; Hyperdrive holds it outside the sandbox |
| Stay around | Until someone notices | Until the isolate is recycled, typically after a few requests. Every deploy starts from the clean bundle |
The next vulnerability
None of this depends on knowing which bug it is. PHP2Shell is not the first PHP remote code execution and will not be the last; the same walls stand in front of every class of bug that usually ends with a hacked server.
Interpreter memory bugs
Use-after-free, overflows, type confusion in PHP or an extension: confined to WebAssembly linear memory. No native code, no system calls, no shell.
Plugin file uploads
The classic "upload a .php file" bug: uploads go to a bucket and are served as files. Nothing in them ever runs.
Arbitrary file write
A plugin tricked into writing PHP files: the write lands in memory and is gone with the isolate. The deployed code is never touched.
Command injection
A plugin passing input to exec() or shell_exec(): there is no shell to inject into, and the functions are disabled.
Server software
No Apache, nginx, PHP-FPM, OpenSSH, cPanel or kernel of yours to patch. Cloudflare runs and updates the platform.
Persistence
Backdoors, cron jobs, rootkits need a disk that lasts. A Worker has none; each deploy rebuilds the site from your source.
You still keep WordPress, plugins and HostlessWP itself up to date, as everywhere. The difference is that a flaw in PHP no longer means a lost server. The evergreen version of this page, including what the platform does not protect: secure WordPress hosting without a server.
What to do
WordPress on a server
- Update PHP to 8.2.35, 8.3.36, 8.4.27 or 8.5.12 todayOr your distribution's patched package. 8.1 and older need a vendor backport or an upgrade
- Until then:
session.upload_progress.enabled=0In php.ini or the FPM pool, notini_set()or.user.ini; restart all workers - On PHP 8.5:
fatal_error_backtraces=0 - Look for backdoors and rotate credentialsNew admin users, unknown files in
wp-content, a changedwp-config.php
WordPress on HostlessWP
- No server to patch, no shell to clean up
- Or move a server site over
npx hostlesswpdeploys your existing WordPress to Workers
Questions
Is WordPress affected by PHP2Shell?
Yes, on any server with an unpatched PHP. The flaw is in PHP, not in WordPress or a plugin; Wiz demonstrated it against the stock WordPress container image.
Does a WordPress security plugin or a WAF stop it?
A plugin does not: with mod_php the attack runs before WordPress loads. A WAF such as Cloudflare's emergency rules helps while you patch, but only if the server accepts traffic from the WAF alone.
Can PHP2Shell give an attacker a shell on a HostlessWP site?
No. There is no operating system, process, shell binary, writable code directory or neighbouring site in a Worker.
Does this protect against future vulnerabilities?
Yes, in the same way. The protection comes from what a Worker does not have, not from a fix for one bug, so the next PHP or plugin flaw meets the same sandbox, read-only code and short-lived isolates.
Sources: GHSA-w8hw-w9fx-j79w, GHSA-6wmf-4rv5-p3rp, Rapid7, Patchstack, CISA.