PHP · Security · RCE · Patching

php2shell: two critical PHP vulnerabilities, CVE-2026-109618 and CVE-2026-109619 — businesses must update now

Last updated: 22 Oct 2026

Syntax-highlighted PHP source code in a dark-themed editor, with the project's file list on the left

Photo: Pixabay / Pexels

On 21 October 2026, the PHP project released emergency patches for two vulnerabilities that the security community collectively calls php2shell: CVE-2026-109618 and CVE-2026-109619. PHP rates both 9.2/10 (Critical), and both let an attacker run code remotely without logging in on a web server that uses PHP. If your company's website, management software or portal runs on PHP — WordPress, Laravel, Magento, Drupal, Joomla or custom code — the short answer is: update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 today, restart every PHP process, and only then worry about the rest.

Quick summary

  • The flaw is in PHP itself, not in a plugin or framework. According to PHP, every PHP server handling web requests is at risk: PHP-FPM, Apache mod_php, php-cgi, FrankenPHP, LiteSpeed.
  • Two bugs, one outcome: CVE-2026-109618 is a memory corruption bug triggered when PHP runs out of memory mid-operation; CVE-2026-109619 is a use-after-free bug between two requests. Both lead to unauthenticated remote code execution.
  • Patches: 8.5.12 · 8.4.27 · 8.3.36 · 8.2.35. PHP 8.1 and older get no official release; CISA recommends taking these systems off the network until they are upgraded.
  • Signs of attacks already: Cloudflare reported seeing early attacks before the patches were released; Datadog noted multiple reports of in-the-wild exploitation. CISA had not observed any at the time of its alert.
  • Temporary configuration only reduces risk and cannot replace the patch: disable session.upload_progress, block multipart/form-data if you don't use it, and set memory limits as PHP advises.

Key figures (with sources)

  • PHP's two official advisories on GitHub rate both flaws Critical 9.2 under CVSS v4.0 — GHSA-w8hw-w9fx-j79w and GHSA-6wmf-4rv5-p3rp, 21 October 2026.
  • Palo Alto Networks Unit 42 counted more than 22.6 million publicly exposed endpoints that may be affected, based on Cortex Xpanse data — Unit 42, 21 October 2026.
  • VirusTotal identified about 5.1 million IP addresses running PHP, of which about 758 thousand run end-of-life branches (5.4–8.1) — VirusTotal, 21 October 2026.
  • The vulnerable code dates back to PHP 5.4.0, released in 2012; the default configuration is enough to be attacked — Sansec, 21 October 2026.

What happened to PHP?

This is an out-of-band security release from the PHP project, after details of the vulnerabilities leaked ahead of disclosure. On 20 October 2026, the PHP security team posted an advance notice on the php.announce mailing list, scheduling patches for 14:00 UTC on Wednesday 21 October 2026 for two vulnerabilities "both rated CVSS v4.0 9.2, Critical". According to Tenable, the original date was 22 October but it was brought forward a day because the CVE IDs had spread on Hacker News and social media — along with an incorrect CVSS score of 10.0.

Huntress recounts how it unfolded: on the morning of 20 October, a Hacker News post claimed two critical PHP vulnerabilities were about to be disclosed; the post was removed, but screenshots had already circulated. VirusTotal recorded that the archive mentioned in the leaked analysis was first uploaded at 02:29 UTC on 21 October, a few hours before the patches were available.

According to Sansec's timeline, the Calif research team found multiple code execution paths starting 1 August 2026 and reported the first bug to PHP on 11 August; Wiz Research reported the vulnerabilities to PHP on 24 August. The GitHub advisories credit four reporters and four developers who fixed the issues. Google Cloud also wrote that its Gemini 4 Argon model contributed to finding the vulnerabilities and developing exploit code — a detail showing that AI is now being used on both sides of the security problem.

The name "php2shell" was not coined by PHP. PHP's official pages use only the CVE and advisory IDs; the name appears in CISA's alert and in researchers' write-ups.

How do the two vulnerabilities work?

In short: both are memory management bugs inside PHP that occur while PHP parses and cleans up the data of a web request — that is, before your application code even gets to run. That is why login mechanisms, access control or application-layer firewalls cannot stop them.

CVE-2026-109618 — memory corruption on out-of-memory. According to advisory GHSA-w8hw-w9fx-j79w, PHP uses longjmp() to bail out immediately when a request exceeds the memory limit. If an allocation fails just as internal data is half-initialised, PHP does not correctly record that early exit; the cleanup step afterwards then treats the half-built data as valid. Attackers trigger this condition with specially crafted multipart requests (the request type used for forms and file uploads). Rapid7 notes that these requests can exhaust memory "even when their size appears to meet PHP's configured limits". The confirmed impact is unauthenticated remote code execution, under the account of the web process.

CVE-2026-109619 — use-after-free. According to advisory GHSA-6wmf-4rv5-p3rp, one request can leave internal state pointing to memory that has already been freed; the next request handled by the same process then reuses that stale state before PHP can reinitialise it. The two confirmed exploitation paths are configuration notices raised before request initialisation, and the session upload progress feature. Impact: memory disclosure and remote code execution. Sansec adds that the upload progress handler can return freed memory to the browser inside the PHPSESSID cookie, even when the application never calls session_start().

Table 1 — Comparison of the two php2shell vulnerabilities (per PHP's advisories and Sansec, 21 October 2026)
CriterionCVE-2026-109618CVE-2026-109619
Bug typeMemory corruption while handling an out-of-memory (OOM) errorUse-after-free between two requests
TriggerA crafted multipart request that exhausts memory at exactly the right momentOne request leaves stale state; a later request on the same process reuses it
Confirmed impactUnauthenticated remote code executionMemory disclosure, unauthenticated remote code execution
Demonstrated onApache mod_php with default limits; no complete exploit yet for FPMmod_php (error backtrace path, PHP 8.5) · mod_php and FPM (session path)
Data leakageAccording to Sansec, it also leaks memory on its own, similar to HeartbleedCan return freed memory in the PHPSESSID cookie
CVSS v4.0 (PHP)9.2 Critical9.2 Critical
Data centre aisle with black mesh-door server racks, blue network cables and a monitor on a cart at the end of the row
Every PHP server handling web requests is at risk, from shared hosting to dedicated server clusters. Photo: Brett Sayles / Pexels

Who is affected, and which versions are safe?

Every PHP version from 5.4 up to the patches of 21 October 2026 is affected if it is serving web requests. The security notice on php.net states clearly that the at-risk group is "all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed", and that the highest risk is mod_php, where proof-of-concept exploit code has shown that an anonymous request can trigger the attack before any line of application code runs. Google Cloud sums it up: affected is "All versions of PHP from 5.4 through 8.5.11".

Table 2 — Affected versions and patches by branch (per PHP's advisories and Tenable)
PHP branchStatusWhat to do
8.5.xAffected if < 8.5.12Upgrade to 8.5.12
8.4.xAffected if < 8.4.27Upgrade to 8.4.27
8.3.xAffected if < 8.3.36Upgrade to 8.3.36
8.2.xAffected if < 8.2.35Upgrade to 8.2.35 — note that the 8.2 branch reaches end of life on 31 December 2026
7.4 · 8.0 · 8.1End of life; no official releaseMinimal source patches available for those who compile their own; upgrading to 8.2 or later is recommended
5.4 – 7.3End of life; not patched by PHPUpgrade, or disconnect from the Internet until upgraded

For end-of-life branches, php.net says the security team has provided "minimal source-backports for PHP 7.4, PHP 8.0, and PHP 8.1" for people who compile PHP themselves or have no long-term support vendor — these are code branches on GitHub, not releases. CISA goes further: organisations still using PHP 8.1 or older "should take PHP-based systems offline until they can be patched or updated".

A common point of confusion: the version number does not always tell you the true patch status. Datadog and Red Hat both warn that Linux distributions sometimes backport fixes without changing the upstream version number. Conversely, Red Hat says RHEL 8, 9 and 10 are affected, while RHEL 7 and earlier ship PHP versions that are not vulnerable to these two bugs. Users of the Remi repository (rpms.remirepo.net) should take note: according to Sansec, it did not yet have the patch on 21 October.

As for applications: Tenable cites Calif's findings confirming pre-authentication remote code execution on certain specific versions of WordPress, Drupal, Joomla and Magento. Datadog puts it more simply: any PHP file opens a path to the bug, even a file that just prints a single line of text.

How severe is it really?

Serious, but different parties score it differently and also disagree on how hard it is to exploit. PHP scores it 9.2 under CVSS v4.0, with Attack Complexity set to High and Attack Requirements set to Present. Red Hat rates it "Important" rather than Critical, with a CVSS v3 score of 8.1, and writes that reliable exploitation "requires precise heap manipulation and timing", making remote code execution "difficult in practice" — especially with PHP-FPM, the default configuration on RHEL.

Table 3 — How different parties assess php2shell (checked 22 October 2026)
SourceScore / ratingKey assessment
PHP (GitHub advisory)CVSS v4.0 9.2 — CriticalUnauthenticated remote code execution confirmed; no configuration fully mitigates it
Red HatCVSS v3 8.1 — ImportantHard to exploit in practice; default mod_php is higher risk than FPM
NVD (shown on Red Hat's page)CVSS 9.8Rates attack complexity as low
Datadog—Built its own exploit on PHP 8.5.11 + mod_php; the tuned version completed in 3.10 seconds
Rapid7—Recommends emergency out-of-cycle patching; expects a public exploit soon
CISA—No exploitation observed at disclosure; calls for immediate patching

The real-world picture is what is worrying. Datadog wrote that its team built an exploit before disclosure, and that PHP's default memory limit is still exploitable; the tuned version returned HTTP 200 and completed in 3.10 seconds in the lab (single process, OPcache disabled). Rapid7 noted multiple signs that the research is being independently reproduced and expects a working exploit to become public soon. Sansec, after the patches and analyses were out, wrote that "the writeups and an exploit tool are public".

Whether attacks have already happened is something the sources do not yet agree on. Sansec cites Cloudflare reporting early attacks at 07:43 UTC on 21 October, before the patch release; Datadog wrote that as of 21 October there had been multiple reports of in-the-wild exploitation, along with widespread scanning. On the other side, CISA had not observed exploitation at the time of its alert, and Huntress said that as of 16:30 US Eastern time on 21 October it had still not seen exploitation across its customers' systems. Some organisations did not wait: Sansec noted that several websites in the Netherlands, including the country's House of Representatives and NCSC, proactively went offline on 21 October; Unit 42 said at least one European government temporarily took down websites as a precaution.

What should businesses do in the next 24 hours?

The only complete fix is to update PHP — every source agrees on this. Rapid7 recommends updating "on an emergency basis, outside of normal patch cycles". The order Namtech recommends for businesses:

  1. Inventory. List every website, internal application and portal running PHP — including old servers few people remember, containers and applications that bundle their own PHP. Datadog's reminder: don't rely only on the command-line PHP version on the machine.
  2. Identify the version actually serving the web, not just the command-line version: check the hosting control panel, the server's PHP info page, or ask your provider. Compare against Table 2.
  3. Update to 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35, then restart or replace every PHP process still running the old version; for containers, rebuild the image and redeploy.
  4. If you can't patch yet, reduce the risk with the configurations in Table 4, and consider putting the system behind a WAF or VPN, or temporarily disconnecting it from the Internet. Sansec is blunt: if you can shut down the PHP server, do.
  5. Check for signs of compromise (see the next section) and rotate passwords, API keys and certificates on any suspect server, because the bugs can expose data in memory.

On shared hosting (cPanel, DirectAdmin…), the ability to update PHP usually lies with the provider. Ask your provider directly whether they have applied the patch and when, rather than just switching the PHP version in the control panel and assuming you are safe. On Google Cloud, Google says App Engine standard (PHP 8.2 and later) is updated automatically while App Engine flexible is not; Cloud Run is only patched automatically if automatic base image updates are enabled, and on GKE you must update the image yourself and redeploy.

Table 4 — Temporary measures when you can't patch yet (per php.net, Rapid7 and Sansec). None of them replaces the patch.
MeasureWhat it blocksNotes
session.upload_progress.enabled=0, then restart every processThe confirmed session paths of CVE-2026-109619Must be set in php.ini, the FPM pool or server configuration; ini_set() and .user.ini are too late. Does not block other variants
fatal_error_backtraces=0 (PHP 8.5 only)The confirmed error backtrace path of CVE-2026-109619Hiding errors with display_errors, error_reporting or @ does not help
memory_limit=-1 set at the admin level (cannot be overridden by the application)The known exploitation path of CVE-2026-109618Sansec warns that a single request can then consume all server memory. Do not use RLIMIT_AS/RLIMIT_DATA instead, as they can trigger the very same bug
post_max_size=8M (no file uploads) or 32M (with file uploads), and a smaller upload_max_filesizeNarrows the room for exhausting memoryOnly reduces risk
Block multipart/form-data at the web server or WAF if the application doesn't use itAccording to Sansec, every known trigger is a multipart/form-data requestBreaks file upload forms; only effective if the origin server cannot be reached directly
Cloudflare WAF rulesKnown exploitation vectorsAvailable to all customers, including the free plan; Cloudflare considers this a temporary measure

php.net itself writes that these measures "reduce exposure to specific attack paths but do not make an installation safe", and the advisory states plainly that "there is no complete generic configuration mitigation". VirusTotal adds an easily overlooked point: expose_php = Off only hides the version header, not the vulnerability.

Screen in a dark room showing multiple terminal panes with system logs, error codes and CPU and memory stats
Reviewing PHP and web server error logs is a mandatory step after patching. Photo: Tima Miroshnichenko / Pexels

How do you know if a server has been attacked?

Logs alone cannot tell you for certain, but there are a few signs worth checking right away. Datadog describes a PHP error log pattern like "Allowed memory size of … bytes exhausted … in Unknown on line 0" — the "Unknown on line 0" location means PHP failed during the request initialisation phase. When an exploit guesses an address wrong, Apache may log AH00052: child pid … exit signal Segmentation fault (11). A suspicious request may carry a field name about 3.5 MB long. The clearest sign of a successful attack is the web process spawning a shell.

But don't take comfort in seeing nothing: Datadog notes that a successful exploit does not necessarily crash the process or produce errors, and Rapid7 writes that "the absence of relevant log entries is not proof that an installation is safe". For CVE-2026-109619, Rapid7 advises reviewing early configuration warnings, shutdown notices, fatal errors and timeout errors. Because the bugs can expose passwords, session tokens, API keys and TLS private keys from other requests (according to Sansec), any suspect server should be treated as if its secrets have leaked, and those secrets replaced.

Lessons for businesses in Vietnam

php2shell is a reminder of an old truth: the biggest risk often sits in underlying software that nobody in the company pays attention to. PHP is used by 69.3% of websites whose server-side language can be identified (Tenable citing W3Techs), so almost every business has at least one PHP system — a company website, an online store, HR software, an internal portal. VirusTotal's figures are even more concerning: about 4 in 5 PHP servers hide their version, and about 758 thousand IP addresses still run end-of-life branches — systems that will never get an official patched release.

Three things worth doing for the long term, not just for this incident: (1) keep an up-to-date inventory of every system, its version and its owner; (2) don't leave systems running on end-of-life versions — the 8.2 branch reaches end of life on 31 December 2026, which means systems just patched to 8.2.35 also need an upgrade plan within the next two months; (3) keep internal systems off the public Internet when they don't need to be there. This is also why Namtech deploys internal AI on dedicated infrastructure that is not exposed to the Internet: the smaller the attack surface, the less panic episodes like php2shell cause.

php2shell (CVE-2026-109618 and CVE-2026-109619) is a pair of unauthenticated remote code execution vulnerabilities in PHP itself, affecting every version from 5.4 up to the patches of 21 October 2026; the only complete fix is to update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 and restart every PHP process.

Frequently asked questions

Is my WordPress website affected?

Possibly. The flaw is in PHP — the platform WordPress runs on — not in WordPress or its plugins. Tenable cites Calif's findings confirming pre-authentication remote code execution on certain versions of WordPress, Drupal, Joomla and Magento. What matters is the PHP version your server runs, not your WordPress version.

Which PHP version do I need to update to?

PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, depending on the branch you use. PHP 8.6.0 RC4 also includes the fix. The 8.1 branch and older have no official release and need to be upgraded to 8.2 or later. After updating, you must restart every PHP process.

Is disabling session.upload_progress enough to be safe?

No. According to php.net, this setting only blocks the confirmed session paths of CVE-2026-109619; it does not block other variants and has nothing to do with CVE-2026-109618. php.net states that only updating is a complete fix.

Is PHP-FPM safer than mod_php?

Lower risk, but not immune. PHP and Red Hat both rate mod_php as the highest risk. For CVE-2026-109618, PHP has not demonstrated a complete exploit on FPM; but for CVE-2026-109619, the session path has been confirmed to achieve remote code execution on both mod_php and FPM.

If my site is behind Cloudflare or a WAF, do I still need to patch?

Yes, you still need to patch. Cloudflare has deployed WAF rules for known exploitation vectors, including on the free plan, but considers them a temporary measure. VirusTotal notes that edge rules only work if the origin server cannot be reached directly. Sansec writes: don't wait for protection rules, update PHP.

Has anyone actually been attacked yet?

The sources do not yet agree. Cloudflare reported seeing early attacks at 07:43 UTC on 21 October (according to Sansec) and Datadog noted multiple reports of in-the-wild exploitation; meanwhile CISA had not observed any at the time of its alert and Huntress had not seen any on its customers' systems as of the afternoon of 21 October US time. It is best to assume attacks are imminent or already happening.

Security review of your company's web infrastructure

Namtech helps businesses inventory every website and application running PHP, verify versions and patches, check for signs of compromise, and set up a regular update process so you are not chasing every breaking news story.

Book a free consultation

Note: This article compiles public sources checked on 22 October 2026 and reflects the situation at that time — the story is still developing and information may change. Figures on the scale of impact are third-party measurements, with their sources and scope stated; figures on real-world attacks differ between sources. This information is for reference only and does not replace the assessment of the security team responsible for your systems.

Sources
Get started

Start with a free assessment

To define the right plan and detailed scope, Namtech offers a short, no-cost assessment session.

We reply within one business day. No spam, and we never share your details.