CRITICAL✓ PATCH🇵🇱 Wersja polska

CVE-2022-31631

CVSS 9.1v3.1pub. 2025-02-12upd. 2025-07-02

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.

🤖 AI Analysis
How it works

The PDO::quote() function is used to safely quote user-supplied data before passing it to an SQL query. When the provided string is too long, the SQLite driver in PHP quotes it incorrectly, causing data to escape the expected context. This results in the possibility of injecting arbitrary SQL instructions (SQL injection) into the query executed in the SQLite database.

Impact

An attacker can read or modify data stored in the SQLite database, bypassing protection mechanisms based on PDO::quote(). Consequently, unauthorized disclosure of sensitive data and manipulation of database contents is possible.

Mitigation & patch

PHP should be updated to version 8.0.27 or newer (8.0 branch), 8.1.15 or newer (8.1 branch), or 8.2.2 or newer (8.2 branch). As a workaround, it is recommended to use parameterized queries (prepared statements) instead of manual data quoting via PDO::quote().

Who is affected

PHP in versions 8.0.x before 8.0.27, 8.1.x before 8.1.15, and 8.2.x before 8.2.2 — only when using the PDO driver with SQLite.

Analysis generated by Claude AI (Anthropic) based on NVD data. Always verify with vendor.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
  • PHP

    APP
    Php
    8.0.0 – 8.0.27 (excl.)8.1.0 – 8.1.15 (excl.)8.2.0 – 8.2.2 (excl.)
  • Sqlite

    APP
    Sqlite
    ≥ 3.39.2
🟢
PATCH AVAILABLE
Vendor update available. Deploy in standard maintenance cycle.
Tags
SQLi
CWE
References

Related vulnerabilities

CVE-2024-4577CRITICAL9.8⚠ KEVPL ✓same product

PHP CGI argument injection – RCE na Windows przez mechanizm Best-Fit

CVE-2012-1823CRITICAL9.8⚠ KEVPL ✓same product

RCE w PHP-CGI poprzez wstrzyknięcie opcji wiersza poleceń

CVE-2026-6722CRITICAL9.5PL ✓same product

Use-after-free w rozszerzeniu SOAP PHP umożliwiające RCE

CVE-2024-11235CRITICAL9.2PL ✓same product

PHP use-after-free przez __set lub ??= z wyjątkami — RCE

CVE-2024-11236CRITICAL9.8PL ✓same product

PHP: integer overflow w ldap_escape() prowadzący do out-of-bounds write