Versions of the package black before 24.3.0 are vulnerable to Regular Expression Denial of Service (ReDoS) via the
Affects blackSource GCVE Database
Not known to be exploited · CVSS 5.3 Medium · fixed in 24.3.0 : update black when convenient.
Data as of 9 Nov 2026, 14:35 UTC
- Patch
- Available – fixed in 24.3.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LExploitation evidence
Disclosed: evidence found.
CVE published 19 Mar 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 9 Nov 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Ubuntu 26.10blackpkg:deb/ubuntu/black?arch=source&distro=stonkingOther threats | Affected
| Fixed in– |
Ubuntu 25.10blackpkg:deb/ubuntu/black?arch=source&distro=questingOther threats | Affected
| Fixed in– |
Ubuntu 24.04 LTSblackpkg:deb/ubuntu/black?arch=source&distro=nobleOther threats | Affected
| Fixed in– |
Ubuntu 22.04 LTSblackpkg:deb/ubuntu/black?arch=source&distro=jammyOther threats | Affected
| Fixed in– |
Ubuntu 20.04 LTSblackpkg:deb/ubuntu/black?arch=source&distro=focalOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade Black to version 24.3.0 or later, where this vulnerability is fixed. Avoid running Black on untrusted input or input containing thousands of leading tab characters until patched.
Description
Versions of the Python code formatter Black prior to 24.3.0 contain a Regular Expression Denial of Service (ReDoS) vulnerability in the lines_with_leading_tabs_expanded function within strings.py. This flaw allows an attacker to cause a denial of service by providing malicious input with many leading tab characters. The vulnerability is exploitable when Black processes untrusted input or docstrings with thousands of leading tabs. The issue has a medium severity rating with a CVSS score of 5.3. A fix is available in version 24.3.0.
References
- ubuntu.com/security/CVE-2024-21503 (opens in a new tab)
- security.snyk.io/vuln/SNYK-PYTHON-BLACK-6256273 (opens in a new tab)
- github.com/psf/black/releases/tag/24.3.0 (opens in a new tab)
- github.com/psf/black/commit/f00093672628d212b8965a8993cee8bedf5fe9b8 (opens in a new tab)
- cve.org/CVERecord?id=CVE-2024-21503 (opens in a new tab)