CVE-2026-6104

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.
Configurations

Configuration 1 (hide)

OR cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
cpe:2.3:a:php:php:*:*:*:*:*:*:*:*

History

24 Jul 2026, 08:10

Type Values Removed Values Added
Summary
  • (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.

30 Jun 2026, 03:21

Type Values Removed Values Added
References
  • () https://access.redhat.com/errata/RHSA-2026:22649 -
  • () https://access.redhat.com/security/cve/CVE-2026-6104 -
  • () https://bugzilla.redhat.com/show_bug.cgi?id=2468573 -
  • () https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-6104.json -

12 May 2026, 17:35

Type Values Removed Values Added
CPE cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
References () https://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53 - () https://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53 - Vendor Advisory
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 9.1
First Time Php
Php php

10 May 2026, 06:16

Type Values Removed Values Added
New CVE

Information

Published : 2026-05-10 06:16

Updated : 2026-07-24 08:10


NVD link : CVE-2026-6104

Mitre link : CVE-2026-6104

CVE.ORG link : CVE-2026-6104


JSON object : View

Products Affected

php

  • php
CWE
CWE-125

Out-of-bounds Read