PHP-FPM request smuggling through an unread HTTP request body.
PHP does not discard the unread part of an HTTP request body at request shutdown when the application has opened php://input without reading it to the end. When the front end reuses backend connections, which is not the default in nginx or Apache (for example nginx with fastcgi_keep_conn on, or Apache mod_proxy_fcgi with enablereuse=on), PHP-FPM can parse the leftover bytes as a new FastCGI request. An unauthenticated remote attacker can use a single crafted multipart/form-data request to forge a backend request with chosen parameters such as SCRIPT_FILENAME, REMOTE_ADDR and PHP_ADMIN_VALUE, which can lead to execution of attacker-controlled PHP code. With LSAPI, subsequent requests on the connection can be disrupted.
This issue affects PHP versions before 8.2.36, 8.3.* before 8.3.37, 8.4.* before 8.4.28 and 8.5.* before 8.5.13.
The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.
| Name | Vendor | Start Version | End Version |
|---|---|---|---|
| Red Hat Enterprise Linux 10 | RedHat | php8.4-0:8.4.28-1.el10_3 | * |
| Red Hat Enterprise Linux 10.2 Extended Update Support | RedHat | php8.4-0:8.4.28-1.el10_2 | * |
| Red Hat Enterprise Linux 8 | RedHat | php:7.4-8100020261119125714.f7998665 | * |
| Red Hat Enterprise Linux 9.8 Extended Update Support | RedHat | php:8.3-9080020261120133305.9 | * |
| Red Hat Enterprise Linux 9.8 Extended Update Support | RedHat | php:8.2-9080020261120141350.9 | * |
| Php5 | Ubuntu | esm-infra-legacy/trusty | * |
| Php7.0 | Ubuntu | esm-infra-legacy/xenial | * |
| Php7.2 | Ubuntu | esm-infra/bionic | * |
| Php7.4 | Ubuntu | esm-infra/focal | * |
| Php8.1 | Ubuntu | jammy | * |
| Php8.3 | Ubuntu | noble | * |
| Php8.5 | Ubuntu | devel | * |
| Php8.5 | Ubuntu | resolute | * |
| Php8.5 | Ubuntu | stonking | * |
HTTP requests or responses (“messages”) can be malformed or unexpected in ways that cause web servers or clients to interpret the messages in different ways than intermediary HTTP agents such as load balancers, reverse proxies, web caching proxies, application firewalls, etc. For example, an adversary may be able to add duplicate or different header fields that a client or server might interpret as one set of messages, whereas the intermediary might interpret the same sequence of bytes as a different set of messages. For example, discrepancies can arise in how to handle duplicate headers like two Transfer-encoding (TE) or two Content-length (CL), or the malicious HTTP message will have different headers for TE and CL. The inconsistent parsing and interpretation of messages can allow the adversary to “smuggle” a message to the client/server without the intermediary being aware of it. This weakness is usually the result of the usage of outdated or incompatible HTTP protocol versions in the HTTP agents.