{"id":"UBUNTU-CVE-2024-21503","details":"Versions of the package black before 24.3.0 are vulnerable to Regular Expression Denial of Service (ReDoS) via the lines_with_leading_tabs_expanded function in the strings.py file. An attacker could exploit this vulnerability by crafting a malicious input that causes a denial of service.  Exploiting this vulnerability is possible when running Black on untrusted input, or if you habitually put thousands of leading tab characters in your docstrings.","modified":"2026-05-20T16:16:32.604654748Z","published":"2024-03-19T05:15:00Z","upstream":["CVE-2024-21503"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2024-21503"},{"type":"REPORT","url":"https://security.snyk.io/vuln/SNYK-PYTHON-BLACK-6256273"},{"type":"REPORT","url":"https://github.com/psf/black/releases/tag/24.3.0"},{"type":"REPORT","url":"https://github.com/psf/black/commit/f00093672628d212b8965a8993cee8bedf5fe9b8"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2024-21503"}],"affected":[{"package":{"name":"black","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/black?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["19.3b0-1"],"ecosystem_specific":{"binaries":[{"binary_name":"black","binary_version":"19.3b0-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21503.json"}},{"package":{"name":"black","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/black?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["20.8b1-4","21.4b2-3","21.10b0-1","21.12b0-1"],"ecosystem_specific":{"binaries":[{"binary_name":"black","binary_version":"21.12b0-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21503.json"}},{"package":{"name":"black","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/black?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["23.7.0-1","23.10.1-1","23.11.0-1","24.2.0-1ubuntu1"],"ecosystem_specific":{"binaries":[{"binary_name":"black","binary_version":"24.2.0-1ubuntu1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21503.json"}},{"package":{"name":"black","ecosystem":"Ubuntu:25.10","purl":"pkg:deb/ubuntu/black?arch=source&distro=questing"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["25.1.0-2","25.1.0-3"],"ecosystem_specific":{"binaries":[{"binary_version":"25.1.0-3","binary_name":"black"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21503.json"}},{"package":{"name":"black","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/black?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["25.1.0-3","25.9.0-1","25.11.0-1","25.12.0-1","26.1.0-1","26.1.0-1build1","26.3.1-1"],"ecosystem_specific":{"binaries":[{"binary_name":"black","binary_version":"26.3.1-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2024/UBUNTU-CVE-2024-21503.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},{"type":"Ubuntu","score":"medium"}]}