CVE-2026-6104
JSON

6.3medium

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

Severity
6.3medium CVSS:4.0 by php
Exploit likelihood
0.47% (higher than 42% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
php
Also known as
BIT-LIBPHP-2026-6104BIT-PHP-2026-6104BIT-PHP-MIN-2026-6104GHSA-74r9-qxhc-fx53

Description

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.

Affected

Product or packageVersionsReported by
mbstringfrom 8.4.* before 8.4.21, from 8.5.* before 8.5.6CVE List
php8.4Not specified
Not affected: from 0:8.4.21-1.el10_2 before *
CVE List
phpNot specifiedCVE List
php:7.4/phpNot specifiedCVE List
php:8.2/phpNot specifiedCVE List
php:8.3/phpNot specifiedCVE List
php phpfrom 8.4.0 before 8.4.21, from 8.5.0 before 8.5.6NVD
libphp (Bitnami)from 8.4.0 before 8.4.21, from 8.5.0 before 8.5.6Bitnami Vulnerability Database
php (Bitnami)from 8.4.0 before 8.4.21, from 8.5.0 before 8.5.6Bitnami Vulnerability Database
php-min (Bitnami)from 8.4.0 before 8.4.21, from 8.5.0 before 8.5.6Bitnami Vulnerability Database

All scores

php6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:L/SI:N/SA:L/RE:M/U:Amber
redhat-SADP8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
NVD9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
Bitnami Vulnerability Databasecritical rating

Classification

CWE-125

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

NVD (es)

En versiones de PHP 8.4.* anteriores a 8.4.21 y 8.5.* anteriores a 8.5.6, cuando un nombre de codificación que contiene un byte NUL incrustado se pasa a mb_convert_encoding() o funciones mbstring relacionadas, el código asume incorrectamente que cuando strncasecmp() devuelve 0 significa que las cadenas tienen la misma longitud. Esto puede llevar a una lectura fuera de límites de la memoria global, lo que podría causar un fallo o revelación de información o un fallo. Las funciones afectadas incluyen mb_convert_encoding(), mb_detect_encoding(), mb_convert_variables() y mb_detect_order(), así como las configuraciones INI mbstring.detect_order y mbstring.http_output.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-6104 changed 2026-07-15CVE Terms of Use
NVDCVE-2026-6104 changed 2026-07-24Public domain
Bitnami Vulnerability DatabaseBIT-LIBPHP-2026-6104 changed 2026-11-11Apache-2.0
Bitnami Vulnerability DatabaseBIT-PHP-2026-6104 changed 2026-11-11Apache-2.0
Bitnami Vulnerability DatabaseBIT-PHP-MIN-2026-6104 changed 2026-11-11Apache-2.0