> ## Documentation Index
> Fetch the complete documentation index at: https://blog.onetsolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP-FPM request smuggling (CVE-2026-129289): critical RCE fix

> PHP-FPM flaw CVE-2026-129289 allows unauthenticated code execution when nginx or Apache reuses FastCGI connections. Fixed versions, packages and mitigation.

*Published on November 21, 2026*

> [!WARNING]
>
> **CVE-2026-129289 — PHP-FPM, CVSS v4.0 9.2.** An unauthenticated attacker can make a PHP-FPM pool run their own PHP code, with a single request, when the web server in front of PHP reuses its FastCGI connections. Fixed in **PHP 8.5.13, 8.4.28, 8.3.37 and 8.2.36**, released on November 19, 2026. If your nginx or Apache keeps its connections to PHP-FPM open, update today or turn that reuse off in the meantime.

## The bug in two sentences

When an application opens `php://input` without reading the request body to the end, PHP does not discard the leftover bytes when the request finishes. If the FastCGI connection is reused, PHP-FPM reads those bytes as a new request: the attacker plants a forged FastCGI request in them, with parameters of their choosing, including `SCRIPT_FILENAME`, `REMOTE_ADDR` and `PHP_ADMIN_VALUE`.

According to the PHP advisory, a single crafted `multipart/form-data` request is enough. Through `PHP_ADMIN_VALUE`, the attacker turns on `allow_url_include` and points `auto_prepend_file` at `php://input`: PHP then runs whatever they send, with the worker's privileges. Settings changed this way can persist for later requests on the same worker.

This is an HTTP request smuggling flaw (CWE-444). It also lets an attacker forge the client address, to get around IP-based access controls, and call existing scripts outside the routes the web server defines.

Affected versions:

* **PHP before 8.2.36**;
* **PHP 8.3.0 through 8.3.36**, fixed in **8.3.37**;
* **PHP 8.4.0 through 8.4.27**, fixed in **8.4.28**;
* **PHP 8.5.0 through 8.5.12**, fixed in **8.5.13**.

The PHP team says the faulty code has been there since PHP 5.6.0.

The PHP project scores the flaw **9.2** in CVSS 4.0 (`AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`); NVD carries the same score. Red Hat rates it "Critical" with 8.1 in CVSS 3.1, Ubuntu medium priority. The full advisory is [GHSA-qc49-hpvq-g2w6](https://github.com/php/php-src/security/advisories/GHSA-qc49-hpvq-g2w6).

> [!NOTE]
>
> The flaw is not in CISA's KEV catalog (November 20, 2026 version). CISA reports no exploitation so far, but rates the attack as automatable. The same PHP release fixes 18 flaws, several others of them rated critical.

## Sizing your exposure

The question to ask: **does your web server reuse its connections to PHP-FPM?** That is not the default in nginx or Apache. A standard setup, which closes the FastCGI connection after each request, is not exposed to the demonstrated attack.

| Profile | Exposure | Action |
| - | - | - |
| nginx with `fastcgi_keep_conn on`, in front of PHP-FPM | **Critical**: unauthenticated code execution | Update today; if you can't, set `fastcgi_keep_conn` back to `off` |
| Apache `mod_proxy_fcgi` with `enablereuse=on` | **Critical** | Update today; if you can't, remove `enablereuse=on` |
| HAProxy or another FastCGI frontend that keeps connections | **Critical** | Update; if you can't, close the connection after each request |
| PHP-FPM port reachable from the Internet | **Critical** | Bind it to `127.0.0.1` or a Unix socket, then update |
| nginx or Apache with default settings | Not exposed to the demonstrated attack | Update anyway: the release fixes other flaws |
| LiteSpeed (LSAPI) | Later requests can be disrupted; code execution not established | Update |

To find out whether your web server reuses connections, look for the relevant directives in the loaded configuration:

```bash theme={null}
# nginx: full effective configuration (no "on" line expected)
sudo nginx -T 2>/dev/null | grep -n 'fastcgi_keep_conn'

# Apache: ProxyPass, <Proxy> and SetHandler (Debian, Ubuntu then RHEL, AlmaLinux)
sudo grep -rniE 'enablereuse' /etc/apache2 /etc/httpd 2>/dev/null
```

A `fastcgi_keep_conn on;` line or an `enablereuse=on` parameter means the connection to PHP-FPM is reused.

Also check that PHP-FPM does not listen on a public interface:

```bash theme={null}
# Pool listen addresses (Debian, Ubuntu then RHEL, AlmaLinux)
sudo grep -rnE '^\s*listen\s*=' /etc/php/*/fpm/pool.d/ /etc/php-fpm.d/ 2>/dev/null

# TCP ports opened by PHP-FPM
sudo ss -ltnp | grep php-fpm
```

A Unix socket (`/run/php/...sock`) or `127.0.0.1` is fine. Listening on `0.0.0.0`, `[::]` or a public address exposes PHP-FPM directly.

> [!NOTE]
>
> The second precondition, a route that opens `php://input` without reading all of it, is hard to rule out: the PHP advisory notes that a framework can create that stream before routing or authentication, even when the page being called does not use the request body. Reason on the first precondition, connection reuse.

## Updating PHP, distro by distro

The real fix is a PHP package update followed by a **restart** of PHP-FPM: workers already running keep the old code.

Take a [snapshot of your VPS](https://help.onetsolutions.net/vps/snapshot) first.

### Debian

| Version | Fixed package | Advisory |
| - | - | - |
| Debian 13 (trixie) | `php8.4` `8.4.28-1~deb13u1` | DSA-6641-1 |
| Debian 12 (bookworm) | `php8.2` `8.2.36-1~deb12u1` | DLA-4916-1 |

### Ubuntu

| Version | Fixed package |
| - | - |
| 26.10 | `php8.5` `8.5.9-0ubuntu2.2` |
| 26.04 LTS | `php8.5` `8.5.4-0ubuntu1.6` |
| 24.04 LTS | `php8.3` `8.3.6-0ubuntu0.24.04.14` |
| 22.04 LTS | `php8.1` `8.1.2-1ubuntu2.29` |
| 20.04 LTS | `php7.4` `7.4.3-4ubuntu2.29+esm6` (Ubuntu Pro) |

```bash theme={null}
# Debian, Ubuntu: install the PHP fixes, then restart PHP-FPM
sudo apt update
sudo apt install --only-upgrade 'php*'
sudo systemctl restart 'php*-fpm.service'

# Check the installed version
dpkg -l 'php*-fpm' | grep ^ii
```

> [!NOTE]
>
> Don't rely on the version printed by `php -v` alone. Debian and Ubuntu backport the fix: Ubuntu 24.04 still reports PHP 8.3.6 once patched. Only the full package version, compared with your distribution's advisory, is the reference.

### RHEL and AlmaLinux

Red Hat lists RHEL 7, 8, 9 and 10 as affected. As of November 21, 2026, its bulletin [RHSB-2026-020](https://access.redhat.com/security/vulnerabilities/RHSB-2026-020) says fixes are on the way, with no erratum released yet: follow the [Red Hat CVE page](https://access.redhat.com/security/cve/cve-2026-129289). For AlmaLinux, watch [errata.almalinux.org](https://errata.almalinux.org).

```bash theme={null}
# Install the fix as soon as it ships, then restart PHP-FPM
sudo dnf upgrade 'php*'
sudo systemctl restart php-fpm

# Check the installed version
rpm -q php-fpm
```

Until the package lands, apply the mitigation below.

### Containers

Red Hat recommends rebuilding images based on RHEL or UBI as soon as their base image is updated. The same goes for any image that ships PHP-FPM: rebuild it on a fixed version, then redeploy.

## Turning off FastCGI connection reuse until you can update

If you can't update right away, the PHP team and Red Hat recommend closing the connection to PHP-FPM after every request.

### nginx

Replace every `fastcgi_keep_conn on;` with the default value:

```nginx theme={null}
fastcgi_keep_conn off;
```

Without `fastcgi_keep_conn on`, a `keepalive` in the PHP-FPM `upstream` block no longer keeps connections open. Test, then reload:

```bash theme={null}
sudo nginx -t && sudo systemctl reload nginx
```

### Apache

Remove the `enablereuse=on` parameter wherever it appears: `ProxyPass`, `ProxyPassMatch`, or a `<Proxy>` block paired with a `SetHandler`.

```apache theme={null}
# Before
<Proxy "fcgi://localhost/" enablereuse=on max=10>
</Proxy>

# After
<Proxy "fcgi://localhost/" max=10>
</Proxy>
```

```bash theme={null}
# Debian, Ubuntu
sudo apachectl configtest && sudo systemctl restart apache2

# RHEL, AlmaLinux
sudo apachectl configtest && sudo systemctl restart httpd
```

### Other frontends

For HAProxy or any other FastCGI frontend, configure it to close the connection to PHP-FPM after each request. In every case, keep PHP-FPM on a Unix socket or on `127.0.0.1`.

> [!NOTE]
>
> Reading `php://input` to the end on every request is not enough as the only mitigation: according to the PHP advisory, errors, resource exhaustion or process shutdown can cut it short.

## Checking the mitigation

```bash theme={null}
# The package version must match your distribution's advisory
dpkg -l 'php*-fpm' | grep ^ii      # Debian, Ubuntu
rpm -q php-fpm                     # RHEL, AlmaLinux

# PHP-FPM must have restarted after the package update
systemctl show -p ActiveEnterTimestamp 'php*-fpm.service'
```

If you turned connection reuse off, run the commands from "Sizing your exposure" again: no `fastcgi_keep_conn on;` line and no `enablereuse=on` should remain.

## Re-enabling connection reuse after the update

Red Hat describes these changes as temporary. Once PHP is fixed and PHP-FPM restarted, you can bring reuse back if you needed it for performance:

```nginx theme={null}
fastcgi_keep_conn on;
```

```bash theme={null}
sudo nginx -t && sudo systemctl reload nginx
```

On Apache, put `enablereuse=on` back on the relevant `ProxyPass` or `<Proxy>` block, then restart Apache.

## The other flaws in the November 19 release

The same release fixes two flaws that complete the [php2shell (CVE-2026-109618 and CVE-2026-109619)](https://blog.onetsolutions.net/en/php2shell-cve-2026-109618.md) fixes shipped in October:

| CVE | Issue | Versions |
| - | - | - |
| CVE-2026-129481 | Use-after-free after an interrupted session shutdown; incomplete fix for CVE-2026-109619 | PHP 8.3 to 8.5 |
| CVE-2026-129182 | Use-after-free on the fatal error backtrace after shutdown; incomplete fix for CVE-2026-109619 | PHP 8.5 only |
| CVE-2026-115560 | Session serializer mismatch that can lead to code execution | All maintained branches |

According to Red Hat, `session.upload_progress.enabled = 0`, the mitigation recommended for php2shell, also protects against CVE-2026-115560. On PHP 8.5, `fatal_error_backtraces = 0` covers CVE-2026-129182. These settings do not replace the update.

## What next?

Turning off connection reuse is only a stopgap: the target remains your distribution's fixed PHP package. Turn on [automatic security updates](https://blog.onetsolutions.net/en/automatic-security-updates-linux-vps.md) and go through the [nginx audit and hardening routine](https://blog.onetsolutions.net/en/audit-and-harden-nginx-on-a-vps.md). For any technical question, open a ticket from your [OnetSolutions customer area](https://help.onetsolutions.net/console/support).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.