9.8critical
DBAL 3 SQL Injection Security Vulnerability
- Severity
- 9.8critical CVSS:3.1 by NVD
- Exploit likelihood
- 2.45% (higher than 84% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-r7cj-8hjg-x622
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| doctrine/dbal (Packagist) | from 3.0.0 before 3.1.4 | GitHub Advisory Database |
| doctrine-project database_abstraction_layer | from 3.0.0 before 3.1.4 | NVD |
All scores
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 7.5high CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
We have released a new version Doctrine DBAL 3.1.4 that fixes a critical SQL injection vulnerability in the LIMIT clause generation API provided by the Platform abstraction.
We advise everyone using Doctrine DBAL 3.0.0 up to 3.1.3 to upgrade to 3.1.4 immediately.
The vulnerability can happen when unsanitized input is passed to many APIs in Doctrine DBAL and ORM that ultimately end up calling AbstractPlatform::modifyLimitQuery.
As a workaround you can cast all limit and offset parameters to integers before passing them to Doctrine APIs.
This vulnerability has been assigned CVE-2021-43608.
NVD (es)
Doctrine DBAL versiones 3.x anteriores a 3.1.4, permite una inyección de SQL. Es probable que el escape de las entradas de desplazamiento y longitud para la generación de una cláusula LIMIT no sea convertida en un número entero, permitiendo que se produzca una inyección SQL si los desarrolladores de aplicaciones pasan entradas de usuario sin escape al DBAL QueryBuilder o a cualquier otra API que use en última instancia la API AbstractPlatform::modifyLimitQuery
References
| https://github.com/doctrine/dbal/commit/9dcfa4cb6c03250b78a84737ba7ceb82f4b7ba4d | patch, third-party-advisory, web | |
| https://www.doctrine-project.org/2021/11/11/dbal3-vulnerability-fixed.html | vendor-advisory, web | |
| https://github.com/doctrine/dbal/releases | release-notes, third-party-advisory, web | |
| https://github.com/doctrine/dbal/security/advisories/GHSA-r7cj-8hjg-x622 | third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-43608 | advisory | |
| https://github.com/FriendsOfPHP/security-advisories/blob/master/doctrine/dbal/CVE-2021-43608.yaml | web | |
| https://github.com/doctrine/dbal | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-43608 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-r7cj-8hjg-x622 changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-43608 changed 2026-06-17 | Public domain |