{"id":"CVE-2021-43608","aliases":["CVE-2021-43608","GHSA-r7cj-8hjg-x622"],"related":[],"kind":"vulnerability","state":"published","title":"DBAL 3 SQL Injection Security Vulnerability","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.\n\nWe advise everyone using Doctrine DBAL 3.0.0 up to 3.1.3 to upgrade to 3.1.4 immediately.\n\nThe vulnerability can happen when unsanitized input is passed to many APIs in Doctrine DBAL and ORM that ultimately end up calling `AbstractPlatform::modifyLimitQuery`. \n\nAs a workaround you can cast all limit and offset parameters to integers before passing them to Doctrine APIs.\n\nThis vulnerability has been assigned [CVE-2021-43608](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43608).","format":"markdown","source":"ghsa"},{"lang":"es","text":"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","source":"nvd"}],"published":"2021-11-16T17:25:57.000Z","modified":"2026-07-08T06:28:09.549Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0","status":"affected","fixed":"3.1.4"}],"ecosystem":"Packagist","package":"doctrine/dbal","purl":"pkg:composer/doctrine/dbal","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.0.0","fixed":"3.1.4"}],"vendor":"doctrine-project","product":"database_abstraction_layer","cpe":"cpe:2.3:a:doctrine-project:database_abstraction_layer:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/doctrine/dbal/commit/9dcfa4cb6c03250b78a84737ba7ceb82f4b7ba4d","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.doctrine-project.org/2021/11/11/dbal3-vulnerability-fixed.html","tags":["vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/doctrine/dbal/releases","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/doctrine/dbal/security/advisories/GHSA-r7cj-8hjg-x622","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-43608","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/doctrine/dbal/CVE-2021-43608.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/doctrine/dbal","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-43608","url":"https://www.cve.org/CVERecord?id=CVE-2021-43608","licence":"CVE Terms of Use","modified":"2024-08-04T04:03:08.429Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-r7cj-8hjg-x622","url":"https://github.com/advisories/GHSA-r7cj-8hjg-x622","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:09.549Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-43608","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-43608","licence":"Public domain","modified":"2026-06-17T04:11:11.217Z"}],"updatedAt":"2026-11-25T22:24:36.198Z","epss":{"score":0.02447,"percentile":0.84802,"date":"2026-12-01T12:00:22.000Z"}}