PHP2Shell is the name for two critical remote code execution flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619, and the fix is to update PHP to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 and restart every PHP worker. Both flaws are rated 9.2 on CVSS v4.0, both can be triggered by an unauthenticated request before any of your application code runs, and attackers have been probing for them since before the patch shipped on October 21, 2026. Because the bug lives in the PHP engine, updating WordPress, Magento, Drupal or your plugins does not fix it. The PHP runtime on your server has to change.
This guide is for people who own or run PHP websites: WordPress and WooCommerce store owners, Magento merchants, agencies managing client sites and in-house teams running Laravel, Symfony or custom PHP. It covers what PHP2Shell is, which versions are affected, how to tell whether your site is patched, what to do if you cannot patch today and how to check for signs that someone got in first.
| Item | Details |
|---|---|
| Name | PHP2Shell (also written php2shell) |
| CVE IDs | CVE-2026-109618 (out-of-memory corruption) and CVE-2026-109619 (stale global state) |
| Severity | Critical, CVSS v4.0 score of 9.2 for each |
| Impact | Unauthenticated remote code execution on the web server |
| Affected | PHP 5.4 through 8.5.11, every server setup that handles web requests |
| Fixed versions | 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released October 21, 2026 |
| Exploitation | Public proof-of-concept code exists and both CVEs are in the CISA Known Exploited Vulnerabilities catalog |
| Related | CVE-2026-115560, a third PHP flaw disclosed October 23, with a configuration mitigation and no patch yet |
PHP2Shell is a pair of memory safety bugs in how PHP behaves when something goes wrong partway through handling a request, especially when a request runs out of memory. Details leaked online on October 20, 2026, ahead of the planned coordinated disclosure, and the PHP project responded by pushing out fixed releases the next day. The PHP security team’s security advisory is the primary source for the technical details.
What makes PHP2Shell unusual is where it sits. Most PHP security problems you read about are in a plugin, a theme or an application’s own code. These two are in the language runtime, so a site can be written perfectly and still be vulnerable.
PHP enforces its memory_limit setting by aborting any request that goes over it. If that abort happens while PHP is still setting up request data, for example while it is parsing a form upload, the data is left half built. PHP’s cleanup routine then treats that half-built data as valid and tries to free memory that was never properly set up. An attacker who controls what was in that memory before can turn the mistake into code execution. The PHP project tracks this one as GHSA-w8hw-w9fx-j79w.
PHP keeps some internal state that belongs to a single request. After certain failures, such as a fatal error, that state can outlive the memory behind it. When the same PHP worker picks up the next request, it can read that stale state before normal setup resets it, and that gap is enough for code execution. PHP’s session upload progress feature, which is on by default, is one confirmed route to this flaw, and fatal error backtraces on PHP 8.5 are another. The PHP project tracks this one as GHSA-6wmf-4rv5-p3rp.
On October 23, 2026, the PHP project disclosed a third remote code execution flaw, CVE-2026-115560. PHP says it only affects applications configured in an unusual way and considers it a low likelihood risk, so it will not ship an emergency release. The full advisory will come with the next regular release. Until then, the recommended protection is to turn off session upload progress, which you should do anyway (see the mitigations section below).
Treat every unpatched PHP version as affected. The PHP team says any installation that serves web requests is at risk, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. It rates mod_php as the highest risk setup, so those servers should be patched first.
| PHP branch | Affected | Fixed in | Notes |
|---|---|---|---|
| 8.5 | Every release before 8.5.12 | 8.5.12 | Also disable fatal error backtraces until patched |
| 8.4 | Every release before 8.4.27 | 8.4.27 | None |
| 8.3 | Every release before 8.3.36 | 8.3.36 | None |
| 8.2 | Every release before 8.2.35 | 8.2.35 | Reaches end of life on December 31, 2026 |
| 8.1, 8.0, 7.4 | All | No official release | Minimal source backports published; vendor or LTS fixes may exist |
| 7.3 and older (back to 5.4) | All | No official release | Upgrade or get a vendor backport |
If you are still on PHP 8.1 or older, PHP2Shell is a strong reason to finally move. The PHP security team published small source backports for 7.4, 8.0 and 8.1 because of how serious these bugs are, but those are for teams that compile PHP themselves. Everyone else should upgrade to a supported branch or ask their Linux distribution or long-term support vendor for a patched package.
Yes, attackers are actively trying. Here is how the first two weeks played out:
Public, confirmed break-ins have been slower to appear than scanning activity. Unit 42 linked one attack on a European government agency to PHP2Shell and then withdrew that link on October 25 because it could not confirm the entry point. That is not a reason to wait. Mass scanning, public exploit code and a CISA listing are exactly the conditions under which unpatched small business sites get compromised.
Almost every WordPress, WooCommerce, Magento, Drupal, Joomla, PrestaShop, Laravel and Symfony site runs on PHP. Whether the fix is your job depends on how you host.
If you are on shared hosting or a managed WordPress or Magento host, your provider runs PHP for you and is responsible for patching it. Check your host’s status page or announcements for PHP2Shell, and if you see nothing, open a support ticket and ask directly whether PHP on your plan has been updated to a fixed release or a vendor-patched build. If your control panel lets you choose a PHP version, pick the newest supported branch. If you are not sure how good your host’s security response is, our list of managed WordPress hosting providers is a starting point for comparing alternatives.
If you or your developer manage the server, the patch is yours to apply. That includes servers managed through cPanel, Plesk or similar panels, which often run several PHP versions side by side. Every one of them needs updating, not just the default.
If you deploy PHP in Docker or another container platform, rebuild your images from a patched base and redeploy. Patching a running container leaves the image underneath exposed, and the next deploy brings the bug back.
Some commercial and open source products ship their own copy of PHP, including some appliances, admin panels and Windows tools that include php.exe or php-cgi.exe. The Dutch National Cyber Security Centre keeps a list of affected third-party software on GitHub. Check it for anything you run.
session.upload_progress.enabled=0 in php.ini or your FPM pool configuration and leave it that way after patching. Very few sites use this feature, and it is also the protection against CVE-2026-115560.mod_php, then internal systems.If you use the Remi repository (rpms.remirepo.net) on Red Hat style systems, note that PHP said it would not have updates on release day. Check its current status, or switch to your distribution’s packages.
Do not rely on php -v alone. It reports the command-line PHP, which can be a different build from the PHP-FPM pool or Apache module actually serving your website. Instead:
apt changelog php8.3-cli | grep -E "CVE-2026-109618|CVE-2026-109619" (swap in your package name). On RHEL, Rocky Linux or AlmaLinux, run rpm -q php-cli --changelog | grep -E "CVE-2026-109618|CVE-2026-109619". A match means your vendor has shipped the fix even if the version number looks old.phpinfo() page, removed straight after, shows the version and loaded configuration that web requests actually use. Your host’s control panel may show the same information.Only an update fully fixes PHP2Shell. The measures below, taken from the PHP advisory and summarized by CERT-EU, each close specific known attack paths and buy time. They do not make a server safe on their own. If you cannot patch or mitigate quickly, CERT-EU advises taking internet-facing PHP applications offline until the fix is applied.
memory_limit=-1 in a way applications cannot override, such as php_admin_value in the FPM pool or Apache configuration, and confirm nothing else sets a finite limit. This removes the memory limit failure an attacker can trigger, but it also means a runaway request can use all the server’s memory, so pair it with the next two steps.post_max_size to 8M for applications that do not need uploads, or 32M if they do, and keep upload_max_filesize below it.RLIMIT_AS or RLIMIT_DATA, which can trigger the vulnerable code path.session.upload_progress.enabled=0 in php.ini, the FPM pool or server configuration, then restart every worker. Do not rely on ini_set() or .user.ini files, which apply too late.fatal_error_backtraces=0 and restart every worker.display_errors or error_reporting does not help.If your application never accepts file uploads, blocking multipart/form-data POST requests before they reach PHP removes a large part of the attack surface. A web application firewall in front of the site, such as Cloudflare’s, adds another layer while you work on the real fix.
Once the patched runtime is confirmed, restore a finite memory_limit and review your upload limits. Leave session upload progress off.
Patching closes the hole. It does not remove anyone who already got in, so check for signs of compromise on any server that was exposed after October 20, 2026:
PHPSESSID cookies in responses.Code execution gives an attacker everything the PHP process can read, including database passwords, API keys and payment integration secrets in configuration files. If you find any sign of compromise, rotate those credentials after the cleanup, not before, and treat customer data as potentially exposed until you know otherwise.
Many site owners can apply the patch themselves or get their host to do it. The harder parts are confirming that nothing was compromised and making sure the next PHP emergency is handled faster. Depending on where you are, these are the specialists to look at:
No. PHP2Shell is in the PHP engine, not in WordPress, Magento or any plugin. Keeping those up to date is still good practice, but only a PHP update or a patched vendor package closes these two flaws.
No. PHP2Shell runs on the server. Browsing a vulnerable site does not put your device at risk, although a compromised site could later be used to serve malware or phishing pages.
Only if it is 8.3.36 or a vendor build that includes the fix. Ask your host to confirm the exact build or check the package changelog for the CVE IDs.
No. A firewall rule that blocks known PHP2Shell requests is a useful extra layer, especially in the first days, but attackers adapt payloads to get past filters. Patch PHP and treat the firewall as backup.
Not necessarily for PHP2Shell itself. If your site handles payments, personal data or logins, though, a test or code audit is a sensible follow-up, because a runtime bug this serious is a reminder that application flaws can sit unnoticed for years.
PHP 8.2 reaches end of life on December 31, 2026. After that it will not receive official security releases, so plan a move to 8.3 or newer now.
PHP2Shell is one of the most serious PHP security events in years: two critical bugs in the language itself, leaked before the patch, with public exploit code and confirmed attack attempts. The response is straightforward. Update PHP to 8.5.12, 8.4.27, 8.3.36, 8.2.35 or a vendor-patched build, restart every worker, turn off session upload progress, and check exposed servers for signs of compromise. If your host runs PHP for you, get written confirmation that it has been patched. If any part of that is beyond your team, bring in a specialist now rather than after something goes wrong.