cve.bz

CVE-2026-6104 php php: Out-of-bounds Read

6.3 mediumEPSS 0.5%

Medium (6.3) in php php. EPSS 0.5% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 4.0

6.3 medium
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

CVSS 3.1

9.1 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
EPSS
0.5% (unchanged from 0.5% a week ago; 0.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 41st percentile. Scored 2026-11-21. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: partial, assessed 2026-05-11. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-125 Out-of-bounds Read
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-6104 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-6104?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-6104?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-6104 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
PHP Group PHPfrom 8.4.* before 8.4.21
PHP Group PHPfrom 8.5.* before 8.5.6

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13php8.48.4.21-1~deb13u1DEBIAN-CVE-2026-6104 DSA-6256-1
Debian14php8.48.4.21-1DEBIAN-CVE-2026-6104
Ubuntu25.10php8.48.4.11-1ubuntu1.2UBUNTU-CVE-2026-6104
Ubuntu26.04:LTSphp8.58.5.4-0ubuntu1.1UBUNTU-CVE-2026-6104
Red Hatenterprise_linux:10.2php8.4, php8.4-gd, php8.4-cli and 47 more0:8.4.21-1.el10_2RHSA-2026:22649
openSUSETumbleweedphp88.5.6-1.1openSUSE-SU-2026:10747-1
AlmaLinux10php8.4, php8.4-gd, php8.4-cli and 22 more8.4.21-1.el10_2ALSA-2026:22649
Rocky Linux10php8.40:8.4.21-1.el10_2RLSA-2026:22649
Alpinev3.22php848.4.27-r0ALPINE-CVE-2026-6104
Alpinev3.23php848.4.21-r0ALPINE-CVE-2026-6104
Alpinev3.23, v3.24php858.5.6-r0ALPINE-CVE-2026-6104

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This issue is exploited via a crafted encoding passed to `mb_convert_encoding()` without sanitization. The `mb_detect_encoding()`, `mb_convert_variables()` and `mb_detect_order()` functions, as well as the `mbstring.detect_order` and `mbstring.http_output` INI settings are also vulnerable. This vulnerability allows an attacker to cause an out-of-bounds read of only 1 byte, leading to a denial of service or a limited information disclosure. Due to these reasons, this flaw has been rated with an important severity.

Red Hat's mitigation

To mitigate this vulnerability, sanitize any input containing a NUL byte before calling the vulnerable mbstring functions. Also, verify your PHP configuration to ensure the vulnerable INI settings are using securely hardcoded encodings.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10php8.4-0:8.4.21-1.el10_2Fixed 2026-06-02RHSA-2026:22649
Red Hat Enterprise Linux 10phpNot affected
Red Hat Enterprise Linux 6phpNot affected
Red Hat Enterprise Linux 7phpNot affected
Red Hat Enterprise Linux 8php:7.4/phpNot affected
Red Hat Enterprise Linux 8php:8.2/phpNot affected
Red Hat Enterprise Linux 9phpNot affected
Red Hat Enterprise Linux 9php:8.2/phpNot affected
Red Hat Enterprise Linux 9php:8.3/phpNot affected
Red Hat Hardened ImagesphpNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-6104.

Attack patterns (CAPEC)

  • CAPEC-540 Overread Buffers Likelihood: Low · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON