black

CVE-2024-21503
MEDIUM 5.3

At a glance

Source
NVD
EPSS
EPSS 0.98 % · percentile 62 ()
State
PUBLISHED
Published
Updated
Assigner
snyk
NVD status
Deferred

Description

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.

Weaknesses (CWE)

  • CWE-1333 — Inefficient Regular Expression Complexity
  • CWE-75 — Failure to Sanitize Special Elements into a Different Plane

References

Scores

VersionScoreVectorScored by
CVSS 3.1MEDIUM 5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:Psnyk
CVSS 3.1MEDIUM 5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LNVD · report@snyk.io (Secondary)

Advisories

European references

CERT-FR advisories

Affected products

ProductVersions
blackaffected 0 < 24.3.0

Sources

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
CERT-FR (ANSSI)Licence Ouverte / Etalab 2.0
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD