CVE-2022-31631 | PDO::quote() may return unquoted string

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.

Published: 2025-02-12 Last update: 2025-07-02 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-31631 is rated Moderate Risk (60.3/100): CVSS Critical severity, with medium exploitation likelihood (EPSS 0.57%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2022-31631

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-05-13 0.68% 0.57% -0.11%
2 2026-02-20 0.80% 0.68% -0.12%
3 2026-01-15 0.80%

Full EPSS history (21 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-31631

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
9.1 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:N)
Service keeps running; no real outage angle.
3.9 5.2 [email protected]

Weakness enumeration for CVE-2022-31631

OS Trackers for CVE-2022-31631

vendor priority summary link
alpine CVE-2022-31631: 2 source package rows (php81, php82); 10 state rows across 7 repos (3.17-community, 3.18-community, 3.19-community, 3.20-community, 3.21-community, 3.22-community, edge-community); fixed 10, open 0. https://security.alpinelinux.org/vuln/CVE-2022-31631
debian not yet assigned CVE-2022-31631 not yet assigned priority: Debian including 2 source packages (php7.4, php8.2), 2 status rows across 2 suites (bookworm, bullseye): resolved 2. https://security-tracker.debian.org/tracker/CVE-2022-31631
gentoo high CVE-2022-31631: 1 GLSA(s) (202408-32), 1 atom(s) (dev-lang/php); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-31631
redhat medium https://access.redhat.com/security/cve/CVE-2022-31631
suse medium CVE-2022-31631 severity moderate: SUSE including 499 source package names (8-4.1:apache2-mod_php8-8.0.27-150400.4.23.1, 8-4.1:php8-8.0.27-150400.4.23.1, …), 1642 product×package rows across 40 product lines (Container bci/php, Container bci/php-apache, … (40 product lines)): Fixed 1642. https://www.suse.com/security/cve/CVE-2022-31631/
ubuntu medium CVE-2022-31631 medium priority: Ubuntu including 5 source packages (php5, php7.0, php7.2, php7.4, php8.1), 41 status rows across 13 suites (bionic, focal, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): DNE 29, released 7, needs-triage 4, needed 1. https://ubuntu.com/security/CVE-2022-31631

Affected software / configurations for CVE-2022-31631

Vendor Product Version Raw CPE
php php >= 8.0.0, < 8.0.27 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
php php >= 8.1.0, < 8.1.15 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
php php >= 8.2.0, < 8.2.2 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*

References for CVE-2022-31631

cvelogic Threat Intelligence