Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.6%top 55%

CVE-2026-32274: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in psf black

0
High
VulnerabilityCVE-2026-32274cvecve-2026-32274cwe-22
Published: 03/12/2026 (03/12/2026, 19:47:07 UTC)
Source: CVE Database V5
Vendor/Project: psf
Product: black

Description

Black is the uncompromising Python code formatter. Prior to 26.3.1, Black writes a cache file, the name of which is computed from various formatting options. The value of the --python-cell-magics option was placed in the filename without sanitization, which allowed an attacker who controls the value of this argument to write cache files to arbitrary file system locations. Fixed in Black 26.3.1.

CVSS v4.0

Score 8.7high

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
High
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Affected software

black
pkg:pypi/black
Affected versions
<26.3.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/15/2026, 08:55:31 UTC

Technical Analysis

Black, a Python code formatter, prior to version 26.3.1, improperly handled the --python-cell-magics option by incorporating its value directly into cache file names without sanitization. This allowed an attacker who can control this option to perform path traversal and write cache files to arbitrary locations on the filesystem. The vulnerability is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). The issue is fixed in Black 26.3.1. The CVSS 4.0 base score is 8.7, indicating high severity, with network attack vector, low attack complexity, no privileges or user interaction required, and high impact on integrity.

Potential Impact

An attacker able to control the --python-cell-magics option can write cache files to arbitrary filesystem locations, potentially overwriting or creating files outside the intended cache directory. This could lead to unauthorized file modification or code execution depending on the environment and usage context. The vulnerability affects system integrity but does not require privileges or user interaction to exploit.

Mitigation Recommendations

Upgrade Black to version 26.3.1 or later, where this vulnerability is fixed. There are no vendor advisories indicating alternative mitigations or that no action is required. Patch status is confirmed fixed in 26.3.1.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-03-11T15:05:48.400Z
Cvss Version
4.0
State
PUBLISHED
Vendor Advisory Urls
[{"url":"https://access.redhat.com/security/cve/CVE-2026-32274","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:13553","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:13545","vendor":"Red Hat"},{"url":"https://access.redhat.com/errata/RHSA-2026:10184","vendor":"Red Hat"}]

Threat ID: 69b31b3a2f860ef943e8fcb0

Added to database: 03/12/2026, 19:59:54 UTC

Last enriched: 07/15/2026, 08:55:31 UTC

Last updated: 07/31/2026, 19:22:58 UTC

Views: 439

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses