Code execution via freeing uninitialized query parameters
Published Jun 16, 2022 · Updated Sep 16, 2024
Invalid free 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 or crash PHP. Parameter-conversion failure in pg_query_params() and pg_send_execute() passes the full parameter count to _php_pgsql_free_params(), causing it to free uninitialized pointer entries beyond those already initialized. Exploitation requires the PostgreSQL extension and an application path that supplies attacker-controlled, nonconvertible query parameters; successful abuse grants process-level code execution or interrupts the PHP service.
Summary
What happened
Invalid free 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 or crash PHP. Parameter-conversion failure in pg_query_params() and pg_send_execute() passes the full parameter count to _php_pgsql_free_params(), causing it to free uninitialized pointer entries beyond those already initialized. Exploitation requires the PostgreSQL extension and an application path that supplies attacker-controlled, nonconvertible query parameters; successful abuse grants process-level code execution or interrupts the PHP service.
The record
- CVE
- CVE-2022-31625
- Published
- Jun 16, 2022
- Updated
- Sep 16, 2024
- Vendor
- The PHP Group
- Product
- PHP
- Classifications
- CWE-824, CWE-590, T1190
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Jun 16, 2022CVE publishedPublication date reported by the CVE source.
- Sep 16, 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
No public exploit references are available in this record.
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