Status as of October 23, 2026. Exploitation is active and advisories are still evolving, so confirm details against the primary sources linked below.
Your application code can be flawless and still hand an attacker a shell on your server. That is the uncomfortable lesson of PHP2Shell.
Two critical flaws in the PHP runtime itself, CVE-2026-109618 and CVE-2026-109619, let an unauthenticated attacker execute code on a web server. No login. No stolen credentials. On the most exposed setups, the attack lands before a single line of your application runs. Similar issue at wordpress hit few month earlier WP2Shell Attack: How a WordPress Core Vulnerability Bypassed 2FA and Turned a Website Into an Attackerâs Control Panel
I’ve spent more than two decades shipping software, first as the developer pushing code to production, then as the leader accountable when production breaks. That path taught me one rule about moments like this: the teams that recover fastest already know what they run, where they run it, and who owns it. The teams that struggle start by asking “wait, do we even use PHP there?”
This tech concept post gives you the facts, the fixed versions (including the truth about end-of-life branches), a step-by-step response plan, and the interim settings that buy you time if you can’t patch today.
What PHP2Shell Is, and Why Your Application Code Can’t Save You
PHP2Shell is the name the industry gave to two memory-safety bugs in PHP core. PHP’s security team rated each one 9.2 (critical) on the CVSS v4.0 scale, and PHP released fixes on October 21, 2026.
- CVE-2026-109618: RCE via out-of-memory corruption. When a request runs out of memory at the wrong moment, PHP leaves internal request data half-initialized, and the cleanup routine then treats that broken data as valid. Attackers can force this condition with crafted multipart requests.
- CVE-2026-109619: RCE via stale global state. Internal state from one request survives after its memory is freed, and a later request on the same worker reuses it. Session upload progress, which PHP enables by default, is one confirmed path.
Here is why this matters more than a typical application bug: PHP processes the malicious request before your code gets a vote. Authentication, input validation, and framework hardening do not stop it. Code runs with the privileges of your web server’s PHP worker account, and from there an attacker can read data, plant a web shell, and move deeper.
Researchers also reported that one of the bugs can leak freed server memory back to the client. That memory can hold passwords, session tokens, and API keys from other requests.
So who actually faces this risk?
Who Is at Risk: Almost Everyone Running PHP
PHP’s security team says every installation that serves web requests is exposed, whatever the setup:
- Apache with mod_php:Â the highest risk. Full RCE has been demonstrated against default settings, with no dependence on a particular URL or application.
- PHP-FPM:Â RCE has been validated for CVE-2026-109619, though that path needs a suitable application operation.
- FrankenPHP and LiteSpeed:Â rated as likely susceptible. Patch them too.
- CMS and framework stacks:Â the flaw lives in the engine, so WordPress, Magento, Drupal, Laravel, and similar platforms inherit it even when their own code is clean.
The timeline leaves no room for a “we’ll get to it next sprint” attitude. Details leaked online on October 20, before the coordinated disclosure. Security teams reported exploitation attempts before the patch shipped, and honeypots recorded scanning and exploitation traffic within hours of release. Researchers also warned that fake proof-of-concept exploits circulated around the disclosure, so never run exploit code you haven’t audited.
Treat any internet-facing PHP system that stayed unpatched from October 20 onward as potentially compromised until you’ve checked it. Now, what exactly do you install?
Patched Versions: What to Install
Official fixes exist for the four branches PHP still supports:
| PHP branch | Minimum patched version | Status |
|---|---|---|
| 8.5 | 8.5.12 | Active branch |
| 8.4 | 8.4.27 | Active branch |
| 8.3 | 8.3.36 | Active branch |
| 8.2 | 8.2.35 | Security-only; reaches end of life December 31, 2026 |
| 8.1, 8.0, 7.4 | No new release (upgrade is only option) | End of life; source backport or vendor package only |
| 7.3 and older | No fix (upgrade is only option) | End of life; upgrade or take offline |
Read the end-of-life rows carefully, because some summaries circulating online get this wrong. Versions such as 8.1.34, 8.0.30, and 7.4.33 are the final releases of those branches. They shipped long before PHP2Shell, so they do not contain the fix. PHP published no path for 8.1.*, 8.0.*, or 7.4.* (older).
What PHP’s security team did publish are minimal source patches for 7.4, 8.0, and 8.1 for people who compile PHP themselves. Some distributions and vendors, cPanel and CloudLinux among them, also shipped their own backported packages. A backported build can keep reporting its old version number, so a banner alone can’t prove you’re safe. Check your vendor’s advisory or package changelog for the CVE IDs.
Verify against the primary sources:
- PHP security advisory: https://www.php.net/archive/2026.php#2026-10-21-5
- CVE-2026-109618: https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w
- CVE-2026-109619: https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp
- CERT-EU Security Advisory 2026-018: https://cert.europa.eu/publications/security-advisories/2026-018/
With the targets clear, here is how to execute.
The Response Plan: Resolve PHP2Shell Step by Step
- Find every PHP installation. Cover production, staging, development, containers, vendor appliances, Windows software that bundlesÂ
php.exe orÂphp-cgi.exe, and shared hosting accounts. Scan your own address space instead of trusting asset records alone. - Patch internet-facing systems first. Install 8.5.12, 8.4.27, 8.3.36, or 8.2.35, or your distribution’s fixed package, then work inward. On managed or shared hosting, ask your provider to confirm in writing that the fix is live.
Eg.for Ubuntu Installation:
----------------------------
Run the package manager commands to pull down the latest security release from your repository (such as Ubuntu's security updates or OndĹej SurĂ˝'s PHP PPA):
sudo apt update
sudo apt upgrade
--------------------------Or--------------------------------
Alternatively, to upgrade only PHP packages without touching the rest of your system (assuming php at < 8.2.35):
sudo apt install --only-upgrade 'php8.2*' php-common- Restart PHP so the fix loads. A patched package does nothing while old processes keep running. Restart PHP-FPM, Apache, and every other PHP service.
- Verify the running version, not just the installed one. checks the command-line binary, which can differ from what your web server runs. Check the web-facing binary too
php -v #php version
php-fpm -v # binary name varies by distro, e.g. php-fpm8.2 sudo systemctl restart php8.2-fpm # service names vary by distribution
sudo systemctl restart nginx # or sudo systemctl restart apache2- Decide the fate of end-of-life PHP. Apply a vendor or distribution backport, build from PHP’s source patch, or upgrade to a supported branch. If you can do none of those today, take the system offline or restrict it to trusted networks. Remember that 8.2 itself expires on December 31, 2026, so plan your move to 8.3 or newer now.
- Check your package source. If you use a volunteer-run third-party repository, confirm it has published the fix. At the time of PHP’s advisory, the Remi repository had no update, and PHP recommended switching to distribution packages or building from source.
Some systems can’t take a patch in the next hour. For those, you need a stopgap.
If You Can’t Patch Today: Interim Mitigations
PHP states plainly that no complete mitigation exists short of updating. These settings reduce exposure, nothing more:
; Set in php.ini, the FPM pool, or server config, then restart every worker.
; ini_set() and .user.ini apply too late to help.
session.upload_progress.enabled = 0
post_max_size = 8M ; use 32M if the site accepts uploads
; PHP 8.5 only
fatal_error_backtraces = 0- Disable session upload progress. This closes the confirmed session path of CVE-2026-109619 only. PHP suggests leaving it off after patching if you don’t use it.
- Cap request sizes at the front. Enforce limits on request size, field counts, multipart parts, and headers at your web server or proxy. If an application never accepts multipart form data, block it there.
- UseÂ
memory_limit = -1 with extreme care. PHP lists it as an interim setting where applications can’t override it, but pair it with a per-worker container or cgroup memory limit, because removing PHP’s own limit raises denial-of-service risk.
Mitigations buy hours, not safety. Use them to bridge to the patch, then confirm nobody walked through the door in the meantime.
How to Check Whether an Attacker Already Got In
Patching closes the hole. It does not evict someone already inside. For every internet-facing system that sat unpatched after October 20, hunt for these signals:
- Worker crashes and memory errors:Â bursts of “Allowed memory size exhausted” messages, PHP-FPM children exiting abnormally, or Apache children crashing, especially from one source.
- Unusual multipart POST requests:Â large bodies with no usable Content-Length, very high counts of parts or headers, many empty file fields, or deeply nested field names. These can hit any PHP URL.
- Unexpected child processes:Â
php-fpm,Âphp-cgi,Âhttpd, orÂapache2Â spawning shells, interpreters, or download tools, or command lines containingÂ/dev/tcp/,Âfsockopen, orÂmkfifo. - Persistence on disk:Â new or recently modified PHP files in web roots, unfamiliar plugins or themes, and new cron jobs, scheduled tasks, or accounts.
Don’t lean on endpoint tools alone. A PHP web shell can operate without spawning a single process, so file review matters even when EDR looks clean. Scanner user-agent strings seen in early attacks make fine alert rules, but attackers change them trivially, so don’t rely on them.
If you find evidence of compromise, isolate the server, preserve your web server and PHP logs, and rotate secrets: database passwords, API keys, and session secrets, plus TLS private keys if you suspect memory disclosure. Wiping the machine before you collect evidence destroys your best chance of learning what the attacker took.
My Tech Advice: PHP2Shell will fade from the headlines in a few weeks. The lessons it teaches will not.
First, you cannot patch what you cannot find. The teams that finish this week fast are the ones with a living inventory of every runtime they operate. Second, an end-of-life runtime is not a quiet cost-saving. It is technical debt with a due date, and PHP2Shell is the day that debt came due for everyone still on 8.1 and below. Third, speed is a leadership decision. Someone must own the patch, set the deadline, and clear the calendar.
Start today. Inventory your Tech installations, patch the internet-facing systems first, Then schedule the migration you’ve been postponing. That is how you stop reacting to vulnerabilities and start leading your infrastructure.
By Dushyant Gadewal #AskDushyant
Technology Leader | Builder | Emerging-Tech Explorer | 20+ Years in Technology
Note: The names and information mentioned are based on my personal experience and publicly available data; however, they do not represent any formal statement.
Tags:Â #PHP2Shell, #PHP, #CyberSecurity, #InfoSec, #CVE2026109618, #CVE2026109619, #RemoteCodeExecution, #PatchNow, #WebSecurity, #DevSecOps, #TechLeadership, #AskDushyant #TechConcept #TechAdvice


Leave a Reply