All CVEs / python_software_foundation
CVE-2024-21503python_software_foundation black
Medium 5.3 No auth needed
Follow: this CVE · python_software_foundation · python_software_foundation black We alert you by email or Slack (account required).
- Priority
- 47
- CVSS 3.1
- 5.3
- EPSS
- 1.1% probability of exploitation in 30 days · percentile 66
- Auth required
- No
- Published
- Mar 19, 2024
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: yes · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
What happens
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.
What to do
- Apply the vendor's security update for black.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | black |
< 24.3.0 |
24.3.0 |
pip install "black>=24.3.0" |
| PyPI | black |
< 24.3.0 |
24.3.0 |
pip install "black>=24.3.0" |
Per OSV / GitHub Advisories (GHSA-fj7x-q9j7-g6q6, PYSEC-2024-48). Check the version in your lockfile before upgrading.
Affected products
- python_software_foundation · black
As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.
Official advisories
- python313-black-26.5.1-1.3 on GA media · SUSE · openSUSE-SU-2026:12001-1 · Oct 4, 2026 Medium
Vendor, CERT and distribution advisories that name this CVE. Original titles.
Official sources
References
Links published by the sources. Open them with care.