CVE-2026-45073
JSON

6.3medium

Symfony: SQL Injection in PdoAdapter::doClear() via Unsanitized $prefix

Severity
6.3medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.41% (higher than 37% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-6qh9-h6wf-jgqc

Description

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Prior to 5.4.52, 6.4.40, 7.4.12, and 8.0.12, PdoAdapter::doClear() builds a DELETE statement using a namespace derived from the caller-supplied $prefix without binding or escaping it, allowing a caller able to influence $prefix to break out of the LIKE literal and alter query semantics or deletion scope. This issue is fixed in versions 5.4.52, 6.4.40, 7.4.12, and 8.0.12.

Affected

Product or packageVersionsReported by
symfony symfony< 5.4.52, >= 6.0.0-BETA1, < 6.4.40, >= 7.0.0-BETA1, < 7.4.12, >= 8.0.0-BETA1, < 8.0.12CVE List
cache symfony< 5.4.52, >= 6.0.0-BETA1, < 6.4.40, >= 7.0.0-BETA1, < 7.4.12, >= 8.0.0-BETA1, < 8.0.12CVE List
symfony/cache (Packagist)before 5.4.52, from 6.0.0 before 6.4.40, from 7.0.0 before 7.4.12, from 8.0.0 before 8.0.12GitHub Advisory Database
symfony/symfony (Packagist)before 5.4.52, from 6.0.0 before 6.4.40, from 7.0.0 before 7.4.12, from 8.0.0 before 8.0.12GitHub Advisory Database
sensiolabs symfonybefore 5.4.52, from 6.0.0 before 6.4.40, from 7.0.0 before 7.4.12, from 8.0.0 before 8.0.12NVD

All scores

GitHub_M6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N/E:U
NVD7.3high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Classification

CWE-89

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Prior to 5.4.52, 6.4.40, 7.4.12, and 8.0.12, PdoAdapter::doClear() builds a DELETE statement using a namespace derived from the caller-supplied $prefix without binding or escaping it, allowing a caller able to influence $prefix to break out of the LIKE literal and alter query semantics or deletion scope. This issue is fixed in versions 5.4.52, 6.4.40, 7.4.12, and 8.0.12.

GitHub Advisory Database
Description

Symfony\Component\Cache\Adapter\PdoAdapter is the PDO-backed cache adapter. Its clear($prefix) method (inherited from AbstractAdapterTrait) is documented to delete cache items whose key starts with $prefix.

In the non-versioning code path, the caller-supplied $prefix is concatenated into $namespace = $this->namespace.$prefix and passed to PdoAdapter::doClear(), which builds:

DELETE FROM <table> WHERE <id_col> LIKE '<namespace>%'

The value is interpolated directly into the SQL text and executed with PDO::exec(): $namespace is not bound. A caller able to influence $prefix can break out of the literal and inject SQL, expanding deletion scope from the intended prefix to arbitrary rows, or otherwise reshape query semantics.

Most applications don't expose clear($prefix) to untrusted input directly, but the contract of the method is to safely accept any prefix string, so the lack of escaping is a defect of the adapter itself.

Resolution

AbstractAdapterTrait::clear() now rejects any $prefix containing characters outside [-+.A-Za-z0-9]: when an invalid prefix is supplied, the method logs a warning and returns false instead of reaching the SQL layer. This blocks quotes, %, null bytes and other characters that would let an attacker break out of the LIKE literal.

The patch for this issue is available here for branch 5.4.

Credits

Symfony would like to thank secsys_codex for reporting the issue and Nicolas Grekas for fixing it.

NVD (es)

Symfony es un framework PHP para aplicaciones web y de consola y un conjunto de componentes PHP reutilizables. Antes de las versiones 5.4.52, 6.4.40, 7.4.12 y 8.0.12, PdoAdapter::doClear() construye una sentencia DELETE utilizando un espacio de nombres derivado del $prefix proporcionado por el llamador sin vincularlo ni escaparlo, permitiendo que un llamador capaz de influir en $prefix se salga del literal LIKE y altere la semántica de la consulta o el alcance de la eliminación. Este problema se ha solucionado en las versiones 5.4.52, 6.4.40, 7.4.12 y 8.0.12.

References

https://github.com/symfony/symfony/security/advisories/GHSA-6qh9-h6wf-jgqcpatch, vendor-advisory, web
https://github.com/symfony/symfony/commit/ec50b799d79ebe24561f29351c1efcb6da95c9b1patch
https://github.com/symfony/symfony/releases/tag/v5.4.52product, release-notes
https://github.com/symfony/symfony/releases/tag/v6.4.40product, release-notes
https://github.com/symfony/symfony/releases/tag/v7.4.12product, release-notes
https://github.com/symfony/symfony/releases/tag/v8.0.12product, release-notes
https://github.com/symfony/symfony/commit/ec50b799d79ebe24561f29351c1efcb6da95c9bweb
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/cache/CVE-2026-45073.yamlweb
https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45073.yamlweb
https://github.com/symfony/symfonypackage
https://symfony.com/cve-2026-45073web

Sources

SourceRecordLicence
CVE ListCVE-2026-45073 changed 2026-07-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-6qh9-h6wf-jgqc changed 2026-09-10CC-BY-4.0
NVDCVE-2026-45073 changed 2026-10-24Public domain