← Vulnerability feed

Vulnerability record · CVE-2022-31626 · published 16 June 2022

CVE-2022-31626: PHP pdo_mysql/mysqlnd buffer overflow via oversized password

Php · Php

PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7 contain a classic buffer overflow in the pdo_mysql extension when using the mysqlnd driver. If an application lets a third party supply the database host and password, a password of excessive length overflows the buffer and can lead to remote code execution.

8.8 CVSS 3.1 High EPSS 58% · top 0.9% CWE-120 · Classic buffer overflow
8.8CVSS 3.1 base score, v2 6.0
58%EPSS exploitation probability, 30 days
NoNot in CISA KEV
2Affected product versions listed by NVD
14References, 2 tagged exploit
17 Jun 2026Last modified by NVD

Description

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.

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 19 September 2026. Confidence: high.

high priorityCVSS 8.8 with network reachability and high EPSS, but exploitation requires the application to accept attacker-controlled host and password values.

What it is

PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7 contain a classic buffer overflow in the pdo_mysql extension when using the mysqlnd driver. If an application lets a third party supply the database host and password, a password of excessive length overflows the buffer and can lead to remote code execution.

Impact

An attacker who controls the supplied host and password can trigger memory corruption in the PHP process, potentially achieving remote code execution with the privileges of that process.

Attack surface

Reached over the network through the application's database connection path when user-controlled host and password values are passed to pdo_mysql with mysqlnd. The CVSS vector requires low privileges and no user interaction.

Exploitation

Not listed in CISA KEV and no ransomware use is documented, but EPSS is 0.58123 (99th percentile) and the vendor bug reference is tagged Exploit and Patch, indicating public exploit material exists.

What to do

  • Upgrade PHP to 7.4.30, 8.0.20, 8.1.7 or later, or apply the vendor patch referenced in the PHP bug report.
  • Update distribution packages (Debian DSA-5179, Fedora, Gentoo GLSA 202209-20) to the fixed versions.
  • Do not allow untrusted users to supply the database host or password used by pdo_mysql; enforce server-side allowlists and length limits.
  • If immediate patching is not possible, restrict network access to the PHP application and monitor for abnormal database connection parameters.

Detection

  • Search application and web logs for unusually long password values or user-controlled host parameters passed to database connection routines.
  • Monitor PHP-FPM/Apache process crashes or memory corruption signals that coincide with database connection attempts.
  • Audit code paths where request data flows into PDO MySQL DSN or password arguments, especially multi-tenant or user-configurable connection settings.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

2 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2022-31626 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed9.8CVE-2024-4577PHP-CGI on Windows argument injection leads to remote code executionPHP-CGI on Windows can misinterpret characters in the command line passed to Win32 API functions when certain code pages are configured, due to Windo…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2022-31626), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.