# CVE-2026-6104: Global buffer over-read in mb\_convert\_encoding() with attacker-supplied encoding

- Priority: **Routine**
- Reason: Not severe (CVSS 6.3, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-05-10 · Modified: 2026-07-15
- Aliases: UBUNTU-CVE-2026-6104, DEBIAN-CVE-2026-6104, ALPINE-CVE-2026-6104
- Record: https://cvemate.com/vulnerability/CVE-2026-6104 · JSON: https://cvemate.com/vulnerability/CVE-2026-6104/json

## Description

```text
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.
```

## Signals

- CVSS: 9.1 critical (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
- EPSS: 0.469%, percentile 42.225%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine php84 (Alpine Linux): \< 8.4.27-r0 \| \< 8.4.21-r0
- alpine php85 (Alpine Linux): \< 8.5.6-r0
- debian php8.4 (Debian): \< 8.4.21-1~deb13u1 \| \< 8.4.21-1
- ubuntu php8.4 (Ubuntu): \< 8.4.11-1ubuntu1.2
- ubuntu php8.5 (Ubuntu): \< 8.5.4-0ubuntu1.1
- php group php: ≥ 8.4.\*, \< 8.4.21 \| ≥ 8.5.\*, \< 8.5.6
- php php: ≥ 8.4.0, \< 8.4.21 \| ≥ 8.5.0, \< 8.5.6

## References

- <https://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53>
- <https://access.redhat.com/security/cve/CVE-2026-6104>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2468573>
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-6104.json>
- <https://access.redhat.com/errata/RHSA-2026:22649>
- <https://ubuntu.com/security/CVE-2026-6104>
- <https://www.cve.org/CVERecord?id=CVE-2026-6104>
- <https://ubuntu.com/security/notices/USN-8336-1>
- <https://security-tracker.debian.org/tracker/CVE-2026-6104>
- <https://security.alpinelinux.org/vuln/CVE-2026-6104>

---

Data as of 2026-12-05T04:45:13.273Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
