PHP-CGI out-of-bounds read and write during PATH_INFO correction.
The PHP CGI binary (php-cgi), in CGI and FastCGI mode with cgi.fix_pathinfo enabled (the default), can perform an out-of-bounds read and write when the path removed from SCRIPT_FILENAME or PATH_TRANSLATED is longer than the supplied PATH_INFO, or when PATH_INFO is empty. This requires a web server mapping that passes such inconsistent values, or a FastCGI listener reachable by untrusted clients. An unauthenticated remote attacker can crash the process, may obtain process memory if the application exposes PATH_INFO or PATH_TRANSLATED, and may corrupt memory. PHP-FPM and the Apache module are not affected.
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 reads data past the end, or before the beginning, of the intended buffer.
| 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 | * |