{"id":"CVE-2024-21503","state":"PUBLISHED","title":"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.","description":"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.\r\rExploiting this vulnerability is possible when running Black on untrusted input, or if you habitually put thousands of leading tab characters in your docstrings.","publishedAt":"2024-03-19T05:00:01.474Z","updatedAt":"2024-08-01T22:20:40.916Z","severity":{"score":5.3,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P","source":"snyk"},"assigner":"snyk","products":["n/a black"],"affected":[{"vendor":"n/a","product":"black","versions":[{"version":"0","status":"affected","lessThan":"24.3.0","versionType":"semver"}]}],"references":["https://security.snyk.io/vuln/SNYK-PYTHON-BLACK-6256273","https://github.com/psf/black/releases/tag/24.3.0","https://github.com/psf/black/commit/f00093672628d212b8965a8993cee8bedf5fe9b8"],"weaknesses":["CWE-1333","CWE-75"],"ingestedAt":"2026-10-29T20:06:59.846Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/21xxx/CVE-2024-21503.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-21503","state":"PUBLISHED","datePublished":"2024-03-19T05:00:01.474Z","dateUpdated":"2024-08-01T22:20:40.916Z","assignerShortName":"snyk","assignerOrgId":"bae035ff-b466-4ff4-94d0-fc9efd9e1730","dateReserved":"2023-12-22T12:33:20.119Z"},"containers":{"cna":{"descriptions":[{"lang":"en","value":"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.\r\rExploiting this vulnerability is possible when running Black on untrusted input, or if you habitually put thousands of leading tab characters in your docstrings."}],"affected":[{"vendor":"n/a","product":"black","versions":[{"version":"0","status":"affected","lessThan":"24.3.0","versionType":"semver"}]}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-PYTHON-BLACK-6256273"},{"url":"https://github.com/psf/black/releases/tag/24.3.0"},{"url":"https://github.com/psf/black/commit/f00093672628d212b8965a8993cee8bedf5fe9b8"}],"metrics":[{"cvssV3_1":{"version":"3.1","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"NONE","availabilityImpact":"LOW","baseScore":5.3,"baseSeverity":"MEDIUM","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-1333","description":"Regular Expression Denial of Service (ReDoS)","lang":"en"}]}],"providerMetadata":{"shortName":"snyk","orgId":"bae035ff-b466-4ff4-94d0-fc9efd9e1730","dateUpdated":"2024-03-19T05:00:01.474Z"},"credits":[{"value":"Sajeeb Lohani","lang":"en"}]},"adp":[{"title":"CISA ADP Vulnrichment","affected":[{"vendor":"python_software_foundation","product":"black","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThan":"24.3.0","versionType":"custom"}],"cpes":["cpe:2.3:a:python_software_foundation:black:*:*:*:*:*:*:*:*"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-03-19T13:35:33.402362Z","id":"CVE-2024-21503","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-75","type":"CWE","lang":"en","description":"CWE-75 Failure to Sanitize Special Elements into a Different Plane (Special Element Injection)"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-06-20T21:14:49.619Z"}},{"title":"CVE Program Container","references":[{"url":"https://security.snyk.io/vuln/SNYK-PYTHON-BLACK-6256273","tags":["x_transferred"]},{"url":"https://github.com/psf/black/releases/tag/24.3.0","tags":["x_transferred"]},{"url":"https://github.com/psf/black/commit/f00093672628d212b8965a8993cee8bedf5fe9b8","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-01T22:20:40.916Z"}}]}}}