CVE-2026-6104: CWE-125 Out-of-bounds Read in PHP Group PHP
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.
AI Analysis
Technical Summary
This vulnerability (CVE-2026-6104) affects PHP 8.4 and 8.5 series prior to versions 8.4.21 and 8.5.6 respectively. When mbstring functions receive an encoding name with an embedded NUL byte, the internal use of strncasecmp() incorrectly assumes equal string length if it returns 0, which is not guaranteed. This leads to an out-of-bounds read of global memory, potentially causing application crashes or information disclosure. The affected mbstring functions and INI settings include mb_convert_encoding(), mb_detect_encoding(), mb_convert_variables(), mb_detect_order(), mbstring.detect_order, and mbstring.http_output. The CVSS 4.0 base score is 6.3, indicating medium severity. No patch or official remediation level is currently documented in the provided data.
Potential Impact
The vulnerability can lead to out-of-bounds memory reads in PHP mbstring functions, which may cause application crashes or potentially leak sensitive information from memory. This impacts applications using affected PHP versions (8.4.* before 8.4.21 and 8.5.* before 8.5.6) that invoke these mbstring functions with specially crafted encoding names containing embedded NUL bytes. No known exploits in the wild have been reported so far.
Mitigation Recommendations
Patch status is not yet confirmed — check the PHP Group vendor advisory for current remediation guidance. Since no official patch or remediation level is provided in the available data, users should monitor PHP Group announcements for updates. Until a fix is available, avoid passing encoding names with embedded NUL bytes to mbstring functions as a precaution.
CVE-2026-6104: CWE-125 Out-of-bounds Read in PHP Group PHP
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.
CVSS v4.0
Score 6.3medium
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability (CVE-2026-6104) affects PHP 8.4 and 8.5 series prior to versions 8.4.21 and 8.5.6 respectively. When mbstring functions receive an encoding name with an embedded NUL byte, the internal use of strncasecmp() incorrectly assumes equal string length if it returns 0, which is not guaranteed. This leads to an out-of-bounds read of global memory, potentially causing application crashes or information disclosure. The affected mbstring functions and INI settings include mb_convert_encoding(), mb_detect_encoding(), mb_convert_variables(), mb_detect_order(), mbstring.detect_order, and mbstring.http_output. The CVSS 4.0 base score is 6.3, indicating medium severity. No patch or official remediation level is currently documented in the provided data.
Potential Impact
The vulnerability can lead to out-of-bounds memory reads in PHP mbstring functions, which may cause application crashes or potentially leak sensitive information from memory. This impacts applications using affected PHP versions (8.4.* before 8.4.21 and 8.5.* before 8.5.6) that invoke these mbstring functions with specially crafted encoding names containing embedded NUL bytes. No known exploits in the wild have been reported so far.
Mitigation Recommendations
Patch status is not yet confirmed — check the PHP Group vendor advisory for current remediation guidance. Since no official patch or remediation level is provided in the available data, users should monitor PHP Group announcements for updates. Until a fix is available, avoid passing encoding names with embedded NUL bytes to mbstring functions as a precaution.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- php
- Date Reserved
- 2026-04-11T04:15:03.938Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a001cdccbff5d86104d92ae
Added to database: 5/10/2026, 5:51:24 AM
Last enriched: 5/17/2026, 10:49:47 AM
Last updated: 6/6/2026, 7:58:31 PM
Views: 70
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.