VulnWatch by ve1ve2
critical 9.1 EPSS 0.47%

GHSA-74r9-qxhc-fx53 / CVE-2026-6104: Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding

Source:
PHP releases (GitHub php/php-src tags)
Published:
Fetched:
Updated:
Affects:
php ext-mbstring

https://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53 ↗

repo-advisoryphpCWE-125securityrepo:php/php-srcstack

Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding ## Summary A global buffer over-read exists in `mbfl_name2encoding_ex()` (`ext/mbstring/libmbfl/mbfl/mbfl_encoding.c`, line 352), called from `mb_convert_encoding(...)` and other mbstring functions, when parsing encoding names with embedded NUL bytes. ## Root Cause In `mbfl_name2encoding_ex`, the MIME name search loop (line 352) uses: ```c if (strncasecmp((*encoding)->mime_name, name, name_len) == 0 && (*encoding)->mime_name[name_len] == '\0') { ``` When `name` contains an embedded NUL byte (e.g., `"UTF-8\x00AAAA..."`), `strncasecmp` returns 0 after matching up to the NUL (since both strings have NUL at the same position). The subsequent check `(*encoding)->mime_name[name_len]` then reads at offset `name_len` (e.g., 22) from `mime_name`, which is only 6 bytes long (`"UTF-8\0"`). This reads 16+ bytes past the end of the global string into adjacent global memory. The same issue exists on lines 362 for encoding aliases. ## Minimal Reproducer ```php

Linked vulnerabilities (2)

CVE-2026-6104 critical 9.1 EPSS 0.47% (p41) NVDCVE.orgGHSA
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

php8.4 - security update

CWE: CWE-125Aliases: CVE-2025-14179, CVE-2026-12184, CVE-2026-6722, CVE-2026-6735, CVE-2026-7258, CVE-2026-7259, CVE-2026-7261, CVE-2026-7262, CVE-2026-7263, CVE-2026-7568, GHSA-74r9-qxhc-fx53
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding

CWE: CWE-125Aliases: CVE-2026-6104