CVE-2022-31626
PHP vulnerability analysis and mitigation

Overview

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. The vulnerability exists in the pdo_mysql extension with mysqlnd driver, where if a third party is allowed to supply host to connect to and the password for the connection, a password of excessive length can trigger a buffer overflow in PHP (PHP Bug, MITRE).

Technical details

The vulnerability stems from a buffer overflow condition in the mysqlnd/pdo password handling. When copying the user-submitted password to a buffer for MySQL server authentication, the code allocates auth_data_len bytes but copies auth_data_len + MYSQLND_HEADER_SIZE bytes, leading to a buffer overflow. This occurs during the legacy authentication method that requires sending a raw password instead of using challenge/response logic (PHP Bug). The vulnerability has been assigned a CVSS score of 8.8 (High) with the vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NetApp Advisory).

Impact

Successful exploitation of this vulnerability could lead to remote code execution on the affected system. The vulnerability is particularly concerning for applications like Adminer and PHPMyAdmin that handle database connections (PHP Bug).

Mitigation and workarounds

The vulnerability has been fixed in PHP versions 7.4.30, 8.0.20, and 8.1.7. Users are strongly recommended to upgrade to these versions or later. The fix involves adding the size of the header in the buffer allocation computation (Fedora Update).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-65346CRITICAL9.1
  • PHPPHP
  • alexusmai/laravel-file-manager
NoNoDec 04, 2025
CVE-2025-66468HIGH7.6
  • PHPPHP
  • aimeos/ai-cms-grapesjs
NoYesDec 02, 2025
CVE-2025-65345MEDIUM6.5
  • PHPPHP
  • alexusmai/laravel-file-manager
NoNoDec 03, 2025
CVE-2025-65657MEDIUM6.5
  • PHPPHP
  • feehi/cms
NoNoDec 02, 2025
CVE-2025-65186MEDIUM6.1
  • PHPPHP
  • getgrav/grav
NoNoDec 02, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management