CVE-2022-31631: PDO::quote() may return unquoted string
CVE-2022-31631 php: PDO::quote() may return unquoted string
https://www.php.net/ChangeLog-8.php#8.0.27 https://bugs.php.net/bug.php?id=81740 https://github.com/php/php-src/commit/921b6813da3237a83e908998483f46ae3d8bacba
Other sources
Fixed bug (PDO::quote() may return unquoted string). (CVE-2022-31631)
— PHP
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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 8.0.27 - Upgrade
Upgrade
debian/php8.2to a version that resolves this vulnerability.Fixed in 8.2.32-1~deb12u1Fixed in 8.2.35-1~deb12u1 - Upgrade
Upgrade
alpine/php8to a version that resolves this vulnerability.Fixed in 8.0.27-r0 - Upgrade
Upgrade
alpine/php81to a version that resolves this vulnerability.Fixed in 8.1.14-r0 - Upgrade
Upgrade
alpine/php82to a version that resolves this vulnerability.Fixed in 8.2.1-r0 - Upgrade
Upgrade
debian/php8.2to a version that resolves this vulnerability.Fixed in 8.2.1-1 - Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 8.1.15 - Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 8.2.2
Event History
Frequently Asked Questions
What is CVE-2022-31631?
CVE-2022-31631 is a vulnerability in PHP which allows PDO::quote() to return an unquoted string.
How does CVE-2022-31631 affect PHP?
CVE-2022-31631 affects PHP versions up to and including 8.0.27.
Is there a fix available for CVE-2022-31631?
Yes, the vulnerability has been fixed in PHP version 8.0.27.
What is PDO::quote()?
PDO::quote() is a PHP function used to quote a string for use in a query.
How can I find more information about CVE-2022-31631?
You can find more information about CVE-2022-31631 in the PHP ChangeLog for version 8.0.27.