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

Exp

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 pdo_mysql 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.

Published: 2022-06-16 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-31626 is rated High Exploit Risk (74.9/100): CVSS High severity, with high exploitation likelihood (EPSS 10.24%, 93th percentile). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2022-31626

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2022-31626

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-03-25 12.89% 10.24% -2.65%
2 2026-03-22 16.32% 12.89% -3.43%
3 2026-03-18 16.32%

Full EPSS history (67 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-31626

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
7.5 3.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
1.6 5.9 [email protected]
8.8 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.8 5.9 [email protected]
6.0 2.0 MEDIUM
AV:N/AC:M/Au:S/C:P/I:P/A:P Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:M)
Exploitation needs some favorable conditions, but not exceptional ones.
Authentication (AU:S)
A single authentication is required.
Confidentiality impact (C:P)
Partial confidentiality impact.
Integrity impact (I:P)
Partial integrity impact.
Availability impact (A:P)
Partial availability impact.
6.8 6.4 [email protected]

Weakness enumeration for CVE-2022-31626

OS Trackers for CVE-2022-31626

vendor priority summary link
alpine high CVE-2022-31626: 2 source package rows (php8, php81); 5 state rows across 4 repos (3.17-community, 3.18-community, 3.19-community, edge-community); fixed 5, open 0. https://security.alpinelinux.org/vuln/CVE-2022-31626
debian not yet assigned CVE-2022-31626 not yet assigned priority: Debian including 1 source packages (php7.4), 1 status rows across 1 suites (bullseye): resolved 1. https://security-tracker.debian.org/tracker/CVE-2022-31626
gentoo high CVE-2022-31626: 1 GLSA(s) (202209-20), 1 atom(s) (dev-lang/php); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-31626
redhat high https://access.redhat.com/security/cve/CVE-2022-31626
suse high CVE-2022-31626 severity important: SUSE including 510 source package names (8-4.1:apache2-mod_php8-8.0.10-150400.4.8.1, 8-4.1:php8-8.0.10-150400.4.8.1, …), 2023 product×package rows across 48 product lines (Container bci/php, Container bci/php-apache, … (48 product lines)): Fixed 2022, Known Not Affected 1. https://www.suse.com/security/cve/CVE-2022-31626/
ubuntu medium CVE-2022-31626 medium priority: Ubuntu including 6 source packages (php5, php7.0, php7.2, php7.4, php8.0, php8.1), 84 status rows across 14 suites (bionic, focal, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): DNE 70, released 10, needs-triage 3, needed 1. https://ubuntu.com/security/CVE-2022-31626

Affected software / configurations for CVE-2022-31626

Vendor Product Version Raw CPE
php php >= 7.4.0, < 7.4.30 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
php php >= 8.0.0, < 8.0.20 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
php php >= 8.1.0, < 8.1.7 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
debian debian_linux 10.0 cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*
debian debian_linux 11.0 cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*

References for CVE-2022-31626

cvelogic Threat Intelligence