CVE-2026-6104
Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding
Reported by php · Published May 10, 2026
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.
EPSS 0.47% · 41.5th percentile
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| php8.4-enchant | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-pgsql | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-odbc-debuginfo | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-soap | Amazon Linux | 8.4.21-1.amzn2023.0.1 |
| php8.4-gmp | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-mysqlnd | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-modphp | Amazon Linux | 8.4.21-1.amzn2023.0.1 |
| php8.4-ldap-debuginfo | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-fpm-debuginfo | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-gmp-debuginfo | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-ffi | errata.rockylinux.org | 8.4.21-1.el10 |
| php8.4-bcmath | errata.rockylinux.org | 8.4.21-1.el10 |
53 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| PHP Group | PHP | 8.4.*, 8.5.* |
| PHP Group | PHP | 8.4.*, 8.5.* |
Timeline
- May 7, 2026 CVE Published
- May 8, 2026 PoC Published
- May 10, 2026 EPSS Score (30 in total, the first dated here)
- May 11, 2026 Security Advisory (13 in total, the first dated here)
- Jun 3, 2026 Distribution Patch (11 in total, the first dated here)
- Aug 10, 2026 Coalition ESS Score
- Aug 10, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-6104
vulnetix vdb fixes CVE-2026-6104
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-6104/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart