CVE-2022-31626: mysqlnd/pdo password buffer overflow

Published Jun 6, 2022
·
Updated

Fixed bug : mysqlnd/pdo password buffer overflow. (CVE-2022-31626)

Other sources

In PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7, when pdomysql extension with mysqlnd driver, if the third party is allowed to supply host to connect to and the password for the connection, password of excessive length can trigger a buffer overflow in PHP, which can lead to a remote code execution vulnerability.

Affected Software

29 affected componentsFixes available
PHP PHP<8.0.20
8.0.20
PHP PHP>=7.4.0<7.4.30
PHP PHP>=8.0.0<8.0.20
PHP PHP>=8.1.0<8.1.7
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Microsoft cbl2 php
redhat/php<7.4.30
7.4.30
redhat/php<8.0.20
8.0.20
redhat/php<8.1.7
8.1.7
alpine/php7<7.4.32-r0
7.4.32-r0
alpine/php7<7.4.32-r0
7.4.32-r0
alpine/php8<8.0.24-r0
8.0.24-r0
alpine/php8<8.0.25-r0
8.0.25-r0
alpine/php8<8.0.24-r0
8.0.24-r0
alpine/php81<8.1.7-r0
8.1.7-r0
alpine/php81<8.1.6-r2
8.1.6-r2
alpine/php81<8.1.6-r2
8.1.6-r2
alpine/php81<8.1.6-r2
8.1.6-r2
debian/php7.4<7.4.30-1+deb11u1
7.4.30-1+deb11u1
debian/php7.0
debian/php7.3
7.3.31-1~deb10u2
debian/php7.4
7.4.30-1+deb11u1
debian/php8.1
8.1.7-1
ubuntu/php5*
ubuntu/php7.0<7.0.33-0ubuntu0.16.04.16+esm4
7.0.33-0ubuntu0.16.04.16+esm4
ubuntu/php7.2<7.2.24-0ubuntu0.18.04.12
7.2.24-0ubuntu0.18.04.12
ubuntu/php7.4<7.4.3-4ubuntu2.12
7.4.3-4ubuntu2.12
ubuntu/php8.1<8.1.2-1ubuntu2.1
8.1.2-1ubuntu2.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.0.20
  2. Upgrade

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

    Fixed in 7.4.30
  3. Upgrade

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

    Fixed in 8.0.20
  4. Upgrade

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

    Fixed in 8.1.7
  5. Upgrade

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

    Fixed in 7.4.32-r0
  6. Upgrade

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

    Fixed in 8.0.24-r0
  7. Upgrade

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

    Fixed in 8.0.25-r0
  8. Upgrade

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

    Fixed in 8.1.7-r0
  9. Upgrade

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

    Fixed in 8.1.6-r2
  10. Upgrade

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

    Fixed in 7.4.30-1+deb11u1
  11. Upgrade

    Upgrade debian/php7.3 to a version that resolves this vulnerability.

    Fixed in 7.3.31-1~deb10u2
  12. Upgrade

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

    Fixed in 8.1.7-1
  13. Upgrade

    Upgrade ubuntu/php7.0 to a version that resolves this vulnerability.

    Fixed in 7.0.33-0ubuntu0.16.04.16+esm4
  14. Upgrade

    Upgrade ubuntu/php7.2 to a version that resolves this vulnerability.

    Fixed in 7.2.24-0ubuntu0.18.04.12
  15. Upgrade

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

    Fixed in 7.4.3-4ubuntu2.12
  16. Upgrade

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

    Fixed in 8.1.2-1ubuntu2.1
  17. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 7.4.30
  18. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.1.7

Event History

Jun 6, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
Jun 9, 2022
Data Sourced
12:00 AM
DescriptionAffected Software
Updated
12:00 AM
Affected Software
Jun 13, 2022
Data Sourced
via OSV·12:00 AM
DescriptionSeverityAffected Software
Jun 16, 2022
CVE Published
via MITRE·05:45 AM
Data Sourced
via NVD·06:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Jun 20, 2022
Data Sourced
via Red Hat·04:50 AM
DescriptionSeverityAffected Software
Dec 6, 2022
Exploit Published
via GitHub·04:19 PM
Feb 23, 2023
Data Sourced
01:37 AM
RemedySeverityWeakness
Oct 1, 2025
Data Sourced
via Microsoft·11:11 PM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·11:11 PM
Affected Software
Nov 24, 2026
Withdrawn
via OSV·04:29 AM

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is CVE-2022-31626?

CVE-2022-31626 is a vulnerability in PHP that allows a buffer overflow when using the pdo_mysql extension with the mysqlnd driver and allowing a third party to supply the host and password for the connection.

2

How does CVE-2022-31626 affect PHP?

CVE-2022-31626 affects PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7.

3

What is the severity of CVE-2022-31626?

CVE-2022-31626 has a severity value of 8.8, which is considered high.

4

How can I fix CVE-2022-31626?

To fix CVE-2022-31626, upgrade PHP to version 7.4.30, 8.0.20, or 8.1.7.

5

Where can I find more information about CVE-2022-31626?

You can find more information about CVE-2022-31626 on the official PHP bug report (https://bugs.php.net/bug.php?id=81719) and the Debian and Fedora project announcements (https://lists.debian.org/debian-lts-announce/2022/12/msg00030.html, https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3T4MMEEZYYAEHPQMZDFN44PHORJWJFZQ/).

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