CVE-2022-31631

PDO::quote() may return unquoted string

Published Feb 12, 2025 CVSS 3.1 · 9.1 Critical EPSS 2.2% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-3345-1 php7.3 security update
Debian DSA Debian DSA DSA-5363-1 php7.4 security update
EUVD EUVD EUVD-2022-54225 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.
Ubuntu USN Ubuntu USN USN-5818-1 PHP vulnerability
Ubuntu USN Ubuntu USN USN-5905-1 PHP vulnerabilities
History
Type Values Removed Values Added
Metrics epss

{'score': 0.0012}

epss

{'score': 0.00123}

Type Values Removed Values Added
First Time appeared Php
Php php
Sqlite
Sqlite sqlite
CPEs cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
cpe:2.3:a:sqlite:sqlite:*:*:*:*:*:*:*:*
Vendors & Products Php
Php php
Sqlite
Sqlite sqlite
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description A flaw was found in PHP. This issue occurs due to an uncaught integer overflow in PDO::quote() of PDO_SQLite returning an improperly quoted string. With the implementation of sqlite3_snprintf(), it is possible to force the function to return a single apostrophe if the function is called on user-supplied input without any length restrictions in place. 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.
Title php: PDO:: quote() may return unquoted string due to an integer overflow PDO::quote() may return unquoted string
Weaknesses CWE-74
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'}

cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
php
Published
Updated
Feb 13, 2025, 4:06 PM
Reserved
May 25, 2022, 9:03 PM
Status
Analyzed
Published
Feb 12, 2025, 10:15 PM
Modified
Jun 17, 2026, 4:45 AM
Severity
Moderate
Public date
Jan 5, 2023, 12:00 AM