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

Published May 7, 2026
·
Updated

Fixed (Out-of-bounds access in mbflname2encodingex()). (CVE-2026-6104)

Other sources

Global buffer over-read in mbconvertencoding() with attacker-supplied encoding

— Microsoft

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 mbconvertencoding() 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 mbconvertencoding(), mbdetectencoding(), mbconvertvariables(), and mbdetectorder(), as well as the mbstring.detectorder and mbstring.httpoutput INI settings.

— Red Hat

Affected Software

21 affected componentsFixes available
PHP PHP<8.5.6
8.5.6
PHP PHP>=8.4.0<8.4.21
PHP PHP>=8.5.0<8.5.6
bitnami/php>=8.4.0<8.4.21
8.4.21
bitnami/php>=8.5.0<8.5.6
8.5.6
bitnami/php-min>=8.4.0<8.4.21
8.4.21
bitnami/php-min>=8.5.0<8.5.6
8.5.6
bitnami/libphp>=8.4.0<8.4.21
8.4.21
bitnami/libphp>=8.5.0<8.5.6
8.5.6
All of the following
azurelinux/php<0:8.4.26-5.azl4
0:8.4.26-5.azl4
Microsoft Azure Linux=4.0
ubuntu/php8.4<8.4.11-1ubuntu1.2
8.4.11-1ubuntu1.2
ubuntu/php8.5<8.5.4-0ubuntu1.1
8.5.4-0ubuntu1.1
alpine/php84<8.4.27-r0
8.4.27-r0
alpine/php84<8.4.21-r0
8.4.21-r0
alpine/php85<8.5.6-r0
8.5.6-r0
alpine/php85<8.5.6-r0
8.5.6-r0
alpine/php85<8.5.6-r0
8.5.6-r0
debian/php7.4
debian/php8.2
debian/php8.4
8.4.21-1~deb13u18.4.21-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 8.5.6
  2. Upgrade

    Upgrade alpine/php84 to a version that resolves this vulnerability.

    Fixed in 8.4.27-r0
  3. Upgrade

    Upgrade alpine/php84 to a version that resolves this vulnerability.

    Fixed in 8.4.21-r0
  4. Upgrade

    Upgrade alpine/php85 to a version that resolves this vulnerability.

    Fixed in 8.5.6-r0
  5. Upgrade

    Upgrade bitnami/php to a version that resolves this vulnerability.

    Fixed in 8.4.21
  6. Upgrade

    Upgrade bitnami/php to a version that resolves this vulnerability.

    Fixed in 8.5.6
  7. Upgrade

    Upgrade bitnami/php-min to a version that resolves this vulnerability.

    Fixed in 8.4.21
  8. Upgrade

    Upgrade bitnami/php-min to a version that resolves this vulnerability.

    Fixed in 8.5.6
  9. Upgrade

    Upgrade bitnami/libphp to a version that resolves this vulnerability.

    Fixed in 8.4.21
  10. Upgrade

    Upgrade bitnami/libphp to a version that resolves this vulnerability.

    Fixed in 8.5.6
  11. Upgrade

    Upgrade azurelinux/php to a version that resolves this vulnerability.

    Fixed in 0:8.4.26-5.azl4
  12. Upgrade

    Upgrade ubuntu/php8.4 to a version that resolves this vulnerability.

    Fixed in 8.4.11-1ubuntu1.2
  13. Upgrade

    Upgrade ubuntu/php8.5 to a version that resolves this vulnerability.

    Fixed in 8.5.4-0ubuntu1.1
  14. Upgrade

    Upgrade debian/php8.4 to a version that resolves this vulnerability.

    Fixed in 8.4.21-1~deb13u1Fixed in 8.4.21-1
  15. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.4.21
  16. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.5.6

Event History

May 7, 2026
CVE Published
via PHP·12:00 AM
Data Sourced
via PHP·12:00 AM
DescriptionAffected Software
Updated
via PHP·12:00 AM
Affected Software
May 10, 2026
CVE Published
via MITRE·04:35 AM
Data Sourced
via MITRE·04:35 AM
DescriptionWeakness
Data Sourced
via OSV·04:35 AM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·06:01 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·06:16 AM
DescriptionSeverityWeakness
May 12, 2026
Advisory Published
via OSV·08:50 AM
Data Sourced
via NVD·05:35 PM
Affected Software
Updated
via NVD·05:35 PM
Severity
Jun 30, 2026
Updated
via NVD·03:21 AM
SeverityWeakness
Jul 24, 2026
Updated
via NVD·08:10 AM
SeverityWeakness
Nov 14, 2026
Data Sourced
via Microsoft·04:50 AM
DescriptionSeverityWeaknessAffected Software
Nov 24, 2026
Data Sourced
via OSV·02:55 PM
Affected Software
Dec 3, 2026
Updated
via OSV·11:33 PM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2026-6104?

CVE-2026-6104 has a high severity rating due to the potential for an attacker to exploit a global buffer over-read.

2

How do I fix CVE-2026-6104?

To fix CVE-2026-6104, upgrade PHP to version 8.4.21 or 8.5.6 or later.

3

What versions of PHP are affected by CVE-2026-6104?

CVE-2026-6104 affects PHP versions 8.4.* before 8.4.21 and 8.5.* before 8.5.6.

4

What is the impact of exploiting CVE-2026-6104?

Exploiting CVE-2026-6104 can lead to an out-of-bounds memory access, potentially resulting in information disclosure.

5

Is there a recommended workaround for CVE-2026-6104?

There is no specific workaround for CVE-2026-6104 other than upgrading to a patched version of PHP.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203