CVE-2024-21503
psf/black: ReDoS via the lines_with_leading_tabs_expanded() function in strings.py file
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
0Exploited in Wild
-Decision
Descriptions
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.
Las versiones del paquete black anteriores a la 24.3.0 son vulnerables a la denegación de servicio de expresión regular (ReDoS) a través de la funciónlines_with_leading_tabs_expanded en el archivo strings.py. Un atacante podría aprovechar esta vulnerabilidad creando una entrada maliciosa que provoque una denegación de servicio. Es posible explotar esta vulnerabilidad cuando se ejecuta Black en entradas que no son de confianza o si habitualmente coloca miles de caracteres de tabulación iniciales en sus cadenas de documentación.
The python-black package is susceptible to a regular expression denial of service (ReDoS) vulnerability, found in the lines_with_leading_tabs_expanded() function within the strings.py file. This vulnerability could be exploited by running Black on untrusted input or by inserting numerous leading tab characters into docstrings. This flaw allows attackers to craft malicious input to trigger a denial of service.
CVSS Scores
SSVC
- Decision:Attend
Timeline
- 2023-12-22 CVE Reserved
- 2024-03-19 CVE Published
- 2024-03-19 EPSS Updated
- 2024-08-01 CVE Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
- ---------- First Exploit
CWE
- CWE-75: Failure to Sanitize Special Elements into a Different Plane (Special Element Injection)
- CWE-1333: Inefficient Regular Expression Complexity
CAPEC
References (5)
URL | Tag | Source |
---|---|---|
https://github.com/psf/black/commit/f00093672628d212b8965a8993cee8bedf5fe9b8 | ||
https://github.com/psf/black/releases/tag/24.3.0 | ||
https://security.snyk.io/vuln/SNYK-PYTHON-BLACK-6256273 |
URL | Date | SRC |
---|
URL | Date | SRC |
---|
URL | Date | SRC |
---|---|---|
https://access.redhat.com/security/cve/CVE-2024-21503 | 2024-06-10 | |
https://bugzilla.redhat.com/show_bug.cgi?id=2270236 | 2024-06-10 |
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Python Software Foundation Search vendor "Python Software Foundation" | Black Search vendor "Python Software Foundation" for product "Black" | * | - |
Affected
| ||||||
Redhat Search vendor "Redhat" | Ansible Automation Platform Search vendor "Redhat" for product "Ansible Automation Platform" | * | - |
Affected
| ||||||
Redhat Search vendor "Redhat" | Ansible Automation Platform Developer Search vendor "Redhat" for product "Ansible Automation Platform Developer" | * | - |
Affected
| ||||||
Redhat Search vendor "Redhat" | Ansible Automation Platform Inside Search vendor "Redhat" for product "Ansible Automation Platform Inside" | * | - |
Affected
| ||||||
Opensuse Search vendor "Opensuse" | Leap Search vendor "Opensuse" for product "Leap" | * | - |
Affected
| ||||||
Redhat Search vendor "Redhat" | Enterprise Linux Search vendor "Redhat" for product "Enterprise Linux" | * | - |
Affected
|