# CVE-2024-21503: black: Versions of the package black before 24.3.0 are vulnerable to Regular Expression Denial of Service (ReDoS) via the li...

CVE-2024-21503 is fixed in 2 products on 1 platform, first by DEBIAN-CVE-2024-21503, released March 19, 2024. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2024-21503
- Priority: Routine
- CVSS: 5.3 (medium)
- EPSS: 0.0098
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Mar 19, 2024

## 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.  Exploiting this vulnerability is possible when running Black on untrusted input, or if you habitually put thousands of leading tab characters in your docstrings.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | black Debian 13.5 (trixie) | 24.4.0-1 | [DEBIAN-CVE-2024-21503](https://patchblox.com/security/data/fix/linux/debian-cve-2024-21503.md) | Mar 19, 2024 |
| Linux | black Debian 14 | 24.4.0-1 | [DEBIAN-CVE-2024-21503](https://patchblox.com/security/data/fix/linux/debian-cve-2024-21503.md) | Mar 19, 2024 |
| Linux | python-black opensuse-leap 15.6 | 24.3.0-150400.9.8.1 | [SUSE-SU-2024:2481-1](https://patchblox.com/security/data/fix/linux/suse-su-2024-2481-1.md) | Jul 15, 2024 |

---

Data as of 2026-11-10T01:44:33Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
