Skip to content
Blog

PHP · PHP2Shell · RCE

PHP2Shell: Two Critical Flaws in PHP Itself (CVE-2026-109618 and CVE-2026-109619), Update Now

CVE-2026-109618 and CVE-2026-109619 (9.2): unauthenticated remote code execution in the PHP engine. Fixed in 8.5.12, 8.4.27, 8.3.36 and 8.2.35.

Updated 7 min readCVE-2026-109618CVE-2026-109619

On October 21, 2026, the PHP project shipped security releases for two critical flaws in the PHP engine itself, grouped by their discoverers under the name PHP2Shell. This isn't a plugin, a framework or a CMS: it's the interpreter that runs WordPress, Drupal, Magento, Laravel and most of the web.

PHP's advisory leaves no room for doubt: every PHP installation serving web requests is in scope, and the only complete answer is to update.

Update, October 22. NVD has analyzed both CVEs: an NVD score of 9.8 in CVSS 3.1 and official version bounds (below). watchTowr says it is observing exploitation attempts against both flaws. No successful compromise has been publicly confirmed, and CISA hasn't added them to its KEV catalog.

FieldValue
CVECVE-2026-109618, CVE-2026-109619
CVSS 4.0 (PHP)9.2 (CRITICAL) each
4.0 vectorCVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
CVSS 3.1 (NVD)9.8 (CRITICAL) each
3.1 vectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
TypeUse after free, uninitialized memory (CWE-416, CWE-824)
AuthenticationNone
NVD publication2026-10-21, analyzed by NVD the same day
Fixed versions8.5.12, 8.4.27, 8.3.36, 8.2.35
Discovered byWiz Research

Two scores coexist: 9.2 is the PHP security team's, in CVSS 4.0; 9.8 is NVD's, in CVSS 3.1. The gap is mostly about attack complexity: PHP rates it high (AC:H), NVD low (AC:L).


The Two Flaws

CVE-2026-109618 — corruption after running out of memory. When PHP hits its memory limit, it aborts the current request by jumping straight out of the execution context. Some contexts then leave request memory uninitialized, and the cleanup that follows can read that invalid data as if it were valid. According to NVD, several ways of triggering the out-of-memory condition reliably lead to code execution.

CVE-2026-109619 — stale global state. PHP keeps global pointers that temporarily point into a request's memory. In some cases they aren't reset, or are repopulated after being reset. The next request handled by the same worker can then read that state, which points to memory already freed.

Why this is serious

  • No application code is needed. Wiz says a plain "Hello World" page on an affected version can be vulnerable: the flaws sit below the application.
  • No authentication. Both are remotely exploitable without an account.
  • mod_php is the most exposed setup. PHP's advisory cites a demonstrated exploit in which an unauthenticated request triggers the attack before any application code runs.
  • The footprint is huge. Wiz writes that every version released in the last decade is affected by at least one of the two flaws, going back to the 5.4 branch.

PHP's vector shows high attack complexity and attack prerequisites (AT:P): exploitation depends on memory and worker state. That's no barrier to an attacker holding a working exploit — and NVD, for its part, doesn't factor that complexity in.

Exploitation

Status as of October 22:

  • watchTowr says it is observing active exploitation attempts against both CVEs, without saying whether any succeeded.
  • Other security vendors report probing and attempts, but no confirmed compromise yet; some see none across their customers.
  • Details circulated before the official release, which was brought forward by a day according to trade press.
  • CISA hasn't added them to its KEV catalog: that would be the official confirmation of real-world exploitation.

With an exploit demonstrated by the researchers, observed attempts and this footprint, treat the update as an emergency, and consider any internet-facing PHP server left unpatched since October 21 as suspect.


Fixed Versions

BranchFixed version
8.58.5.12
8.48.4.27
8.38.3.36
8.28.2.35 (end of life on December 31, 2026)
8.1 and olderno official fix from the PHP project

NVD bounds. NVD considers vulnerable every version before 8.2.35 (including 8.1, 8.0, 7.x and 5.x), then 8.3.0 to 8.3.35, 8.4.0 to 8.4.26 and 8.5.0 to 8.5.11. These are bounds: for a distribution build (Debian, Ubuntu, RHEL packages…), the patched package version announced by the distribution is what counts, not the number PHP reports.

End-of-life branches. The PHP project no longer ships releases for 8.1 and older. It provided minimal source fixes as branches for 7.4, 8.0 and 8.1, and some distributions and extended-support vendors ship their own patched packages. Otherwise, the answer is a migration to a maintained branch.

Distribution packages. Linux distributions and extended-support vendors received the fixes in advance: check your package manager for updates. If you use the community repository rpms.remirepo.net, PHP's advisory says it won't have updates on release day and recommends switching to distribution packages or building from source.

Check the version your web server actually runs, not just the command-line one — they often differ:

php -v
php-fpm -v            # or php-fpm8.3 -v, depending on the distribution
apachectl -M | grep -i php   # is mod_php loaded?

A temporary phpinfo() page, deleted right after, shows the version the server actually loads.


Interim Measures If the Update Has to Wait

PHP's advisory is explicit: these measures reduce exposure to specific attack paths but do not make an installation safe. They belong in php.ini, the FPM pool or the web server configuration — not ini_set() or .user.ini — and every PHP worker must be restarted.

Against CVE-2026-109619:

session.upload_progress.enabled = 0
; PHP 8.5 only:
fatal_error_backtraces = 0

The first one blocks the confirmed session-based paths, not other variants.

Against CVE-2026-109618:

; No file uploads needed:
post_max_size = 8M
; File uploads needed:
post_max_size = 32M
; keep upload_max_filesize below post_max_size

The advisory also recommends memory_limit=-1 enforced so applications can't override it (for example php_admin_value in the FPM pool), a container or cgroup memory limit as an availability boundary, and limits at the web server or proxy on request size, field count and multipart part count. It warns against RLIMIT_AS and RLIMIT_DATA, which can cause the very allocation failure the attack relies on.


Detection

Wiz notes that application logs carry little context, since everything happens below the application. Signals to watch:

  • Unusual multipart requests followed by memory-limit errors (Allowed memory size … exhausted) or bursts of HTTP 500 errors;
  • Unusually long or malformed PHPSESSID cookies in responses;
  • Unexplained PHP-FPM worker or Apache child restarts.

Mitigation, in Order

  1. Inventory every server running PHP for the web, including the forgotten ones: intranet, old WordPress sites, internal tools.
  2. Update to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or to your distribution's patched package, then restart PHP-FPM or Apache.
  3. Start with mod_php and internet-facing servers.
  4. Apply the interim measures where the update can't happen right away, keeping in mind they aren't enough.
  5. Plan the move off 8.1 and older branches.

Frequently Asked Questions

Is my WordPress site affected? Yes, if the PHP version running it is vulnerable — the WordPress version makes no difference. Wiz says it confirmed unauthenticated code execution against WordPress and Drupal. On shared or managed hosting, the host updates PHP: check with them.

How do I find out which PHP version I'm running? In WordPress: Tools > Site Health > Info > Server. Elsewhere, a temporary phpinfo() page or the commands above. Beware: the command-line version can differ from the web server's.

I'm on PHP 7.4, 8.0 or 8.1: what now? These branches have no official fixed release. Minimal source fixes exist if you build PHP yourself, and some distributions ship their own patched packages. The only lasting fix is moving to a maintained branch.

Are command-line scripts affected? PHP's advisory targets installations serving web requests (PHP-FPM, mod_php, php-cgi, FrankenPHP, LiteSpeed). It doesn't mention the command line, but there's no reason to keep a vulnerable version there either.

Are a WAF or the interim measures enough? No. PHP's advisory is explicit: they reduce specific attack paths but don't make an installation safe. Only the update fixes it.


Why Continuous Monitoring of Your PHP Versions Matters

PHP is often the dependency nobody inventories: installed with the OS, updated "when someone remembers", and its version differs from one server to the next. A flaw in the engine then hits everything running on it, all at once.

With cveo.tech, add your servers and their PHP versions to your inventory, and get an alert as soon as a critical CVE affects them — including while it's still awaiting NVD analysis.

Running PHP servers? Know which CVEs hit your version.

Add the product and its version: cveo.tech lists the CVEs that affect it right away, then alerts you by email when a new one affects it — including before NVD has finished its analysis. Free, an account is all it takes.

Every Monday

The week's critical CVEs, in your inbox

One email a week: the CVSS ≥ 9 vulnerabilities published in the last seven days, plus our latest analyses. Nothing else.

Double opt-in by email. Unsubscribe in one click, any time.