PHP 8.1.22 is known vulnerabilities confirmed: 31 confirmed known vulnerabilities (4 critical, 9 high, 14 medium, 4 low, 3 RCE-related). Support status: End of life. This is a version-based check, not a full application audit. Recommended upgrade: PHP 8.6.0.
Security status
Known vulnerabilities confirmed
At least one CVE has a structured PHP runtime range that contains this version, and trusted sources do not disagree. Red means confirmed issues in the data, not that every deployment can be exploited.
Risk: Confirmed issues in the checked data
31 confirmed findings (4 critical, 9 high, 14 medium, 4 low). A match does not prove every deployment can be exploited.
This is a version-based check of published PHP runtime records. It is not a full application audit. Extensions, configuration, application code, and the SAPI can change the real risk.
Confirmed by severity: 4 critical, 9 high, 14 medium, 4 low. 3 still need verification.
Sources: NIST NVD API 2.0, php.net supported versions, end-of-life list, and releases, PHP ChangeLog, GitHub Security Advisories for php/php-src. Data last updated 24 Nov 2026, 03:47 UTC.
Data last updated: 24 Nov 2026, 03:47 UTC
Current version
8.1.22
Official support
End of life
PHP 8.1
Known vulnerabilities
31
3 need verification
Critical / high
4 / 9
Confirmed findings only
RCE-related CVEs
3
Confirmed, with a stated basis
Minimum security fix
Not verified
Recommended upgrade
8.6.0
Last data update
24 Nov 2026, 03:47 UTC
Fresh cache
Upgrade recommendation
Minimum security fix on PHP 8.1
At least one confirmed issue does not have a single verified fixed release on this branch. The minimum security fix is not verified. Use the advisory links instead of assuming a patch level.
Recommended long-term release
8.6.0 is the latest patch on PHP 8.6, which php.net lists as active support. It is the long-term upgrade, chosen because the branch is still supported. This check does not claim that release is vulnerability-free.
No PHP release should be treated as vulnerability-free. New issues are published after this dataset was synced, and some bugs depend on how PHP is installed.
PHP 8.1 no longer receives upstream fixes. Running its last patch still leaves the installation unsupported.
Moving from 8.1 to 8.6 can change language behavior, removed extensions, and default settings. Review each migration guide before upgrading: https://www.php.net/manual/en/migration82.php, https://www.php.net/manual/en/migration83.php, https://www.php.net/manual/en/migration84.php, https://www.php.net/manual/en/migration85.php, https://www.php.net/manual/en/migration86.php.
If this PHP build comes from a Linux distribution (Debian, Ubuntu, RHEL, Alpine, and others), the package may include backported security fixes that do not change the MAJOR.MINOR.PATCH string. This check cannot see those patches. A match is not proof the distro package is still vulnerable, and a clean result is not proof every fix was included. Check the distribution's own security tracker for the package you installed.
Upgrade commands
Examples use the versions already named in this report. They do not claim a CVE is fixed, and they are not run here.
Confirm the installed version
php -v
Read the MAJOR.MINOR.PATCH line. This site never runs that command for you.
Homebrew (macOS or Linux)
brew install php@8.6
php -v
Installs the php@8.6 formula. Homebrew does not pin the patch 8.6.0. Confirm php -v after install.
Docker official PHP image
FROM php:8.6.0-fpm-bookworm
# Rebuild the image after you change the tag.
Example pin for the recommended patch 8.6.0. Confirm the tag exists in the official php image before you deploy. A floating tag such as php:8.6-fpm is not a patch pin. See the Docker tool for the library's current mapping.
ondrej/php is a community archive, not a php.net or Debian project. Review it before you use it. Distro packages can lag or carry backports this checker cannot see.
Composer platform (does not upgrade PHP)
composer config platform.php 8.6.0
This only tells Composer which PHP version to resolve dependencies for. It does not change the runtime and does not fix vulnerabilities.
Support timeline
Initial release
25 Nov 2021
Active support end
25 Nov 2023
Security support end
31 Dec 2025
Latest patch on branch
8.1.34
Remote Code Execution & Shell Execution Risk
This section lists matched records whose CWE or description indicates remote code execution, command injection, shell execution, CGI argument injection, code execution, or unsafe runtime behavior. The basis is shown for each one. A matching version does not prove the bug is exploitable: the SAPI, operating system, web server, and extensions decide whether the vulnerable code path exists.
A command inject vulnerability allows an attacker to perform command injection on Windows applications that indirectly depend on the CreateProcess function when the specific conditions are satisfied.
Affected versions: PHP 8.1 only, before 8.1.28
Fixed version: Not verified
CVSS: 9.8 (v3.1)
Documented prerequisites: NVD configuration also requires cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:*
Classification basis: CWE-77 (Command Injection) is listed on the record; Description says command injection
In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, when using Apache and PHP-CGI on Windows, if the system is set up to use certain code pages, Windows may use "Best-Fit" behavior to replace characters in command line given to Win32 API functions. PHP CGI module may misinterpret those characters as PHP options, which may allow a malicious user to pass options to PHP binary being run, and thus reveal the source code of scripts, run arbitrary PHP code on the server, etc.
Affected versions: PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
PHP uses longjmp() for out-of-memory (OOM) errors to exit the current context and abort handling of the request. Some contexts may not properly account for this scenario and leave request memory in an uninitialized state before performing an allocation. The subsequent request cleanup procedure may read or branch on this memory. Multiple OOM strategies can consistently trigger this condition and lead to remote code execution (RCE).
Affected versions: 7.3.0 (including) to 8.2.35 (excluding)
PHP has various global state that temporarily points into request memory. In some scenarios, global state may not be correctly reset, or may be repopulated after being reset. The global state may then refer to request memory even after it has been freed. Subsequent requests may read or branch on this stale state before it is fully initialized. Multiple strategies can trigger this condition and produce remote code execution (RCE).
Affected versions: 5.4.0 (including) to 8.2.35 (excluding)
In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, the fix for CVE-2024-1874 does not work if the command name includes trailing spaces. Original issue: when using proc_open() command with array syntax, due to insufficient escaping, if the arguments of the executed command are controlled by a malicious user, the user can supply arguments that would execute arbitrary commands in Windows shell.
Affected versions: PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
Fixed version: 8.1.29
CVSS: 8.8 (v3.1)
Documented prerequisites: Module: proc_open; Platform: Windows
Classification basis: CWE-78 (OS Command Injection) is listed on the record
In PHP versions 8.1.* before 8.1.30, 8.2.* before 8.2.24, 8.3.* before 8.3.12, when using a certain non-standard configurations of Windows codepages, the fixes for CVE-2024-4577 https://github.com/advisories/GHSA-vxpp-6299-mxw3 may still be bypassed and the same command injection related to Windows "Best Fit" codepage behavior can be achieved. This may allow a malicious user to pass options to PHP binary being run, and thus reveal the source code of scripts, run arbitrary PHP code on the server, etc.
Affected versions: PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
Fixed version: 8.1.30
CVSS: 8.8 (v3.1)
Documented prerequisites: Platform: Windows
Classification basis: CWE-78 (OS Command Injection) is listed on the record; Description says command injection; Description says arbitrary code execution
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
8.1.31
CVE-2024-3566
Potentially affected — verification required
CRITICAL
9.8
PHP 8.1 only, before 8.1.28
Not verified
CVE-2024-4577
Confirmed vulnerable
CRITICAL
9.8
PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
8.1.29
CVE-2024-8932
Confirmed vulnerable
CRITICAL
9.8
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
8.1.31
CVE-2024-1874
Confirmed vulnerable
CRITICAL
9.4
PHP 8.1 only, 8.1.0 (including) to 8.1.28 (excluding); 8.1.0 (including) to 8.1.28 (excluding)
8.1.28
CVE-2026-109618
Potentially affected — verification required
CRITICAL
9.2
7.3.0 (including) to 8.2.35 (excluding)
Not verified
CVE-2026-109619
Potentially affected — verification required
CRITICAL
9.2
5.4.0 (including) to 8.2.35 (excluding)
Not verified
CVE-2024-5585
Confirmed vulnerable
HIGH
8.8
PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
8.1.29
CVE-2024-8926
Confirmed vulnerable
HIGH
8.8
PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
8.1.30
CVE-2026-129291
Confirmed vulnerable
HIGH
8.8
8.1.20 (including) to 8.1.34 (including)
Not verified
CVE-2024-11233
Confirmed vulnerable
HIGH
8.2
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
8.1.31
CVE-2025-14178
Confirmed vulnerable
HIGH
8.2
PHP 8.1 only, 8.1.0 (including) to 8.1.34 (excluding); 8.1.0 (including) to 8.1.34 (excluding)
8.1.34
CVE-2025-14180
Confirmed vulnerable
HIGH
8.2
PHP 8.1 only, 8.1.0 (including) to 8.1.34 (excluding); 8.1.0 (including) to 8.1.34 (excluding)
8.1.34
CVE-2024-8927
Confirmed vulnerable
HIGH
7.5
PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
8.1.30
CVE-2025-1735
Confirmed vulnerable
HIGH
7.5
PHP 8.1 only, 8.1.0 (including) to 8.1.33 (excluding); 8.1.0 (including) to 8.1.33 (excluding)
8.1.33
CVE-2024-11234
Confirmed vulnerable
HIGH
7.2
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
8.1.31
CVE-2024-3096
Confirmed vulnerable
MEDIUM
6.5
PHP 8.1 only, 8.1.0 (including) to 8.1.28 (excluding); 8.1.0 (including) to 8.1.28 (excluding)
8.1.28
CVE-2025-1217
Confirmed vulnerable
MEDIUM
6.3
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.32 (excluding)
8.1.32
CVE-2025-1219
Confirmed vulnerable
MEDIUM
6.3
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.32 (excluding)
8.1.32
CVE-2025-14177
Confirmed vulnerable
MEDIUM
6.3
PHP 8.1 only, 8.1.0 (including) to 8.1.34 (excluding); 8.1.0 (including) to 8.1.34 (excluding)
8.1.34
CVE-2025-1734
Confirmed vulnerable
MEDIUM
6.3
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.32 (excluding)
8.1.32
CVE-2025-1736
Confirmed vulnerable
MEDIUM
6.3
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.32 (excluding)
8.1.32
CVE-2025-1861
Confirmed vulnerable
MEDIUM
6.3
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
8.1.32
CVE-2024-2408
Confirmed vulnerable
MEDIUM
5.9
PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
8.1.29
CVE-2025-6491
Confirmed vulnerable
MEDIUM
5.9
PHP 8.1 only, 8.1.0 (including) to 8.1.33 (excluding); 8.1.0 (including) to 8.1.33 (excluding)
8.1.33
CVE-2024-8929
Confirmed vulnerable
MEDIUM
5.8
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
8.1.31
CVE-2024-5458
Confirmed vulnerable
MEDIUM
5.3
PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
8.1.29
CVE-2024-8925
Confirmed vulnerable
MEDIUM
5.3
PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
8.1.30
CVE-2025-1220
Confirmed vulnerable
MEDIUM
5.3
PHP 8.1 only, 8.1.0 (including) to 8.1.33 (excluding); 8.1.0 (including) to 8.1.33 (excluding)
8.1.33
CVE-2024-9026
Confirmed vulnerable
LOW
3.3
PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
8.1.30
CVE-2024-2756
Confirmed vulnerable
MEDIUM
Not provided
8.1.11 (excluding) to 8.1.28 (excluding)
8.1.28
GHSA-4w77-75f9-2c8w
Confirmed vulnerable
LOW
Not provided
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding)
8.1.31
GHSA-wg4p-4hqh-c3g9
Confirmed vulnerable
LOW
Not provided
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding)
8.1.32
GHSA-www2-q4fc-65wf
Confirmed vulnerable
LOW
Not provided
PHP 8.1 only, 8.1.0 (including) to 8.1.34 (excluding)
8.1.34
CVE-2024-11236
CRITICAL
CVSS 9.8
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
Fixed: 8.1.31
In PHP versions 8.1.* before 8.1.31, 8.2.* before 8.2.26, 8.3.* before 8.3.14, uncontrolled long string inputs to ldap_escape() function on 32-bit systems can cause an integer overflow, resulting in an out-of-bounds write.
8.1.31 is the fixed release named by the matching range and it is published on php.net.
Prerequisites: Module: pdo_firebird; Module: pdo_dblib; Platform: 32 bit
A command inject vulnerability allows an attacker to perform command injection on Windows applications that indirectly depend on the CreateProcess function when the specific conditions are satisfied.
Sources name 8.1.28, but that release was not found in the php.net release list used for this check. Fixed version: not verified.
Prerequisites: NVD configuration also requires cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:*
RCE basis: CWE-77 (Command Injection) is listed on the record; Description says command injection
PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
Fixed: 8.1.29
In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, when using Apache and PHP-CGI on Windows, if the system is set up to use certain code pages, Windows may use "Best-Fit" behavior to replace characters in command line given to Win32 API functions. PHP CGI module may misinterpret those characters as PHP options, which may allow a malicious user to pass options to PHP binary being run, and thus reveal the source code of scripts, run arbitrary PHP code on the server, etc.
8.1.29 is the fixed release named by the matching range and it is published on php.net.
Prerequisites: Module: CGI; Platform: Windows; NVD configuration also requires cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:*
RCE basis: CWE-78 (OS Command Injection) is listed on the record; Description says arbitrary code execution
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
Fixed: 8.1.31
In PHP versions 8.1.* before 8.1.31, 8.2.* before 8.2.26, 8.3.* before 8.3.14, uncontrolled long string inputs to ldap_escape() function on 32-bit systems can cause an integer overflow, resulting in an out-of-bounds write.
8.1.31 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.28 (excluding); 8.1.0 (including) to 8.1.28 (excluding)
Fixed: 8.1.28
In PHP versions 8.1.* before 8.1.28, 8.2.* before 8.2.18, 8.3.* before 8.3.5, when using proc_open() command with array syntax, due to insufficient escaping, if the arguments of the executed command are controlled by a malicious user, the user can supply arguments that would execute arbitrary commands in Windows shell.
8.1.28 is the fixed release named by the matching range and it is published on php.net.
PHP uses longjmp() for out-of-memory (OOM) errors to exit the current context and abort handling of the request. Some contexts may not properly account for this scenario and leave request memory in an uninitialized state before performing an allocation. The subsequent request cleanup procedure may read or branch on this memory. Multiple OOM strategies can consistently trigger this condition and lead to remote code execution (RCE).
Not verified. No single fixed release could be confirmed from the structured ranges and the php.net release list.
Conflict: A CPE or GitHub range contains this version, but the php.net affected list does not.
RCE basis: Description says remote code execution
Sources: php.net via NVD affected data, NVD CPE configuration
PHP has various global state that temporarily points into request memory. In some scenarios, global state may not be correctly reset, or may be repopulated after being reset. The global state may then refer to request memory even after it has been freed. Subsequent requests may read or branch on this stale state before it is fully initialized. Multiple strategies can trigger this condition and produce remote code execution (RCE).
Not verified. No single fixed release could be confirmed from the structured ranges and the php.net release list.
Conflict: A CPE or GitHub range contains this version, but the php.net affected list does not.
RCE basis: Description says remote code execution
Sources: php.net via NVD affected data, NVD CPE configuration
PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
Fixed: 8.1.29
In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, the fix for CVE-2024-1874 does not work if the command name includes trailing spaces. Original issue: when using proc_open() command with array syntax, due to insufficient escaping, if the arguments of the executed command are controlled by a malicious user, the user can supply arguments that would execute arbitrary commands in Windows shell.
8.1.29 is the fixed release named by the matching range and it is published on php.net.
Prerequisites: Module: proc_open; Platform: Windows
RCE basis: CWE-78 (OS Command Injection) is listed on the record
PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
Fixed: 8.1.30
In PHP versions 8.1.* before 8.1.30, 8.2.* before 8.2.24, 8.3.* before 8.3.12, when using a certain non-standard configurations of Windows codepages, the fixes for CVE-2024-4577 https://github.com/advisories/GHSA-vxpp-6299-mxw3 may still be bypassed and the same command injection related to Windows "Best Fit" codepage behavior can be achieved. This may allow a malicious user to pass options to PHP binary being run, and thus reveal the source code of scripts, run arbitrary PHP code on the server, etc.
8.1.30 is the fixed release named by the matching range and it is published on php.net.
Prerequisites: Platform: Windows
RCE basis: CWE-78 (OS Command Injection) is listed on the record; Description says command injection; Description says arbitrary code execution
### Summary
PHP-FPM can dispatch an epoll event that refers to a freed worker record when worker output capture is enabled. An attacker who can execute PHP code in an unprivileged FPM worker can exploit this use-after-free to execute commands with the privileges of the FPM master, which commonly runs as root.
### Details
When `catch_workers_output` is enabled, the FPM master monitors pipes connected to worker stdout and stderr. The epoll registrations store pointers to event structures embedded in the corresponding worker record.
When a worker exits, `fpm_child_close()` attempts to drain its output pipes. If a helper process still holds a pipe's write end open, the read can return `EAGAIN` instead of reaching EOF. In this case, the master closes the pipe's read descriptor without first removing its event or invalidating the descriptor number stored in the worker record. Cleanup of that record is deferred for one second.
An attacker can stop a newly forked sibling after it drops to the pool user but before it closes inherited descriptors. The stopped sibling retains the original pipe readers and epoll descriptor, keeping the original watch alive after the master closes its own descriptors. The delayed cleanup can then use a descriptor number that has already been reused, removing the wrong watch or failing to remove the original one before freeing the worker record. A subsequent write to the old pipe makes epoll return a pointer into the freed record.
The master passes that pointer to `fpm_event_fire()`, which reads and calls the event callback. The demonstrated exploit uses the stale output callback to write through a freed logging buffer, corrupt the allocator's free list, and replace the callback with a function that executes a command. Root command execution was reproduced from a `www-data` worker against unmodified PHP 8.5.12 Docker images on Linux arm64 and x86-64. The exploit is dependent on memory layout and process timing. Curl and OPcache were used to obtain memory addresses for the demonstrated chain; they are not required to trigger the underlying epoll use-after-free.
The affected delayed-cleanup path was introduced in PHP 8.1.20 and 8.2.7. The fix unregisters each stdio event while its original descriptor is still valid, closes the descriptor, and sets the stored descriptor to `-1` so that delayed cleanup cannot act on it again.
### Impact
Exploitation requires local code execution in an FPM worker, an affected pool with `catch_workers_output` enabled, the epoll event backend, and the ability to manipulate worker lifetimes and retain inherited pipe descriptors. A root FPM master permits escalation from the pool user to root. If the master runs as an unprivileged user, successful exploitation is limited to that user's privileges. In a container, this grants the master's container privileges and does not by itself establish a container escape.
The underlying descriptor-lifetime error can also close another worker's reused descriptor, disrupt logging or request handling, cause repeated worker respawns, or crash the master. Common affected configurations include the official PHP-FPM Docker images, which enable worker output capture. The default PHP-FPM setting outside such configurations is `catch_workers_output = no`.
### Affected versions
The affected delayed-cleanup path was introduced by the fix for GH-10461, first released in PHP 8.1.20 and 8.2.7.
### Mitigation
Upgrade to the fixed release for your PHP branch when it becomes available. As a temporary workaround, disable `catch_workers_output` in affected pools. Running the FPM master without root limits the privileges obtainable through this vulnerability, but does not correct the use-after-free. Disabling Curl or OPcache only removes parts of the demonstrated exploit chain and should not be treated as a complete mitigation.
Not verified. No single fixed release could be confirmed from the structured ranges and the php.net release list.
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
Fixed: 8.1.31
In PHP versions 8.1.* before 8.1.31, 8.2.* before 8.2.26, 8.3.* before 8.3.14, due to an error in convert.quoted-printable-decode filter certain data can lead to buffer overread by one byte, which can in certain circumstances lead to crashes or disclose content of other memory areas.
8.1.31 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.34 (excluding); 8.1.0 (including) to 8.1.34 (excluding)
Fixed: 8.1.34
In PHP versions:8.1.* before 8.1.34, 8.2.* before 8.2.30, 8.3.* before 8.3.29, 8.4.* before 8.4.16, 8.5.* before 8.5.1, a heap buffer overflow occurs in array_merge() when the total element count of packed arrays exceeds 32-bit limits or HT_MAX_SIZE, due to an integer overflow in the precomputation of element counts using zend_hash_num_elements(). This may lead to memory corruption or crashes and affect the integrity and availability of the target server.
8.1.34 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.34 (excluding); 8.1.0 (including) to 8.1.34 (excluding)
Fixed: 8.1.34
In PHP versions 8.1.* before 8.1.34, 8.2.* before 8.2.30, 8.3.* before 8.3.29, 8.4.* before 8.4.16, 8.5.* before 8.5.1 when using the PDO PostgreSQL driver with PDO::ATTR_EMULATE_PREPARES enabled, an invalid character sequence (such as \x99) in a prepared statement parameter may cause the quoting function PQescapeStringConn to return NULL, leading to a null pointer dereference in pdo_parse_params() function. This may lead to crashes (segmentation fault) and affect the availability of the target server.
8.1.34 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
Fixed: 8.1.30
In PHP versions 8.1.* before 8.1.30, 8.2.* before 8.2.24, 8.3.* before 8.3.12, HTTP_REDIRECT_STATUS variable is used to check whether or not CGI binary is being run by the HTTP server. However, in certain scenarios, the content of this variable can be controlled by the request submitter via HTTP headers, which can lead to cgi.force_redirect option not being correctly applied. In certain configurations this may lead to arbitrary file inclusion in PHP.
8.1.30 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.33 (excluding); 8.1.0 (including) to 8.1.33 (excluding)
Fixed: 8.1.33
In PHP versions:8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, 8.4.* pgsql and pdo_pgsql escaping functions do not check if the underlying quoting functions returned errors. This could cause crashes if Postgres server rejects the string as invalid.
8.1.33 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
Fixed: 8.1.31
In PHP versions 8.1.* before 8.1.31, 8.2.* before 8.2.26, 8.3.* before 8.3.14, when using streams with configured proxy and "request_fulluri" option, the URI is not properly sanitized which can lead to HTTP request smuggling and allow the attacker to use the proxy to perform arbitrary HTTP requests originating from the server, thus potentially gaining access to resources not normally available to the external user.
8.1.31 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.28 (excluding); 8.1.0 (including) to 8.1.28 (excluding)
Fixed: 8.1.28
In PHP version 8.1.* before 8.1.28, 8.2.* before 8.2.18, 8.3.* before 8.3.5, if a password stored with password_hash() starts with a null byte (\x00), testing a blank string as the password via password_verify() will incorrectly return true.
8.1.28 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.32 (excluding)
Fixed: 8.1.32
In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when http request module parses HTTP response obtained from a server, folded headers are parsed incorrectly, which may lead to misinterpreting the response and using incorrect headers, MIME types, etc.
8.1.32 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.32 (excluding)
Fixed: 8.1.32
In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when requesting a HTTP resource using the DOM or SimpleXML extensions, the wrong content-type header is used to determine the charset when the requested resource performs a redirect. This may cause the resulting document to be parsed incorrectly or bypass validations.
8.1.32 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.34 (excluding); 8.1.0 (including) to 8.1.34 (excluding)
Fixed: 8.1.34
In PHP versions:8.1.* before 8.1.34, 8.2.* before 8.2.30, 8.3.* before 8.3.29, 8.4.* before 8.4.16, 8.5.* before 8.5.1, the getimagesize() function may leak uninitialized heap memory into the APPn segments (e.g., APP1) when reading images in multi-chunk mode (such as via php://filter). This occurs due to a bug in php_read_stream_all_chunks() that overwrites the buffer without advancing the pointer, leaving tail bytes uninitialized. This may lead to information disclosure of sensitive heap data and affect the confidentiality of the target server.
8.1.34 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.32 (excluding)
Fixed: 8.1.32
In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when receiving headers from HTTP server, the headers missing a colon (:) are treated as valid headers even though they are not. This may confuse applications into accepting invalid headers.
8.1.32 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.32 (excluding)
Fixed: 8.1.32
In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when user-supplied headers are sent, the insufficient validation of the end-of-line characters may prevent certain headers from being sent or lead to certain headers be misinterpreted.
8.1.32 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
Fixed: 8.1.32
In PHP from 8.1.* before 8.1.32, from 8.2.* before 8.2.28, from 8.3.* before 8.3.19, from 8.4.* before 8.4.5, when parsing HTTP redirect in the response to an HTTP request, there is currently limit on the location value size caused by limited size of the location buffer to 1024. However as per RFC9110, the limit is recommended to be 8000. This may lead to incorrect URL truncation and redirecting to a wrong location.
Sources name 8.1.31, 8.1.32. 8.1.32 is the later bound, so it covers every stated fix, and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
Fixed: 8.1.29
The openssl_private_decrypt function in PHP, when using PKCS1 padding (OPENSSL_PKCS1_PADDING, which is the default), is vulnerable to the Marvin Attack unless it is used with an OpenSSL version that includes the changes from this pull request: https://github.com/openssl/openssl/pull/13817 (rsa_pkcs1_implicit_rejection). These changes are part of OpenSSL 3.2 and have also been backported to stable versions of various Linux distributions, as well as to the PHP builds provided for Windows since the previous release. All distributors and builders should ensure that this version is used to prevent PHP from being vulnerable.
PHP Windows builds for the versions 8.1.29, 8.2.20 and 8.3.8 and above include OpenSSL patches that fix the vulnerability.
8.1.29 is the fixed release named by the matching range and it is published on php.net.
Prerequisites: Module: openssl
Sources: php.net via NVD affected data, NVD CPE configuration
PHP 8.1 only, 8.1.0 (including) to 8.1.33 (excluding); 8.1.0 (including) to 8.1.33 (excluding)
Fixed: 8.1.33
In PHP versions:8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, 8.4.* before 8.4.10 when parsing XML data in SOAP extensions, overly large (>2Gb) XML namespace prefix may lead to null pointer dereference. This may lead to crashes and affect the availability of the target server.
8.1.33 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding); 8.1.0 (including) to 8.1.31 (excluding)
Fixed: 8.1.31
In PHP versions 8.1.* before 8.1.31, 8.2.* before 8.2.26, 8.3.* before 8.3.14, a hostile MySQL server can cause the client to disclose the content of its heap containing data from other SQL requests and possible other data belonging to different users of the same server.
8.1.31 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.29 (excluding); 8.1.0 (including) to 8.1.29 (excluding)
Fixed: 8.1.29
In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, due to a code logic error, filtering functions such as filter_var when validating URLs (FILTER_VALIDATE_URL) for certain types of URLs the function will result in invalid user information (username + password part of URLs) being treated as valid user information. This may lead to the downstream code accepting invalid URLs as valid and parsing them incorrectly.
8.1.29 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
Fixed: 8.1.30
In PHP versions 8.1.* before 8.1.30, 8.2.* before 8.2.24, 8.3.* before 8.3.12, erroneous parsing of multipart form data contained in an HTTP POST request could lead to legitimate data not being processed. This could lead to malicious attacker able to control part of the submitted data being able to exclude portion of other data, potentially leading to erroneous application behavior.
8.1.30 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.33 (excluding); 8.1.0 (including) to 8.1.33 (excluding)
Fixed: 8.1.33
In PHP versions:8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, 8.4.* before 8.4.10 some functions like fsockopen() lack validation that the hostname supplied does not contain null characters. This may lead to other functions like parse_url() treat the hostname in different way, thus opening way to security problems if the user code implements access checks before access using such functions.
8.1.33 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.30 (excluding); 8.1.0 (including) to 8.1.30 (excluding)
Fixed: 8.1.30
In PHP versions 8.1.* before 8.1.30, 8.2.* before 8.2.24, 8.3.* before 8.3.12, when using PHP-FPM SAPI and it is configured to catch workers output through catch_workers_output = yes, it may be possible to pollute the final log or remove up to 4 characters from the log messages by manipulating log message content. Additionally, if PHP-FPM is configured to use syslog output, it may be possible to further remove log data using the same vulnerability.
8.1.30 is the fixed release named by the matching range and it is published on php.net.
### Summary
Due to an incomplete fix to CVE-2022-31629, network and same-site attackers can set a standard insecure cookie in the victim's browser which is treated as a `__Host-` or `__Secure-` cookie by PHP applications.
### Details
The vulnerability is identical to one previously described in https://bugs.php.net/bug.php?id=81727. Unfortunatly, since CVE-2022-31629 got only partially fixed in PHP >8.1.11, cookies starting with `_[Host-` are parsed by PHP applications as `__Host-`. Notice that I reported this vulnerability multiple times via email after the fix for CVE-2022-31629 landed (I am the original reporter of that CVE), but I guess that the message got lost.
### PoC
```sh
$ echo '<?php echo(json_encode($_COOKIE)); ?>' > x
$ docker run -p 8080:8080 --rm -v $(pwd):$(pwd) php:latest php -S 0.0.0.0:8080 $(pwd)/x
$ curl -b '_[Host-x=y' localhost:8080/x
{"__Host-x":"y"}
```
8.1.28 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.31 (excluding)
Fixed: 8.1.31
### Summary
A heap-use-after-free vulnerability in the sapi_read_post_data function within PHP’s CLI server allows an attacker to potentially exploit memory safety issues during POST request processing.
### Details
The vulnerability resides in the `php_cli_server_client_populate_request_info` function in PHP's CLI SAPI. This results in the handling of a dangling `content_type` pointer at line 175 of SAPI.c. The CLI improperly manages memory during the processing of content_type, leading to a use-after-free condition that could result in memory corruption. The issue is triggered by specific crafted POST data, as shown by the following AddressSanitizer output:
```
==82343==ERROR: AddressSanitizer: heap-use-after-free on address 0x50600001ecf8 at pc 0x55555581b44f bp 0x7fffffffdcf0 sp 0x7fffffffd4b8
READ of size 34 at 0x50600001ecf8 thread T0
#1 0x5555563bfadb in sapi_read_post_data /php-8.3.13/main/SAPI.c:175:43
#2 0x5555563bfadb in sapi_activate /php-8.3.13/main/SAPI.c:469:4
```
### PoC
1. `exploit.py`
```py
import requests
url = 'http://localhost:8080/exploit.php'
php_crash_data = "AAAAAAA"
print("Sending payload 1...")
hex_response = requests.post(url, data={'input': php_crash_data})
print("\nSending payload 2...")
raw_response = requests.post(url, data=php_crash_data)
```
2. `exploit.php`
```php
<?php
$binary_data = file_get_contents('php://input');
echo $binary_data ? "Received Data:\n$binary_data" : "No input provided or data was empty.";
?>
```
3. Start the PHP server compiled with ASAN: In the directory containing exploit.php, run: `./sapi/cli/php -S localhost:8080 &`
2. Run the exploit: Execute the PoC script by running: `python3 exploit.py`
Resulted in this output:
```c
root@32fbd16f3ed1:/php-8.3.13# ./sapi/cli/php -S localhost:8080 &
[1] 82343
root@32fbd16f3ed1:/php-8.3.13# [Sat Nov 9 07:08:06 2024] PHP 8.3.13 Development Server (http://localhost:8080) started
root@32fbd16f3ed1:/php-8.3.13# python3 exploit.py
Sending payload 1...
[Sat Nov 9 07:08:14 2024] [::1]:54356 Accepted
[Sat Nov 9 07:08:14 2024] [::1]:54356 [200]: POST /exploit.php
[Sat Nov 9 07:08:14 2024] [::1]:54356 Closing
Sending payload 2...
[Sat Nov 9 07:08:14 2024] [::1]:54360 Accepted
=================================================================
==82343==ERROR: AddressSanitizer: heap-use-after-free on address 0x50600001ecf8 at pc 0x55555581b44f bp 0x7fffffffdcf0 sp 0x7fffffffd4b8
READ of size 34 at 0x50600001ecf8 thread T0
#0 0x55555581b44e in strlen (/php-8.3.13/sapi/cli/php+0x41b44e) (BuildId: 712b3d4fbdcb978a011679cd1c90ada321af14cf)
#1 0x5555563bfadb in sapi_read_post_data /php-8.3.13/main/SAPI.c:175:43
#2 0x5555563bfadb in sapi_activate /php-8.3.13/main/SAPI.c:469:4
#3 0x555556394fce in php_request_startup /php-8.3.13/main/main.c:1795:3
#4 0x555556c42e7b in php_cli_server_request_startup /php-8.3.13/sapi/cli/php_cli_server.c:2236:17
#5 0x555556c42e7b in php_cli_server_dispatch /php-8.3.13/sapi/cli/php_cli_server.c:2316:18
#6 0x555556c42e7b in php_cli_server_recv_event_read_request /php-8.3.13/sapi/cli/php_cli_server.c:2660:11
#7 0x555556c46447 in php_cli_server_do_event_for_each_fd_callback /php-8.3.13/sapi/cli/php_cli_server.c:2745:5
#8 0x555556c3c8e7 in php_cli_server_poller_iter_on_active /php-8.3.13/sapi/cli/php_cli_server.c:932:20
#9 0x555556c3c8e7 in php_cli_server_do_event_for_each_fd /php-8.3.13/sapi/cli/php_cli_server.c:2765:17
#10 0x555556c3c8e7 in php_cli_server_do_event_loop /php-8.3.13/sapi/cli/php_cli_server.c:2777:4
#11 0x555556c3c8e7 in do_cli_server /php-8.3.13/sapi/cli/php_cli_server.c:2909:17
#12 0x555556c272bd in main /php-8.3.13/sapi/cli/php_cli.c:1344:18
#13 0x7ffff75301c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#14 0x7ffff753028a in __libc_start_main csu/../csu/libc-start.c:360:3
#15 0x555555803bc4 in _start (/php-8.3.13/sapi/cli/php+0x403bc4) (BuildId: 712b3d4fbdcb978a011679cd1c90ada321af14cf)
0x50600001ecf8 is located 24 bytes inside of 64-byte region [0x50600001ece0,0x50600001ed20)
freed by thread T0 here:
#0 0x55555589e77a in free (/php-8.3.13/sapi/cli/php+0x49e77a) (BuildId: 712b3d4fbdcb978a011679cd1c90ada321af14cf)
#1 0x55555667fff8 in zend_hash_destroy /php-8.3.13/Zend/zend_hash.c:1775:7
previously allocated by thread T0 here:
#0 0x55555589ea13 in malloc (/php-8.3.13/sapi/cli/php+0x49ea13) (BuildId: 712b3d4fbdcb978a011679cd1c90ada321af14cf)
#1 0x5555564deb49 in __zend_malloc /php-8.3.13/Zend/zend_alloc.c:3128:14
SUMMARY: AddressSanitizer: heap-use-after-free (/php-8.3.13/sapi/cli/php+0x41b44e) (BuildId: 712b3d4fbdcb978a011679cd1c90ada321af14cf) in strlen
Shadow bytes around the buggy address:
0x50600001ea00: 00 00 00 fa fa fa fa fa 00 00 00 00 00 00 00 00
0x50600001ea80: fa fa fa fa 00 00 00 00 00 00 00 00 fa fa fa fa
0x50600001eb00: 00 00 00 00 00 00 00 00 fa fa fa fa 00 00 00 00
0x50600001eb80: 00 00 00 00 fa fa fa fa 00 00 00 00 00 00 00 00
0x50600001ec00: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
=>0x50600001ec80: 00 00 00 00 00 00 00 fa fa fa fa fa fd fd fd[fd]
0x50600001ed00: fd fd fd fd fa fa fa fa 00 00 00 00 00 00 05 fa
0x50600001ed80: fa fa fa fa 00 00 00 00 00 00 00 04 fa fa fa fa
0x50600001ee00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x50600001ee80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x50600001ef00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==82343==ABORTING
```
### Impact
CLI server should not be used in production but there is still risk for developers running the CLI server. It may be possible to exploit it if the server only listens on localhost. E.g. a web page may trick your browser into sending a request to localhost. So developers running the CLI server could be attacked by tricking them into visiting a malicious web page. There might be other impact but it's not exactly clear about the likeliness of this attack.
8.1.31 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.32 (excluding)
Fixed: 8.1.32
This is a reocurrence of bug #72714 .
### Impact
Out of bounds read can leak heap contents.
```php
<?php
$sample = "<?xml version=\"1.0\"?><test><child/></test>";
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_SKIP_TAGSTART, 100);
$res = xml_parse_into_struct($parser,$sample,$vals,$index);
var_dump($vals);
```
If we set `XML_OPTION_SKIP_TAGSTART` to a high value, we can read out of bounds.
It doesn't even have to be a crazy high value, as long as an attacker can supply XML with shorter tag names than expected they can trigger an OOB read.
I coincidentally came across this by reviewing `xml.c`, I noticed this is a reocurrence of https://bugs.php.net/bug.php?id=72714
This was originally fixed in https://github.com/php/php-src/commit/9164dc11e2323b8b80c389bb13d70789799b44fc, but it seems the fix was either incomplete or not merged properly.
Granted, this option is rarely used.
### Workarounds
Don't use `XML_OPTION_SKIP_TAGSTART`.
8.1.32 is the fixed release named by the matching range and it is published on php.net.
PHP 8.1 only, 8.1.0 (including) to 8.1.34 (excluding)
Fixed: 8.1.34
### Summary
As GHSA-3cr5-j632-f35r, same null termination is occuring
### Details
dns_get_record() and other DNS functions don't have any null contain check, leads potential SSRF or unexpected behavior.
### PoC
```php
<?php
var_dump(dns_get_record("php.net\0aa"));
```
Result: DNS records of `php.net`
Expect: Fails to call
### Security impact
(Even though it's too low but,) Probability of SSRF
8.1.34 is the fixed release named by the matching range and it is published on php.net.
3 records matched only loosely, or trusted sources disagree. Those are marked potentially affected and need verification.
Records that name the PHP runtime but publish no usable version range were excluded instead of guessed.
GREEN means no matching CVE was confirmed in the data that could be checked, and the branch is still supported. It does not mean the installation is secure.