Vendors › PHP

CVE-2026-6104

Medium (6.3) EPSS 0.6% PHP · mbstring

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 p

Published2026-05-07
Updated2026-05-07
AffectedPHP versions < 8.4.21; PHP versions < 8.5.6
FixUpgrade to 8.4.21, 8.5.6 (first fixed release per supported branch).
Vendor advisoryhttps://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53

CVEs (1)

CVECWETypeImpactLinks
CVE-2026-6104CWE-125OverflowCode ExecutionNVD · CVE.org · EUVD

CWE, type and impact come from the NVD enrichment pass; unfilled rows are pending enrichment.

Same CVE in other advisories

Open in the CVEMesh app Create a free account

Track this advisory against your own stack — add your assets and CVEMesh shows which advisories actually apply to the versions you run.

CVEMesh aggregates public vendor advisories as guidance; always verify against the vendor's official advisory before patching or upgrading.