Vulnerability · Published May 10, 2026 · Assigned by php

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

High 8.2

In plain English

A high-severity out-of-bounds read in PHP from PHP Group. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 41% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.2High
Exploit odds (30 days)0.5%top 59.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:10php8.48.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-bcmath8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-cli8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-common8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-dba8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-dbg8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-devel8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-embedded8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-enchant8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-ffi8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-fpm8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-gd8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-gmp8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-intl8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-ldap8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-mbstring8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-mysqlnd8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-odbc8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-opcache8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-pdo8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-pgsql8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-process8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-snmp8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-soap8.4.21-1.el10_2ALSA-2026:22649
AlmaLinux:10php8.4-xml8.4.21-1.el10_2ALSA-2026:22649
Alpine:v3.22php848.4.27-r0ALPINE-CVE-2026-6104
Alpine:v3.23php848.4.21-r0ALPINE-CVE-2026-6104
Alpine:v3.23php858.5.6-r0ALPINE-CVE-2026-6104
Alpine:v3.24php858.5.6-r0ALPINE-CVE-2026-6104
Debian:13php8.48.4.21-1~deb13u1DEBIAN-CVE-2026-6104
Debian:14php8.48.4.21-1DEBIAN-CVE-2026-6104
Rocky Linux:10php8.40:8.4.21-1.el10_2RLSA-2026:22649
Ubuntu:25.10php8.48.4.11-1ubuntu1.2UBUNTU-CVE-2026-6104
Ubuntu:26.04:LTSphp8.58.5.4-0ubuntu1.1UBUNTU-CVE-2026-6104

Affected products (as reported)

VendorProductVersions
PHP Group PHP 8.4.* – before 8.4.218.5.* – before 8.5.6

Weakness: CWE-125 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

References