CVE-2024-21503
published medium CVSS 3.1 · 5.3psf/black: ReDoS via the lines_with_leading_tabs_expanded() function in strings.py file
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| n/a | — | black0 to < 24.3.0 | Affected | Not stated | snyk |
| python_software_foundation | — | black0 to < 24.3.0 · Other versions: unknown | Affected | Not stated | CISA-ADP |
| Alpine Linux | edge | black | Fixed | 24.3.0-r0 | Package fix record |
| SUSE / openSUSE | openSUSE-Leap-15.6 | python311-blacknoarch | Advisory build | 24.3.0-150400.9.8.1 | SUSE-SU-2024:2481-1 |
| Alpine Linux | v3.19 | black | Fixed | 23.12.0-r0 | Package fix record |
| Alpine Linux | v3.20 | black | Fixed | 24.3.0-r0 | Package fix record |
| Alpine Linux | v3.21 | black | Fixed | 24.3.0-r0 | Package fix record |
| Alpine Linux | v3.22 | black | Fixed | 24.3.0-r0 | Package fix record |
Show 26 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Alpine Linux | v3.23 | black | Fixed | 24.3.0-r0 | Package fix record |
| Alpine Linux | v3.24 | black | Fixed | 24.3.0-r0 | Package fix record |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-blackaarch64 | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-blackppc64le | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-blacks390x | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python310-blackx86_64 | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-blackaarch64 | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-blackppc64le | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-blacks390x | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python311-blackx86_64 | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-blackaarch64 | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-blackppc64le | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-blacks390x | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python312-blackx86_64 | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-blackaarch64 | Advisory build | 26.5.1-1.3 | OPENSUSE-SU-2026:12001-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-blackppc64le | Advisory build | 26.5.1-1.3 | OPENSUSE-SU-2026:12001-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-blacks390x | Advisory build | 26.5.1-1.3 | OPENSUSE-SU-2026:12001-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python313-blackx86_64 | Advisory build | 26.5.1-1.3 | OPENSUSE-SU-2026:12001-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-blackaarch64 | Advisory build | 26.5.1-1.3 | OPENSUSE-SU-2026:12001-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-blackppc64le | Advisory build | 26.5.1-1.3 | OPENSUSE-SU-2026:12001-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-blacks390x | Advisory build | 26.5.1-1.3 | OPENSUSE-SU-2026:12001-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python314-blackx86_64 | Advisory build | 26.5.1-1.3 | OPENSUSE-SU-2026:12001-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-blackaarch64 | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-blackppc64le | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-blacks390x | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
| SUSE / openSUSE | openSUSE-Tumbleweed | python39-blackx86_64 | Advisory build | 24.3.0-1.1 | OPENSUSE-SU-2024:13783-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 5.3 / 10
- Severity
- medium
- Provider
- snyk · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| n/a | black | 0 to < 24.3.0 (affected · semver) | snyk · cna |
| python_software_foundation | black | 0 to < 24.3.0 (affected · custom)Default: unknown | CISA-ADP · adp |
Weaknesses
2- CWE-1333 Regular Expression Denial of Service (ReDoS)
- CWE-75 CWE-75 Failure to Sanitize Special Elements into a Different Plane (Special Element Injection)
References
3Provider assertions
3snyk · cna
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 70553f465ff91db9664efe11591c7a8b904d30e6b4aa45d7ea54532724c6b6f0
- Ingested
- 23 Sep 2026, 08:19:02 UTC
- Source record
- Official CVE record