Remote code execution via mysqlnd password overflow
Published Jun 16, 2022 · Updated Sep 17, 2024
Buffer overflow in PHP 7.4.x before 7.4.30, 8.0.x before 8.0.20, and 8.1.x before 8.1.7 allows remote attackers to execute code via PDO MySQL. The mysqlnd wire-protocol parser allocates space for the password bytes but copies the password together with a packet header, causing an out-of-bounds write when a rogue MySQL server elicits an excessively long password. Exploitation requires an application to let an attacker influence the MySQL host and password; affected PHP processes can suffer remote code execution.
Summary
What happened
Buffer overflow in PHP 7.4.x before 7.4.30, 8.0.x before 8.0.20, and 8.1.x before 8.1.7 allows remote attackers to execute code via PDO MySQL. The mysqlnd wire-protocol parser allocates space for the password bytes but copies the password together with a packet header, causing an out-of-bounds write when a rogue MySQL server elicits an excessively long password. Exploitation requires an application to let an attacker influence the MySQL host and password; affected PHP processes can suffer remote code execution.
The record
- CVE
- CVE-2022-31626
- Published
- Jun 16, 2022
- Updated
- Sep 17, 2024
- Vendor
- The PHP Group
- Product
- PHP
- Classifications
- CWE-120, T1190
- Attack vector
- network
- Privileges
- authenticated
Timeline
How it unfolded
- Jun 16, 2022CVE publishedPublication date reported by the CVE source.
- Sep 17, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=7.4.X <7.4.30
- Affected versionversion=8.0.X <8.0.20
- Affected versionversion=8.1.X <8.1.7
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- CVE-2022-31626 remote exploit write-upfunctional · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo