CVE-2026-6104

Description

A flaw was found in PHP. When an encoding name containing an embedded NUL byte is passed to mb_convert_encoding() or related mbstring functions, an out-of-bounds read of only 1 byte can occur due to the incorrect processing of string lengths. This issue can cause a denial of service or limited information disclosure.

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.

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.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score8.29.18.2
Attack VectorNetworkNetworkNetwork
Attack ComplexityLowLowLow
Privileges RequiredNoneNoneNone
User InteractionNoneNoneNone
ScopeUnchangedUnchangedUnchanged
ConfidentialityLowHighLow
Integrity ImpactNoneNoneNone
Availability ImpactHighHighHigh

Vector

Red Hat: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

NVD: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

cve.org: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

Red Hat CVSS v3 Score Explanation

This issue can cause an out-of-bounds read of only 1 byte, limiting the information disclosure impact of this vulnerability. To reflect this condition, the confidentiality metric is set to low.

Understanding the Weakness (CWE)

Confidentiality

Technical Impact: Read Memory

An attacker could get secret values such as cryptographic keys, PII, memory addresses, or other information that could be used in additional attacks.

Confidentiality

Technical Impact: Bypass Protection Mechanism

Out-of-bounds memory could contain memory addresses or other information that can be used to bypass ASLR and other protection mechanisms in order to improve the reliability of exploiting a separate weakness for code execution.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

An attacker could cause a segmentation fault or crash by causing memory to be read outside of the bounds of the buffer. This is especially likely when the code reads a variable amount of data and assumes that a sentinel exists to stop the read operation, such as a NUL in a string.

Other

Technical Impact: Varies by Context

The read operation could produce other undefined or unexpected results.

Frequently Asked Questions

Want to get errata notifications? Sign up here.