Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1majd4LXE5ajctZzZxNs4AA6He

Black vulnerable to Regular Expression Denial of Service (ReDoS)

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.

Permalink: https://github.com/advisories/GHSA-fj7x-q9j7-g6q6
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1majd4LXE5ajctZzZxNs4AA6He
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 1 month ago
Updated: about 1 month ago


CVSS Score: 5.3
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Identifiers: GHSA-fj7x-q9j7-g6q6, CVE-2024-21503
References: Repository: https://github.com/psf/black
Blast Radius: 26.6

Affected Packages

pypi:black
Dependent packages: 6,708
Dependent repositories: 105,588
Downloads: 34,706,944 last month
Affected Version Ranges: >= 0, < 24.3.0
Fixed in: 24.3.0
All affected versions: 22.1.0, 22.3.0, 22.6.0, 22.8.0, 22.10.0, 22.12.0, 23.1.0, 23.3.0, 23.7.0, 23.9.0, 23.9.1, 23.10.0, 23.10.1, 23.11.0, 23.12.0, 23.12.1, 24.1.0, 24.1.1, 24.2.0
All unaffected versions: 24.3.0, 24.4.0