CVE-2024-21503 Affecting black package, versions <24.4.0-1


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

EPSS
0.98% (64th 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-ECHOLATEST-BLACK-22283262
  • published8 Nov 2026
  • disclosed19 Mar 2024

Introduced: 19 Mar 2024

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

How to fix?

Upgrade Echo:latest black to version 24.4.0-1 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 Echo. See How to fix? for Echo:latest 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.