Bug 2270236 (CVE-2024-21503) - CVE-2024-21503 psf/black: ReDoS via the lines_with_leading_tabs_expanded() function in strings.py file
Summary: CVE-2024-21503 psf/black: ReDoS via the lines_with_leading_tabs_expanded() fu...
Keywords:
Status: NEW
Alias: CVE-2024-21503
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 2270238
Blocks: 2270240
TreeView+ depends on / blocked
 
Reported: 2024-03-19 07:37 UTC by TEJ RATHI
Modified: 2025-04-01 08:28 UTC (History)
12 users (show)

Fixed In Version: black 24.3.0
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2024:3781 0 None None None 2024-06-10 18:37:36 UTC

Description TEJ RATHI 2024-03-19 07:37:20 UTC
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.

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

Comment 1 TEJ RATHI 2024-03-19 07:39:08 UTC
Created python-black tracking bugs for this issue:

Affects: fedora-all [bug 2270238]

Comment 3 errata-xmlrpc 2024-06-10 18:37:34 UTC
This issue has been addressed in the following products:

  Red Hat Ansible Automation Platform 2.4 for RHEL 9
  Red Hat Ansible Automation Platform 2.4 for RHEL 8

Via RHSA-2024:3781 https://access.redhat.com/errata/RHSA-2024:3781


Note You need to log in before you can comment on or make changes to this bug.