/

CVE-2026-45073

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in Symfony Cache PdoAdapter

CVE-2026-45073

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Data Manipulation / Unauthorized Deletion

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A SQL injection vulnerability in Symfony's PdoAdapter::doClear() allows untrusted prefix values to be embedded directly into a dynamically constructed DELETE query.

When an attacker can control the $prefix parameter, they may break out of the intended LIKE clause and manipulate query semantics or the scope of cache-key deletion.

Affected context

This vulnerability appears in applications using Symfony's cache component with the PDO-based adapter, where cache clear operations rely on a caller-supplied $prefix.

Risk is present when the prefix originates from, or can be influenced by, user input or external configuration rather than being fully hard-coded.

The issue manifests in environments where the database user for the cache connection has privileges that allow broad DELETE operations on the cache table or other related tables.

Exploit preconditions

  • Attack surface: Cache-clearing functionality calling PdoAdapter::doClear() with a dynamic $prefix.
  • Required access: Ability to influence or control the value of $prefix (e.g., via request parameters, headers, configuration, or multi-tenant identifiers).
  • Trigger point: Execution of the DELETE query inside doClear() that concatenates $prefix into a LIKE clause without binding or escaping.
  • Why exploitation is possible: The $prefix value is embedded directly into the SQL string, allowing crafted input to escape the literal context and alter WHERE conditions or deletion scope.

Why this happens

The underlying bug is a classical SQL injection issue mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

Instead of using parameterized queries or safely escaped placeholders, PdoAdapter::doClear() builds a DELETE statement that includes the $prefix variable inline in the SQL.

This design trusts the prefix and treats it as a benign fragment of a LIKE pattern, but when the prefix is attacker-controlled, meta-characters and additional SQL can change query semantics and affect which rows are deleted.

Potential impact

  • Cache entries for other prefixes may be deleted, impacting isolation between tenants or components.
  • Application behavior can be disrupted by targeted removal of critical cached data.
  • Depending on schema and query construction, an attacker could manipulate WHERE conditions to broaden deletion scope.
  • In misconfigured environments, the issue could contribute to more serious data integrity problems if cache tables share a database with sensitive application data.

General mitigation guidance

Effective mitigation focuses on eliminating direct string concatenation in SQL and reducing trust in dynamic prefixes.

Recommended patterns include:

  • Using parameterized queries and bound parameters for all dynamic values, including prefixes used in LIKE clauses.
  • Applying strict validation and normalization to prefix values, restricting them to expected character sets and formats.
  • Designing cache schemas and database roles so that the cache adapter operates with least-privilege and cannot affect non-cache data.
  • Encapsulating cache-key generation so that user input cannot directly become a prefix without canonicalization and safety checks.

How teams detect issues like this

Detection commonly involves:

  • Static analysis rules that flag SQL construction via string concatenation, particularly around cache or utility components.
  • Code review practices that require parameterized queries for any variable included in SQL, and scrutiny of helper methods like doClear().
  • Application security testing that exercises cache-clear endpoints with crafted prefix values to confirm they cannot alter query semantics.
  • Policy enforcement in CI pipelines, using linters or SAST tools configured to detect non-parameterized SQL usage in data access layers.

Sources

SourceLink
github.comgithub.com/symfony/symfony/commit/ec50b799d79ebe24561f29351c1efcb6da95c9b1
github.comgithub.com/symfony/symfony/releases/tag/v5.4.52
github.comgithub.com/symfony/symfony/releases/tag/v6.4.40
github.comgithub.com/symfony/symfony/releases/tag/v7.4.12
github.comgithub.com/symfony/symfony/releases/tag/v8.0.12
github.comgithub.com/symfony/symfony/security/advisories/GHSA-6qh9-h6wf-jgqc

Frequently asked

questions

Exploitation scope depends on how $prefix is sourced and the database privileges of the cache connection. If the prefix is derived from user input and the DB user can delete many rows, an attacker can significantly expand the deletion scope.

An attacker must be able to influence the $prefix value passed into the cache adapter, typically through an API parameter, tenant identifier, or configuration value exposed via the application.

The safest approach is to use parameterized SQL for all dynamic values, including prefixes, combined with strict input validation and normalization to ensure prefixes match a narrow, expected format.

Adopt a coding standard that forbids building SQL queries via string concatenation, enforce parameterized queries through code review and automated checks, and treat all external input as untrusted when used in data access layers.

Find out what's already
exploitable in your codebase.