Arbitrary File Write via Unescaped --python-cell-magics in Black <26.3.1
CVE-2026-32274 Published on March 12, 2026

Black: Arbitrary file writes from unsanitized user input in cache file name
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.

Github Repository NVD

Vulnerability Analysis

CVE-2026-32274 is exploitable with network access, and does not require authorization privileges or user interaction. This vulnerability is considered to have a low attack complexity. The potential impact of an exploit of this vulnerability is considered to have no impact on confidentiality, a high impact on integrity, and no impact on availability.

Attack Vector:
NETWORK
Attack Complexity:
LOW
Privileges Required:
NONE
User Interaction:
NONE
Scope:
UNCHANGED
Confidentiality Impact:
NONE
Integrity Impact:
HIGH
Availability Impact:
NONE

Weakness Type

What is a Directory traversal Vulnerability?

The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

CVE-2026-32274 has been classified to as a Directory traversal vulnerability or weakness.


Products Associated with CVE-2026-32274

Want to know whenever a new CVE is published for Red Hat products? stack.watch will email you.

 
 
 
 
 

Affected Versions

psf black: Red Hat Ansible Automation Platform 2.5: Red Hat Ansible Automation Platform 2.6: Red Hat OpenShift AI 2.25: Red Hat OpenShift Lightspeed: Red Hat Ansible Automation Platform Ansible Core 2: Red Hat OpenShift AI (RHOAI): Red Hat OpenShift Virtualization 4: Red Hat Ansible Automation Platform 2:

Vulnerable Packages

The following package name and versions may be associated with CVE-2026-32274

Package Manager Vulnerable Package Versions Fixed In
pip black < 26.3.1 26.3.1

Exploit Probability

EPSS
0.42%
Percentile
33.77%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.