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 package | Versions | Reported by |
|---|---|---|
| mbstring | from 8.4.* before 8.4.21, from 8.5.* before 8.5.6 | CVE List |
| php8.4 | Not specified Not affected: from 0:8.4.21-1.el10_2 before * | CVE List |
| php | Not specified | CVE List |
| php:7.4/php | Not specified | CVE List |
| php:8.2/php | Not specified | CVE List |
| php:8.3/php | Not specified | CVE List |
| php php | from 8.4.0 before 8.4.21, from 8.5.0 before 8.5.6 | NVD |
| libphp (Bitnami) | from 8.4.0 before 8.4.21, from 8.5.0 before 8.5.6 | Bitnami Vulnerability Database |
| php (Bitnami) | from 8.4.0 before 8.4.21, from 8.5.0 before 8.5.6 | Bitnami Vulnerability Database |
| php-min (Bitnami) | from 8.4.0 before 8.4.21, from 8.5.0 before 8.5.6 | Bitnami Vulnerability Database |
All scores
| php | 6.3medium CVSS:4.0 | CVSS: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-SADP | 8.2high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H |
| Bitnami Vulnerability Database | critical rating |
Classification
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-6104 changed 2026-07-15 | CVE Terms of Use |
| NVD | CVE-2026-6104 changed 2026-07-24 | Public domain |
| Bitnami Vulnerability Database | BIT-LIBPHP-2026-6104 changed 2026-11-11 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PHP-2026-6104 changed 2026-11-11 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-PHP-MIN-2026-6104 changed 2026-11-11 | Apache-2.0 |