CVE-2022-31631 Details
Description
In PHP versions 8.0.* before 8.0.27, 8.1.* before 8.1.15, 8.2.* before 8.2.2 when using PDO::quote() function to quote user-supplied data for SQLite, supplying an overly long string may cause the driver to incorrectly quote the data, which may further lead to SQL injection vulnerabilities.
A vulnerability exists in the PHP SQLite PDO driver, specifically in PHP versions 8.0.* prior to 8.0.27, 8.1.* prior to 8.1.15, and 8.2.* prior to 8.2.2. The issue arises from an uncaught integer overflow in the PDO::quote() function, which is used to safely quote user-supplied data for SQLite. When an excessively long string is provided, the driver may fail to quote the data correctly. This improper quoting can create SQL injection vulnerabilities. The problem is exacerbated by recent versions of SQLite (3.39.2 and 3.39.4), which allow the exploitation of this flaw by manipulating the input string length.
Users can upgrade to PHP versions 8.0.27, 8.1.15, or 8.2.2 to address this vulnerability.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Feb 13, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://bugs.php.net/bug.php?id=81740 | CISA-ADP | Vendor Advisory |
| https://security.netapp.com/advisory/ntap-20230223-0007/ | CVE | Third Party Advisory |
| https://bugs.php.net/bug.php?id=81740 | [email protected] | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| php php | >= 8.0.0, < 8.0.27 >= 8.1.0, < 8.1.15 >= 8.2.0, < 8.2.2 |
CPE
Remediation
| |
| sqlite sqlite | >= 3.39.2 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jul 2, 2025 | Initial Analysis | [email protected] |
| Feb 13, 2025 | CVE Modified | CISA-ADP |
| Feb 12, 2025 | CVE Modified | CVE |
| Feb 12, 2025 | New CVE Received | [email protected] |