CVE-2026-6104 Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: yes · technical impact: partial
- Technology
- PHPUbuntuDebianRed Hat
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.
Upgrade path
12 packages: 11 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| alpine/php84(Alpine v3.22) | < 8.4.27-r0 | 8.4.27-r0 | Fixed |
| alpine/php84(Alpine v3.23) | < 8.4.21-r0 | 8.4.21-r0 | Fixed |
| alpine/php85(Alpine v3.23) | < 8.5.6-r0 | 8.5.6-r0 | Fixed |
| alpine/php85(Alpine v3.24) | < 8.5.6-r0 | 8.5.6-r0 | Fixed |
| debian/php8.4(Debian 13) | < 8.4.21-1~deb13u1; = 8.4.11-1; = 8.4.16-1; = 8.4.16-1~deb13u1 +1 more | 8.4.21-1~deb13u1 | Fixed |
| debian/php8.4(Debian 14) | < 8.4.21-1; = 8.4.11-1; = 8.4.16-1; = 8.4.16-1~deb13u1 +2 more | 8.4.21-1 | Fixed |
| PHP | < 8.4.21; < 8.5.6; >= 8.4.0, < 8.4.21; >= 8.5.0, < 8.5.6 | 8.4.21, 8.5.6 | Fixed |
| PHP(Azure Linux 4.0) | < 0:8.4.26-5.azl4 | 0:8.4.26-5.azl4 | Fixed |
| redhat enterprise linux | < 0:8.4.21-1.el10_2; = 6; = 7; = 8 +2 more | 0:8.4.21-1.el10_2 | Fixed |
| redhat/php8.4(Red Hat enterprise_linux 10.2) | < 8.4.21-1.el10_2 | 8.4.21-1.el10_2 | Fixed |
| ubuntu/php8.5(Ubuntu 26.04) | < 8.5.4-0ubuntu1.1 | 8.5.4-0ubuntu1.1 | Fixed |
| redhat hummingbird | = 1 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| PHP | < 8.4.21 | 8.4.21 |
| PHP | < 8.5.6 | 8.5.6 |
| redhat enterprise linux | < 0:8.4.21-1.el10_2 | 0:8.4.21-1.el10_2 |
| redhat enterprise linux | = 10 | No fix listed |
| redhat enterprise linux | = 6 | No fix listed |
| redhat enterprise linux | = 7 | No fix listed |
| redhat enterprise linux | = 8 | No fix listed |
| redhat enterprise linux | = 9 | No fix listed |
| redhat hummingbird | = 1 | No fix listed |
| redhat/php8.4(Red Hat:enterprise_linux:10.2) | < 8.4.21-1.el10_2 | 8.4.21-1.el10_2 |
| debian/php8.4(Debian:13) | < 8.4.21-1~deb13u1 | 8.4.21-1~deb13u1 |
| debian/php8.4(Debian:13) | = 8.4.11-1 | No fix listed |
| debian/php8.4(Debian:13) | = 8.4.16-1 | No fix listed |
| debian/php8.4(Debian:13) | = 8.4.16-1~deb13u1 | No fix listed |
| debian/php8.4(Debian:13) | = 8.4.20-1 | No fix listed |
| debian/php8.4(Debian:14) | < 8.4.21-1 | 8.4.21-1 |
| debian/php8.4(Debian:14) | = 8.4.11-1 | No fix listed |
| debian/php8.4(Debian:14) | = 8.4.16-1 | No fix listed |
| debian/php8.4(Debian:14) | = 8.4.16-1~deb13u1 | No fix listed |
| debian/php8.4(Debian:14) | = 8.4.20-1 | No fix listed |
| debian/php8.4(Debian:14) | = 8.4.21-1~deb13u1 | No fix listed |
| alpine/php84(Alpine:v3.22) | < 8.4.27-r0 | 8.4.27-r0 |
| alpine/php84(Alpine:v3.23) | < 8.4.21-r0 | 8.4.21-r0 |
| alpine/php85(Alpine:v3.23) | < 8.5.6-r0 | 8.5.6-r0 |
| alpine/php85(Alpine:v3.24) | < 8.5.6-r0 | 8.5.6-r0 |
Show 4 more
| Product | Affected versions | Fixed in |
|---|---|---|
| ubuntu/php8.5(Ubuntu:26.04) | < 8.5.4-0ubuntu1.1 | 8.5.4-0ubuntu1.1 |
| PHP | >= 8.4.0, < 8.4.21 | 8.4.21 |
| PHP | >= 8.5.0, < 8.5.6 | 8.5.6 |
| PHP(Azure Linux:4.0) | < 0:8.4.26-5.azl4 | 0:8.4.26-5.azl4 |
References
- github.com vendor-advisory
- Red Hat CVE page mitigation vdb-entry vendor-advisory
- RHBZ#2468573 issue-tracking
- security.access.redhat.com
- RHSA-2026:22649 patch vendor-advisory
- www.cve.org
- nvd.nist.gov
- Debian Security Tracker CVE-2026-6104 vendor-advisory
- security.alpinelinux.org vendor-advisory
- Ubuntu CVE tracker vendor-advisory
- USN-8336-1 vendor-advisory
- bugs.debian.org issue-tracking
- MSRC Security Update Guide vendor-advisory
- Release Notes vendor-advisory