---
title: "PHP2Shell (CVE-2026-109618, CVE-2026-109619): affected versions, the patch, mitigations"
description: "PHP2Shell is two unauthenticated remote code execution bugs in PHP, CVE-2026-109618 and CVE-2026-109619, exploited in the wild. Fixed first in PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12; install 8.2.36, 8.3.37, 8.4.28 or 8.5.13. Affected versions, the patch itself, how to check, and what to do until you can upgrade."
cve: [CVE-2026-109618, CVE-2026-109619]
published: 2026-11-20
updated: 2026-11-23
canonical: https://yeet.cx/cve/CVE-2026-109618
---

# PHP2Shell (CVE-2026-109618, CVE-2026-109619)

PHP2Shell is the name for two memory-corruption bugs in the PHP runtime, CVE-2026-109618 and CVE-2026-109619, that let an attacker with no account run code on a web server by sending it HTTP requests. on apache with mod_php the confirmed attack runs before any application code does.

**what to do:** upgrade to PHP **8.2.36, 8.3.37, 8.4.28 or 8.5.13** and restart every PHP worker. the first fix shipped on 21 october 2026 in 8.2.35, 8.3.36, 8.4.27 and 8.5.12; the 19 november releases also fix CVE-2026-115560 on every branch and close a gap the first fix left on 8.3 and later.

- **severity:** 9.2 critical (CVSS 4.0)
- **access needed:** network, no login (anyone who can send the server an HTTP request)
- **exploited:** in the wild, on CISA's KEV list since 26 oct 2026, first attempt seen 17 oct 2026
- **install:** 8.5.13, 8.4.28, 8.3.37 or 8.2.36, the 19 nov 2026 releases (first fixed in 8.5.12, 8.4.27, 8.3.36 and 8.2.35)

## what is PHP2Shell?

PHP2Shell is two bugs with one root: PHP abandons a request partway through and leaves memory in a state the next piece of code trusts. both are in the runtime itself, so every application on an affected PHP is exposed, whatever framework or CMS it uses, and application logins do not stand in the way.

PHP says the risk covers "all PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed", and is highest for mod_php. code runs as the web worker account.

### CVE-2026-109618

- advisory: RCE via OOM corruption ([GHSA-w8hw-w9fx-j79w](https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w))
- CISA calls it: PHP Memory Corruption Vulnerability
- what goes wrong: when a request runs out of memory, PHP jumps straight out of whatever it was doing with `longjmp()`. if that happens while request memory is only half set up, the request's shutdown code reads memory that was never initialised.
- how it is reached: one request that pushes PHP past `memory_limit` while it parses the body: a multipart body with no declared length, a part carrying a flood of headers, or many empty file fields with deeply nested names.
- confirmed on: apache mod_php over HTTP, with default limits. PHP-FPM is susceptible by source analysis, with no complete exploit shown. FrankenPHP is likely susceptible.
- CVSS 4.0: 9.2 critical, scored by PHP (the CNA), `CVSS: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: 9.8 critical, scored by NVD, `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

### CVE-2026-109619

- advisory: RCE via stale global state ([GHSA-6wmf-4rv5-p3rp](https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp))
- CISA calls it: PHP Stale Internal Request-State Vulnerability
- what goes wrong: a PHP worker keeps global state between requests, and some of it points into one request's memory. when a request dies before that state is reset, the memory is freed but the pointer stays, and the next request on the same worker uses it: a use-after-free.
- how it is reached: two requests that land on the same worker. the confirmed routes are session upload progress, which is on by default and needs no `session_start()` in the application, and on PHP 8.5 the fatal-error backtrace.
- confirmed on: mod_php and PHP-FPM for the session route. mod_php for the PHP 8.5 backtrace route.
- CVSS 4.0: 9.2 critical, scored by PHP (the CNA), `CVSS: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: 8.1 high, scored by NVD, `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`

weakness classes on both records: CWE-416 Use After Free, CWE-755 Improper Handling of Exceptional Conditions, CWE-824 Access of Uninitialized Pointer, CWE-1325 Improperly Controlled Sequential Memory Allocation, CWE-1419 Incorrect Initialization of Resource.

## is PHP2Shell being exploited?

### timeline

- 2026-08-11: calif reports the first bug to PHP. wiz and openai report the same root cause independently in the following weeks. ([the PHP foundation](https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/))
- 2026-10-17: amazon's MadPot honeypots record the first exploitation attempt. ([amazon](https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/))
- 2026-10-18: the fix is committed to PHP's release branches. ([php-src](https://github.com/php/php-src/commit/3c832b523ee13b1a010177d2ff84aea18be0015e))
- 2026-10-20: the CVE numbers leak with a wrong score. PHP pre-announces and moves the release up by a day. ([the PHP foundation](https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/))
- 2026-10-21 14:00 UTC: PHP releases 8.2.35, 8.3.36, 8.4.27 and 8.5.12 and publishes both advisories. ([php.net](https://www.php.net/archive/2026.php#2026-10-21-5))
- 2026-10-23: PHP announces CVE-2026-115560, a separate bug in session upload progress, and advises turning the feature off. ([php.net](https://www.php.net/archive/2026.php#2026-10-23-1))
- 2026-10-26: CISA adds both CVEs to the known exploited vulnerabilities catalog, due 29 october. ([CISA](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-109619))
- 2026-10-29: unit 42 confirms exploitation of internet-exposed PAN-OS management interfaces. ([unit 42](https://unit42.paloaltonetworks.com/cve-2026-109618-cve-2026-109619/))
- 2026-11-19: PHP releases 8.2.36, 8.3.37, 8.4.28 and 8.5.13. they fix CVE-2026-115560 on every branch, and CVE-2026-129481, a gap the first fix left on 8.3 and later. ([PHP advisory](https://github.com/php/php-src/security/advisories/GHSA-g3vh-838c-65v7))

yes. CISA added both CVEs to its [known exploited vulnerabilities catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-109619) on 26 october 2026, with a 29 october deadline for US federal agencies.

exploitation started before the fix was public. [amazon's honeypots](https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/) recorded the first attempt on 17 october 2026, four days before PHP's release, so look for compromise from that date and not from the 21st.

[unit 42](https://unit42.paloaltonetworks.com/cve-2026-109618-cve-2026-109619/) reports PHP2Shell "being actively exploited against PAN-OS management interfaces that are exposed to the internet", in a campaign that chained it with a linux kernel privilege escalation to reach root.

most traffic is still probing. of the 89,575 requests [TU delft](https://php2shell.delftintellab.com/) counted, 68,286 were probes and 10,633 reached a code-execution step. PHP notes that exploit reliability depends on the PHP build, its extensions and the web server in front.

## the yeet programmable firewall

the upgrade is the fix. until it lands, the yeet programmable firewall blocks the request on the host, in the network driver, with no restart.

### virtual patch: PHP2Shell (php2shell.pfc)

```c
// php2shell.pfc: virtual patch for CVE-2026-109619 and
// CVE-2026-109618. Runs at XDP on the PHP host, on the
// cleartext hop behind TLS termination.
nocase;
reassemble 80;
pattern progress  = "PHP_SESSION_UPLOAD_PROGRESS";
pattern multipart = "multipart/form-data";
pattern chunked   = "transfer-encoding: chunked";
regex   nested    = "(\[[^\]\r\n]{0,4}\]){12}";

filter {
  if (proto != 6) decide pass;
  if (dport != 80) decide pass;
  if (len == 0) decide pass;

  mask m = within(payload, 2048);

  // CVE-2026-109619, session upload progress: the field that
  // reaches session handling before the request is initialised.
  // The wire form of session.upload_progress.enabled=0, with
  // no PHP worker restarted.
  if (any(m, progress)) {
    log(96);
    decide rst("php2shell_upload_progress", 0);
  }

  // CVE-2026-109618: a multipart body with no declared length
  // gets past the post_max_size check and keeps supplying data.
  if (all(m, multipart, chunked)) {
    log(96);
    decide rst("php2shell_unsized_multipart", 0);
  }

  // CVE-2026-109618: a field name nested twelve levels deep
  // multiplies the arrays PHP builds for every part.
  if (any(m, nested)) {
    log(96);
    decide rst("php2shell_nested_names", 0);
  }

  // PHP's advice for apps that take no uploads. Off until the
  // host sets it.
  if (knob("block_multipart") ?? 0 == 1) {
    if (any(m, multipart)) decide rst("multipart_blocked", 0);
  }

  decide pass;
}
```

36 instructions · 4 patterns · 385 DFA states.

- PHP2Shell-shaped request, no rule loaded: reached PHP
- the same request, rule loaded: blocked
- ordinary requests, rule loaded: 5 of 5 passed

tested on linux 6.12 against unpatched PHP 8.3.35, on 20 nov 2026.

[book a demo](https://yeet.cx/demo), or [learn more](https://yeet.cx/discover/programmable-firewall) about the yeet programmable firewall.

## which PHP versions are affected, and which fix it?

every supported branch was affected, and PHP fixed all four on 21 october 2026. install the 19 november 2026 release of your branch, which completes the fix.

| branch | vulnerable | first fixed | install now |
| --- | --- | --- | --- |
| PHP 8.5 | 8.5.0 to 8.5.11 | 8.5.12 | 8.5.13 |
| PHP 8.4 | 8.4.0 to 8.4.26 | 8.4.27 | 8.4.28 |
| PHP 8.3 | 8.3.0 to 8.3.35 | 8.3.36 | 8.3.37 |
| PHP 8.2 | 8.2.0 to 8.2.34 | 8.2.35 | 8.2.36 |
| PHP 8.1 and older (end of life) | all releases | no PHP release | a vendor backport, or 8.2 and later |

- PHP 8.1 and older: PHP published minimal source backports for 7.4, 8.0 and 8.1, and distributions and long-term-support vendors ship them as packages. NVD's affected ranges start at 7.3.0 for CVE-2026-109618 and 5.4.0 for CVE-2026-109619.

- PHP 8.5.0 through 8.5.11 are vulnerable to PHP2Shell. 8.5.12 is the first fixed release; install 8.5.13, which also fixes CVE-2026-115560, CVE-2026-129481 and CVE-2026-129182.
- PHP 8.4.0 through 8.4.26 are vulnerable to PHP2Shell. 8.4.27 is the first fixed release; install 8.4.28, which also fixes CVE-2026-115560 and CVE-2026-129481.
- PHP 8.3.0 through 8.3.35 are vulnerable to PHP2Shell. 8.3.36 is the first fixed release; install 8.3.37, which also fixes CVE-2026-115560 and CVE-2026-129481.
- PHP 8.2.0 through 8.2.34 are vulnerable to PHP2Shell. 8.2.35 is the first fixed release; install 8.2.36, which also fixes CVE-2026-115560.
- PHP 8.1 and older are end of life and vulnerable to PHP2Shell, and the PHP project released no fixed version for them.

### distribution packages

distributions patch their own PHP packages. some keep the old upstream version number, so `php -v` cannot tell you whether the fix is in.

| distribution | package | first fixed package | version number | advisory |
| --- | --- | --- | --- | --- |
| debian 13 | php8.4 | 8.4.27-1~deb13u1 | moves to the fixed release | [DSA-6574-1](https://security-tracker.debian.org/tracker/CVE-2026-109618) |
| debian 12 | php8.2 | 8.2.35-1~deb12u1 | moves to the fixed release | [DLA-4848-1](https://security-tracker.debian.org/tracker/CVE-2026-109618) |
| ubuntu 24.04 | php8.3 | 8.3.6-0ubuntu0.24.04.13 | stays the same | [USN-8948-1](https://ubuntu.com/security/notices/USN-8948-1) |
| ubuntu 22.04 | php8.1 | 8.1.2-1ubuntu2.28 | stays the same | [USN-8948-1](https://ubuntu.com/security/notices/USN-8948-1) |
| RHEL 10 | php | 8.3.36-1.el10_2 | moves to the fixed release | [RHSA-2026:87070](https://access.redhat.com/errata/RHSA-2026:87070) |
| RHEL 9 | php:8.3 module | 8.3.36-1.module+el9.8.0+25109+6886e21a | moves to the fixed release | [RHSA-2026:87079](https://access.redhat.com/errata/RHSA-2026:87079) |

PHP also ships inside appliances and management interfaces you cannot upgrade yourself. [NCSC-NL's inventory](https://github.com/NCSC-NL/php2shell) tracked 976 products on 18 november 2026: 218 fixed and 211 still vulnerable. for those, apply the vendor's update or take the interface off the network.

## how do I check whether my PHP is patched?

check the PHP that serves web requests. the `php` on your shell's path can be a different build from the one PHP-FPM or apache loads.

### read the version

enough when you install PHP's own releases or the official container images. run it for the binary that serves requests.

php:

```sh
php -v | head -1
```

php-fpm:

```sh
php-fpm8.3 -v | head -1
```

- vulnerable: `PHP 8.3.35 (cli) (built: Sep 25 2026 17:43:54) (NTS)`
- first fix: `PHP 8.3.36 (cli) (built: Nov  5 2026 20:30:59) (NTS)`

tested: output from the official `php:8.3.35-cli-alpine` and `php:8.3.36-cli-alpine` images.

### ask the build whether it has the fix

works on PHP 8.2 and later, including backports where the version number does not move. the fix commit adds an INI setting, `memory_hard_limit_percent`, so a build that knows the setting carries the october fix. it says nothing about the november follow-ups.

```sh
php -r 'var_dump(ini_get("memory_hard_limit_percent"));'
```

- no fix: `bool(false)`
- fix present: `string(0) ""`

tested: we ran it on the official 8.3.35 and 8.3.36 images and on patched ubuntu 24.04, debian 12 and debian 13 packages. it does not work on PHP 8.1 and older: the minimal backport leaves the setting out, so ubuntu 22.04's patched PHP 8.1 still prints `bool(false)`. use the changelog there.

### read the package changelog

the distribution's own record of what a package fixes, and the check to use on PHP 8.1 and older.

debian, ubuntu:

```sh
apt changelog php8.3-cli | grep -E 'CVE-2026-10961[89]'
```

RHEL, fedora:

```sh
rpm -q --changelog php-cli | grep -E 'CVE-2026-10961[89]'
```

- patched: `- debian/patches/CVE-2026-109618_109619.patch: Avoid state corruption via`
- not patched: `no output`

tested: output from ubuntu 24.04 (`php8.3-cli`) and ubuntu 22.04 (`php8.1-cli`).

### restart every worker

PHP-FPM and apache keep the old code in memory until they restart. a reload is not enough for the configuration mitigations either.

PHP-FPM:

```sh
systemctl restart php8.3-fpm
```

apache mod_php:

```sh
systemctl restart apache2
```

## the patch

commit "Avoid state corruption via bailout" by Arnaud Le Blanc, 18 oct 2026: 392 files, 270 of them tests, +10833 -1020. [PHP 8.5 31c0ea7d7ff1](https://github.com/php/php-src/commit/31c0ea7d7ff1d1fccb6492e52dab544011628065), [PHP 8.4 506e87fa7dcd](https://github.com/php/php-src/commit/506e87fa7dcdd306975e5b8f8265ee03527aacbf), [PHP 8.3 3c832b523ee1](https://github.com/php/php-src/commit/3c832b523ee13b1a010177d2ff84aea18be0015e), [PHP 8.2 01a40e89fbfc](https://github.com/php/php-src/commit/01a40e89fbfc499936e3b05888d8f00bfde886df).

one commit fixes both CVEs on every supported branch. on PHP 8.3 it changes 392 files, 270 of them tests, adding 10,833 lines and removing 1,020. the excerpts below are copied from that commit.

**for CVE-2026-109618**, running out of memory no longer jumps out of the code that was running. the allocator records a pending error and lets that code finish, and the request ends at the next safe point. a second, higher limit ends the process outright with `_exit(137)`.

**for CVE-2026-109619**, request shutdown now clears the globals that code can reach before the next request has started up, and the session upload-progress handler resets its own state before it touches a session.

the multipart parser also loses what made the out-of-memory condition easy to reach: it stops reading once a body runs past `post_max_size`, and it keeps only the two part headers it uses.

### Zend/zend_alloc.c (CVE-2026-109618, +527 -124)

the old out-of-memory handler raised the error and called `zend_bailout()`, a `longjmp()` out of whatever was running. the new one records a pending error and returns. past the hard limit the process exits.

```diff
@@ -368,31 +380,160 @@ static ZEND_COLD ZEND_NORETURN void zend_mm_panic(const char *message)
 	abort();
 }
 
-static ZEND_COLD ZEND_NORETURN void zend_mm_safe_error(zend_mm_heap *heap,
-	const char *format,
-	size_t limit,
  [...]
-	size_t size)
+static ZEND_COLD ZEND_NORETURN void zend_out_of_memory(void);
+
+static ZEND_COLD void zend_mm_delayed_verror(const char *format, va_list args)
 {
+	if (ZEND_HAS_OOM()) {
+		return;
+	}
 
-	heap->overflow = 1;
-	zend_try {
-		zend_error_noreturn(E_ERROR,
  [...]
-	} zend_catch {
-	}  zend_end_try();
-	heap->overflow = 0;
-	zend_bailout();
-	exit(1);
  [...]
+	EG(delayed_oom).state = ZEND_OOM_STATE_PENDING;
+
+	zend_atomic_bool_store_ex(&EG(vm_interrupt), true);
+}
  [...]
+static ZEND_COLD ZEND_NORETURN void zend_mm_hard_limit_error(zend_mm_heap *heap,
+		size_t add_size ZEND_FILE_LINE_DC)
+{
  [...]
+	_exit(137);
+}
```

### main/rfc1867.c (CVE-2026-109618, +188 -27)

the multipart parser stops reading a body that has run past `post_max_size`, and stores only `Content-Disposition` and `Content-Type` from each part, once.

```diff
@@ -220,6 +223,10 @@ static int fill_buffer(multipart_buffer *self)
 
 	self->buf_begin = self->buffer;
 
+	if (SG(post_max_size) > 0 && SG(read_post_bytes) > SG(post_max_size)) {
+		return 0;
+	}
+
 	/* calculate the free space in the buffer */
 	bytes_to_read = self->bufsize - self->bytes_in_buffer;
@@ -367,6 +374,14 @@ static int find_boundary(multipart_buffer *self, char *boundary)
 	return 0;
 }
 
+static bool php_mime_should_save_hdr(const char *name)
+{
+	return !strcasecmp(name, "Content-Disposition")
+		|| !strcasecmp(name, "Content-Type");
+}
@@ -407,15 +422,25 @@ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header)
 			}
 
 			*value = '\0';
-			do { value++; } while (isspace((unsigned char)*value));
 
-			key = estrdup(line);
-			smart_string_appends(&buf_value, value);
+			/* Keep only headers we use, and ignore duplicates */
+			if (!php_mime_should_save_hdr(line)
+					|| php_mime_get_hdr_value(*header, line)) {
+				key = NULL;
+			} else {
+				key = estrdup(line);
+				do { value++; } while (isspace((unsigned char)*value));
+				smart_string_appends(&buf_value, value);
+			}
```

### main/main.c (CVE-2026-109619, +48 -2)

request shutdown clears state that the next request can reach before its own startup. the first hunk is the new setting the patched-build check above looks for.

```diff
@@ -754,6 +778,7 @@ PHP_INI_BEGIN()
 	STD_PHP_INI_ENTRY("mail.log",					NULL,		PHP_INI_SYSTEM|PHP_INI_PERDIR,		OnUpdateMailLog,			mail_log,			php_core_globals,	core_globals)
 	PHP_INI_ENTRY("browscap",					NULL,		PHP_INI_SYSTEM,		OnChangeBrowscap)
 	PHP_INI_ENTRY("memory_limit",				"128M",		PHP_INI_ALL,		OnChangeMemoryLimit)
+	PHP_INI_ENTRY("memory_hard_limit_percent",	NULL,		PHP_INI_ALL,		OnChangeMemoryHardLimitPercent)
@@ -1905,6 +1944,8 @@ void php_request_shutdown(void *dummy)
 
 		for (i=0; i<NUM_TRACK_VARS; i++) {
 			zval_ptr_dtor(&PG(http_globals)[i]);
+			/* May be accessed before php_request_startup() */
+			ZVAL_UNDEF(&PG(http_globals)[i]);
 		}
 	} zend_end_try();
@@ -1937,9 +1978,11 @@ void php_request_shutdown(void *dummy)
 	/* 15. Free Willy (here be crashes) */
 	zend_arena_destroy(CG(arena));
 	zend_interned_strings_deactivate();
+	clear_last_error();
 	zend_try {
 		shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0);
 	} zend_end_try();
+	EG(delayed_oom).state = ZEND_OOM_STATE_NONE;
@@ -1960,6 +2003,9 @@ void php_request_shutdown(void *dummy)
  [...]
 #endif /* HAVE_DTRACE */
+
+	/* May be accessed before php_request_startup() */
+	PG(modules_activated) = 0;
 }
```

### ext/session/session.c (CVE-2026-109619, +56 -11)

upload progress runs before the session module is initialised for the request. it now resets the session globals first, and stops if the session did not come up cleanly.

```diff
@@ -3070,8 +3093,12 @@ static void php_session_rfc1867_update(php_session_rfc1867_progress *progress, i
 		progress->next_update = Z_LVAL_P(progress->post_bytes_processed) + progress->update_step;
 	}
 
-	php_session_initialize();
-	PS(session_status) = php_session_active;
+	/* Runs before RINIT: no user code may be invoked, see php_session_unserialize_init() */
+	PS(in_rfc1867_update) = true;
+	if (php_session_initialize() == FAILURE || PS(session_status) != php_session_active) {
+		PS(in_rfc1867_update) = false;
+		return;
+	}
@@ -3106,12 +3138,20 @@ static zend_result php_session_rfc1867_callback(unsigned int event, void *event_
 	if (!PS(rfc1867_enabled)) {
 		return retval;
 	}
+	if (PG(modules_activated)) {
+		/* request_parse_body(). Do not run here as it corrupts the session. */
+		return retval;
+	}
 
 	progress = PS(rfc1867_progress);
 
 	switch(event) {
 		case MULTIPART_EVENT_START: {
 			multipart_event_start *data = (multipart_event_start *) event_data;
+
+			/* This runs before RINIT, so we need to clear these early */
+			php_rinit_session_globals();
```

### what changes for you after the upgrade

- a new INI setting, `memory_hard_limit_percent`. left unset, the hard limit is 200% of `memory_limit` below 1 GB and `memory_limit` plus 1 GB above that.
- a request that reaches the hard limit ends the worker with exit status 137, and its shutdown handlers do not run.

## how do I detect PHP2Shell attempts?

no single signal is proof either way. PHP's advisory warns that "absence of an error in logs is not proof of safety", and each request shape below also has legitimate uses.

- (request) a multipart POST carrying the upload-progress field, by default `PHP_SESSION_UPLOAD_PROGRESS`. applications that use upload progress send it too.

  ```
  Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"
  ```

- (request) `multipart/form-data` sent with `Transfer-Encoding: chunked` or with no `Content-Length`.

  ```
  Content-Type: multipart/form-data; boundary=...
Transfer-Encoding: chunked
  ```

- (request) hundreds of parts in a small body, many empty file fields, field names nested many levels deep, or a flood of header lines inside one part. body size alone tells you little: TU delft saw a body of 1 MB or more in only 424 of 89,575 requests.
- (log) PHP fatal errors for exhausted memory on requests that never reached a script, and runs of HTTP 500 or worker restarts right after multipart requests.

  ```
  PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes)
  ```

- (process) a shell or downloader such as `sh`, `curl` or `wget` started by the web server or PHP-FPM account. this is evidence the attack already worked. the host needs incident response, not a filter.

### public detection rules

| rule set | rules | source |
| --- | --- | --- |
| emerging threats open (suricata) | SIDs 2072548 to 2072554, 2072556, 2072557 | [rules file](https://rules.emergingthreats.net/open/suricata-7.0.3/rules/emerging-exploit.rules) |
| cloudflare managed rules | PHP Remote Code Execution Attack (CVE-2026-109618, CVE-2026-109619) #1 to #7 | [cloudflare](https://blog.cloudflare.com/php-vulnerabilities-waf-protection/) |
| nuclei templates | CVE-2026-109618.yaml, CVE-2026-109619.yaml | [projectdiscovery](https://github.com/projectdiscovery/nuclei-templates/tree/main/http/cves/2026) |
| corelight (zeek and suricata) | php2shell-detect | [corelight](https://github.com/corelight/php2shell-detect) |

## what can I do if I can't upgrade PHP yet?

PHP's own advisories say only the upgrade is complete: "There is no complete generic configuration mitigation". each stopgap below closes one route and leaves others open, so stack the ones that fit.

| stopgap | closes | leaves open | what it costs | source |
| --- | --- | --- | --- | --- |
| set `session.upload_progress.enabled=0` | the confirmed session routes of CVE-2026-109619 | other variants, by PHP's account | upload progress reporting stops. set it with `php_admin_value` so the application cannot turn it back on, then restart every worker | [PHP advisory](https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp) |
| on PHP 8.5, set `fatal_error_backtraces=0` | the confirmed fatal-backtrace route of CVE-2026-109619 | every other piece of request state | a restart of every worker | [PHP advisory](https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp) |
| set `memory_limit=-1` | the controllable out-of-memory failure behind CVE-2026-109618 | a failed `mmap()` still reaches the bug | PHP stops limiting its own memory. put a cgroup limit around the workers first, and never use `RLIMIT_AS` or `RLIMIT_DATA` | [PHP advisory](https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w) |
| block `multipart/form-data` at the web server | the multipart routes into both bugs | application paths that exhaust memory another way | every file upload breaks. PHP suggests it only for applications that take none | [PHP advisory](https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w) |
| turn on your edge WAF's PHP2Shell rule | known request shapes that cross the edge | requests that reach the origin directly, service-to-service traffic, and on cloudflare an upload-progress field you renamed | none if you already route through it | [cloudflare](https://blog.cloudflare.com/php-vulnerabilities-waf-protection/) |
| run a virtual patch on the PHP host ([see above](#stop-it-at-the-kernel)) | the known request shapes, on every route into the host | traffic that reaches the host encrypted, variants the rule does not name, and fields placed past the first 2 KB of the request | no PHP restart. TLS has to end before the host | yeet |

## PHP2Shell questions

### is PHP 8.3.35 vulnerable to PHP2Shell?

yes. PHP 8.3.0 through 8.3.35 are vulnerable. 8.3.36 carries the first fix, and 8.3.37 also fixes CVE-2026-115560 and CVE-2026-129481, so install 8.3.37.

### which PHP versions fix CVE-2026-109618 and CVE-2026-109619?

PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12, released on 21 october 2026, fix both. PHP 8.2.36, 8.3.37, 8.4.28 and 8.5.13, released on 19 november 2026, also fix CVE-2026-115560, a session upload progress bug, and on 8.3 and later a gap the first patch left (CVE-2026-129481), so those are the versions to install.

### does PHP2Shell affect nginx with PHP-FPM, or only apache with mod_php?

both. mod_php carries the highest risk: the out-of-memory bug was exploited over HTTP there with default settings, before any application code ran. on PHP-FPM the session route of CVE-2026-109619 was validated, and CVE-2026-109618 is susceptible by source analysis with no complete exploit shown. plan as if PHP-FPM is affected.

### does an attacker need to be logged in to exploit PHP2Shell?

no. both bugs are in the PHP runtime and are reached while PHP parses the request, so an application's own login does not stand in the way.

### does setting session.upload_progress.enabled=0 stop PHP2Shell?

partly. it blocks the confirmed session routes of CVE-2026-109619 and nothing else: not CVE-2026-109618, and not the other ways stale state can be reached. set it where the application cannot override it and restart every worker. PHP suggests leaving it off even after you upgrade if you do not use the feature.

### I'm on ubuntu 24.04 and php -v says 8.3.6. am I patched for PHP2Shell?

you can be. ubuntu backported the fix into `8.3.6-0ubuntu0.24.04.13` without changing the upstream version number. check the package version with `dpkg -s php8.3-cli`, or run `php -r 'var_dump(ini_get("memory_hard_limit_percent"));'`: a patched build prints a string, an unpatched one prints `bool(false)`. that test works on PHP 8.2 and later.

### do I need to restart PHP-FPM after installing the PHP2Shell fix?

yes. running PHP-FPM and apache workers keep the old code in memory until they restart, and a reload is not enough.

### is PHP 7.4 or 8.1 affected by PHP2Shell, and is there a patch?

yes, and not from PHP as a release. PHP 8.1 and older are end of life. PHP published minimal source backports for 7.4, 8.0 and 8.1, and distributions and long-term-support vendors ship them: ubuntu 22.04's PHP 8.1 is fixed in `8.1.2-1ubuntu2.28`. where no backport exists, move to a supported branch or take the system off the network.

### can a WAF or cloudflare protect me from PHP2Shell?

for the traffic that crosses it, against the request shapes it knows. an edge rule does not see requests that reach your origin directly or traffic between your own services, and cloudflare notes its rule does not cover an upload-progress field you renamed. keep the rule on and upgrade anyway.

### does updating wordpress, drupal or laravel fix PHP2Shell?

no. the bugs are in PHP itself, underneath the application. update PHP.

### what is the difference between CVE-2026-109618 and CVE-2026-109619?

CVE-2026-109618 is one request: it runs PHP out of memory at a moment when request memory is half initialised. CVE-2026-109619 is two requests on the same worker: the first leaves a pointer to freed memory behind and the second uses it. one commit fixes both.

### is there a public exploit for PHP2Shell?

proof-of-concept code is public and in use: TU delft counted 10,633 requests that reached a code-execution step between 21 october and 19 november 2026. PHP says reliability depends on the PHP build, its extensions, the web server and the memory layout.

### what are the limits of blocking PHP2Shell at the kernel?

it is cover, not the fix: PHP still has the bug, and a request shaped differently from the rule gets through. the rule reads cleartext, so TLS has to end before the PHP host, at a load balancer, CDN or sidecar. it can stop real traffic that looks the same (an application that uses upload progress, sends chunked multipart uploads or nests form fields twelve deep), which is what monitor mode is for. it needs linux 6.1 or later, or a red hat enterprise linux kernel, on hosts you run. our test used the request shapes PHP's advisories describe, not a working exploit.

### can I block PHP2Shell without restarting PHP?

yes, in front of PHP. every configuration mitigation needs a restart of every worker. a rule on the request path does not: an edge WAF rule, a web-server block on multipart requests, or a virtual patch on the PHP host such as the yeet programmable firewall, which goes live in milliseconds and also sees requests that skipped the edge.

## sources

- [PHP security advisory: RCE via OOM corruption](https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w): CVE-2026-109618
- [PHP security advisory: RCE via stale global state](https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp): CVE-2026-109619
- [php.net: critical remote code execution vulnerabilities, update now](https://www.php.net/archive/2026.php#2026-10-21-5): release announcement, 21 oct 2026
- [php-src: Avoid state corruption via bailout](https://github.com/php/php-src/commit/3c832b523ee13b1a010177d2ff84aea18be0015e): the fix, PHP 8.3 branch
- [PHP security advisory: use-after-free after interrupted session shutdown](https://github.com/php/php-src/security/advisories/GHSA-g3vh-838c-65v7): CVE-2026-129481, the incomplete fix
- [the PHP foundation: today's PHP security release](https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/): discovery and disclosure account
- [CISA known exploited vulnerabilities catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-109619): added 26 oct 2026
- [CISA alert: critical vulnerabilities in PHP require immediate patching](https://www.cisa.gov/news-events/alerts/2026/10/21/critical-vulnerabilities-php-require-immediate-patching): 21 oct 2026
- [NVD: CVE-2026-109618](https://nvd.nist.gov/vuln/detail/CVE-2026-109618): CVSS 3.1 9.8
- [NVD: CVE-2026-109619](https://nvd.nist.gov/vuln/detail/CVE-2026-109619): CVSS 3.1 8.1
- [NCSC-NL: php2shell](https://github.com/NCSC-NL/php2shell): inventory of products that embed PHP
- [calif: PHP2Shell](https://calif.io/php2shell/): the first reporter's write-up
- [wiz: php2shell.com](https://www.php2shell.com/): origin of the name
- [TU delft: PHP2Shell exploitation tracker](https://php2shell.delftintellab.com/): live honeypot counts
- [amazon: PHP2Shell exploitation prior to public disclosure](https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/): first attempt, 17 oct 2026
- [unit 42: threat brief](https://unit42.paloaltonetworks.com/cve-2026-109618-cve-2026-109619/): PAN-OS exploitation
- [cloudflare: PHP vulnerabilities and WAF protection](https://blog.cloudflare.com/php-vulnerabilities-waf-protection/): edge rule coverage and its limit
- [ubuntu: USN-8948-1](https://ubuntu.com/security/notices/USN-8948-1): package versions
- [debian security tracker](https://security-tracker.debian.org/tracker/CVE-2026-109618): package versions

## changelog and credits

- 2026-11-20: page published. facts checked against PHP's advisories, the fix commit, NVD and CISA KEV catalog 2026.11.18. firewall rule tested on linux 6.12 against PHP 8.3.35.
- 2026-11-23: the 19 november releases also fix CVE-2026-115560 on every branch, 8.2 included. the fix commit's test count corrected to 270. the virtual patch now shows its rule and says it covers the known request shapes. checked against CVE.org and KEV catalog 2026.11.23.

reported by `Ryan at Calif.io`, `Wiz` and `OpenAI`, and fixed by `Arnaud Le Blanc`, `Ilija Tovilo`, `Jakub Zelenka` and `Nora Dossche`, as the CVE records credit them. the researchers named it PHP2Shell.

this page is maintained by yeet, which makes the yeet programmable firewall. we are not affiliated with PHP or with the researchers. [tell us](https://yeet.cx/contact) if something here is wrong.
