GHSA-6qh9-h6wf-jgqc
Fix: symfony/symfony@ec50b79GHSA-6qh9-h6wf-jgqc is a SQL Injection vulnerability in symfony/cache. O3 Security confirms whether GHSA-6qh9-h6wf-jgqc is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Symfony Vulnerable to SQL Injection in PdoAdapter::doClear() via Unsanitized $prefix
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-6qh9-h6wf-jgqc.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
symfony/cache🐘symfony/cache🐘symfony/cache🐘symfony/cache🐘symfony/symfony🐘symfony/symfony🐘symfony/symfony🐘symfony/symfonyReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | symfony/cache | all versions | 5.4.52 |
| 🐘Packagist | symfony/cache | ≥ 6.0.0&&< 6.4.40 | 6.4.40 |
| 🐘Packagist | symfony/cache | ≥ 7.0.0&&< 7.4.12 | 7.4.12 |
| 🐘Packagist | symfony/cache | ≥ 8.0.0&&< 8.0.12 | 8.0.12 |
| 🐘Packagist | symfony/symfony | all versions | 5.4.52 |
| 🐘Packagist | symfony/symfony | ≥ 6.0.0&&< 6.4.40 | 6.4.40 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for symfony/cache. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update symfony/cache to 5.4.52 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-6qh9-h6wf-jgqc is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-6qh9-h6wf-jgqc is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-6qh9-h6wf-jgqc. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-6qh9-h6wf-jgqc in your dependencies?
O3 detects GHSA-6qh9-h6wf-jgqc across Packagist dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.