CVE-2024-21503 Affecting black package, versions <24.3.0-r0


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

EPSS
0.05% (19th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-ALPINE320-BLACK-7008098
  • published23 May 2024
  • disclosed19 Mar 2024

Introduced: 19 Mar 2024

CVE-2024-21503  (opens in a new tab)

How to fix?

Upgrade Alpine:3.20 black to version 24.3.0-r0 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream black package and not the black package as distributed by Alpine. See How to fix? for Alpine:3.20 relevant fixed versions and status.

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.