CVE-2026-6104: Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding
CVE-2026-6104 affects 13 listed versions of PHP in the Dawnsentry catalogue.
Affected products and versions
The versions in the Dawnsentry catalogue this CVE affects, judged from the vendor's own advisory where there is one, otherwise from the CVE record and NVD, as each version's own page says.
PHP
13 of 250 listed versions are affected. Fixed in 8.5.6, 8.4.21. The newest release, 8.6.0, is not affected.
8.5.5 8.5.4 8.5.3 8.5.2 8.5.1 8.5.0 8.4.20 8.4.19 8.4.18 8.4.17 8.4.16 8.4.15 8.4.14
What it is
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.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H (NVD)
Published by Php on 10 May 2026. Last changed 24 July 2026.
Sources
Check one version you run: look CVE-2026-6104 up, or pick a product and version in the quick lookup.
Updated 2 December 2026.