CVE-2026-6104 Details
Description
In PHP versions 8.4.* before 8.4.21 and 8.5.* before 8.5.6, when an encoding name containing an embedded NUL byte is passed to mb_convert_encoding() or related mbstring functions, the code incorrectly assumes that when strncasecmp() returns 0 it means the strings have the same length. This can lead to out-of-bounds read of global memory, potentially causing a crash or information disclosure or crash. Affected functions include mb_convert_encoding(), mb_detect_encoding(), mb_convert_variables(), and mb_detect_order(), as well as the mbstring.detect_order and mbstring.http_output INI settings.
A global buffer over-read vulnerability has been identified in PHP versions 8.4.* prior to 8.4.21 and 8.5.* prior to 8.5.6. The issue arises in the mbstring extension when encoding names containing embedded NUL bytes are passed to mb_convert_encoding() or related functions. The vulnerability occurs because the code incorrectly assumes that a return value of 0 from strncasecmp() indicates that the strings are of the same length. This misinterpretation can lead to an out-of-bounds read of global memory, potentially causing a crash or unauthorized information disclosure. The affected functions include mb_convert_encoding(), mb_detect_encoding(), mb_convert_variables(), and mb_detect_order(), as well as the mbstring.detect_order and mbstring.http_output INI settings.
Users can upgrade to PHP versions 8.4.21 or 8.5.6, where this vulnerability has been patched.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 11, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://access.redhat.com/errata/RHSA-2026:22649 | redhat-SADP | |
| https://access.redhat.com/security/cve/CVE-2026-6104 | redhat-SADP | |
| https://bugzilla.redhat.com/show_bug.cgi?id=2468573 | redhat-SADP | |
| https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-6104.json | redhat-SADP | |
| https://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53 | [email protected] | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-125 | Out-of-bounds Read | redhat-SADP |
| CWE-125 | Out-of-bounds Read | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| php php | >= 8.4.0, < 8.4.21 >= 8.5.0, < 8.5.6 |
CPE
Remediation
| |
Change History
7 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 24, 2026 | CVE Translated | [email protected] |
| Jul 15, 2026 | CVE Modified | redhat-SADP |
| Jun 30, 2026 | CVE Modified | redhat-SADP |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | [email protected] |
| May 12, 2026 | Initial Analysis | [email protected] |
| May 10, 2026 | New CVE Received | [email protected] |