ubuntu-cve-2024-21503
Vulnerability from osv_ubuntu
Published
2024-03-19 05:15
Modified
2026-05-20 15:07
Summary
Details
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.
Severity
5.3 (Medium)
N/A (UNKNOWN)
References
{
"affected": [
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "19.3b0-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:20.04:LTS",
"name": "black",
"purl": "pkg:deb/ubuntu/black@19.3b0-1?arch=source\u0026distro=focal"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"19.3b0-1"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "21.12b0-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:22.04:LTS",
"name": "black",
"purl": "pkg:deb/ubuntu/black@21.12b0-1?arch=source\u0026distro=jammy"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"20.8b1-4",
"21.4b2-3",
"21.10b0-1",
"21.12b0-1"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "24.2.0-1ubuntu1"
}
]
},
"package": {
"ecosystem": "Ubuntu:24.04:LTS",
"name": "black",
"purl": "pkg:deb/ubuntu/black@24.2.0-1ubuntu1?arch=source\u0026distro=noble"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"23.7.0-1",
"23.10.1-1",
"23.11.0-1",
"24.2.0-1ubuntu1"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "25.1.0-3"
}
]
},
"package": {
"ecosystem": "Ubuntu:25.10",
"name": "black",
"purl": "pkg:deb/ubuntu/black@25.1.0-3?arch=source\u0026distro=questing"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"25.1.0-2",
"25.1.0-3"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "black",
"binary_version": "26.3.1-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:26.04:LTS",
"name": "black",
"purl": "pkg:deb/ubuntu/black@26.3.1-1?arch=source\u0026distro=resolute"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"25.1.0-3",
"25.9.0-1",
"25.11.0-1",
"25.12.0-1",
"26.1.0-1",
"26.1.0-1build1",
"26.3.1-1"
]
}
],
"aliases": [],
"details": "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.",
"id": "UBUNTU-CVE-2024-21503",
"modified": "2026-05-20T15:07:33Z",
"published": "2024-03-19T05:15:00Z",
"references": [
{
"type": "REPORT",
"url": "https://ubuntu.com/security/CVE-2024-21503"
},
{
"type": "REPORT",
"url": "https://security.snyk.io/vuln/SNYK-PYTHON-BLACK-6256273"
},
{
"type": "REPORT",
"url": "https://github.com/psf/black/releases/tag/24.3.0"
},
{
"type": "REPORT",
"url": "https://github.com/psf/black/commit/f00093672628d212b8965a8993cee8bedf5fe9b8"
},
{
"type": "REPORT",
"url": "https://www.cve.org/CVERecord?id=CVE-2024-21503"
}
],
"related": [],
"schema_version": "1.7.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
},
{
"score": "medium",
"type": "Ubuntu"
}
],
"upstream": [
"CVE-2024-21503"
]
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…