PHP: Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding
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 software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| PHP (interpreter) | PHP | >= 8.4.0, < 8.4.21, >= 8.5.0, < 8.5.6 ext-mbstring: < 8.4.21; < 8.5.6 |
8.4.21, 8.5.6 |
References
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N- Weakness (CWE)
CWE-125- Platform
- PHP
- Package
PHP- Disclosed
- 07.05.2026
- Updated
- 03.11.2026 19:17
Sources and licenses
PHP Security Advisories - GHSA-74r9-qxhc-fx53 - CVE Terms of Use
Copyright 1999-2026 The MITRE Corporation
Copyright 1999-2026 The MITRE Corporation
CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE™). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy.
https://www.cve.org/Legal/TermsOfUseVulnerability history: PHP
All published vulnerabilities of this package (PHP (interpreter)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 78
- First → latest
- 02.2023 11.2026
- Without a fix
- 1
- Exploited in attacks
- 3
Severity breakdown
- Critical 11
- High 16
- Medium 42
- Low 9
Disclosures per year
- 2023: 5
- 2024: 17
- 2025: 12
- 2026: 44
-
PHP: Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.