CVE-2024-3096: PHP function password_verify can erroneously return true when argument contains NUL

Published Apr 11, 2024
·
Updated

Fixed bug GHSA-h746-cjrr-wfmr (passwordverify can erroneously return true, opening ATO risk). (CVE-2024-3096)

Other sources

If a password stored with passwordhash starts with a null byte (\x00), testing a blank string as the password via passwordverify will incorrectly return true.

If a user were able to create a password with a leading null byte (unlikely, but syntactically valid), an attacker could trivially compromise the victim's account by attempting to sign in with a blank string.

— Red Hat

In PHP  version 8.1. before 8.1.28, 8.2. before 8.2.18, 8.3. before 8.3.5, if a password stored with passwordhash() starts with a null byte (\x00), testing a blank string as the password via passwordverify() will incorrectly return true.

— NVD

PHP function passwordverify can erroneously return true when argument contains NUL

— Microsoft

Affected Software

25 affected componentsFixes available
PHP PHP<8.1.28
8.1.28
redhat/php<8.1.28
8.1.28
redhat/php<8.2.18
8.2.18
redhat/php<8.3.6
8.3.6
PHP PHP>=8.1.0<8.1.28
PHP PHP>=8.2.0<8.2.18
PHP PHP>=8.3.0<8.3.5
Debian Debian Linux=10.0
Microsoft cbl2 php 8.1.22-2<8.1.28-1
8.1.28-1
Microsoft cbl2 php 8.1.28-1<8.1.28-1
8.1.28-1
Microsoft azl3 php 8.1.22-2<8.3.4-1
8.3.4-1
Microsoft azl3 php 8.3.4-1<8.3.4-1
8.3.4-1
debian/php8.2<8.2.18-1~deb12u1
8.2.18-1~deb12u1
debian/php8.2
8.2.32-1~deb12u18.2.35-1~deb12u1
alpine/php81<8.1.28-r0
8.1.28-r0
alpine/php82<8.2.18-r0
8.2.18-r0
alpine/php82<8.2.18-r0
8.2.18-r0
alpine/php82<8.2.18-r0
8.2.18-r0
alpine/php82<8.2.18-r0
8.2.18-r0
alpine/php83<8.3.6-r0
8.3.6-r0
alpine/php83<8.3.5-r0
8.3.5-r0
alpine/php83<8.3.5-r0
8.3.5-r0
alpine/php83<8.3.5-r0
8.3.5-r0
alpine/php83<8.3.5-r0
8.3.5-r0
alpine/php83<8.3.5-r0
8.3.5-r0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.1.28
  2. Upgrade

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

    Fixed in 8.1.28
  3. Upgrade

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

    Fixed in 8.2.18
  4. Upgrade

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

    Fixed in 8.3.6
  5. Upgrade

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

    Fixed in 8.1.28-1
  6. Upgrade

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

    Fixed in 8.3.4-1
  7. Upgrade

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

    Fixed in 8.2.18-1~deb12u1
  8. Upgrade

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

    Fixed in 8.2.32-1~deb12u1Fixed in 8.2.35-1~deb12u1
  9. Upgrade

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

    Fixed in 8.1.28-r0
  10. Upgrade

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

    Fixed in 8.2.18-r0
  11. Upgrade

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

    Fixed in 8.3.6-r0
  12. Upgrade

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

    Fixed in 8.3.5-r0
  13. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.2.18
  14. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.3.5

Event History

Apr 11, 2024
CVE Published
via PHP·12:00 AM
Apr 29, 2024
CVE Published
via MITRE·03:42 AM
Data Sourced
via MITRE·03:42 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:15 AM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·04:15 AM
DescriptionSeverityAffected Software
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2024-3096?

CVE-2024-3096 has a moderate severity level due to the potential for unauthorized access if exploited.

2

How do I fix CVE-2024-3096?

To fix CVE-2024-3096, update to the recommended versions of PHP: 7.4.33-1+deb11u5, 8.2.20-1~deb12u1, 8.2.23, or 8.1.28.

3

What does CVE-2024-3096 affect?

CVE-2024-3096 affects the PHP password_verify function, particularly when handling passwords with null bytes.

4

What issues can arise from CVE-2024-3096?

CVE-2024-3096 can lead to an authorization token (ATO) risk if blank strings are incorrectly accepted as valid passwords.

5

Which PHP versions are vulnerable to CVE-2024-3096?

The vulnerable PHP versions include 7.4, 8.1.x, and 8.2.x prior to their respective patched versions.

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