CVE-2026-32274: 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.
Security readout for executives and security teams
Plain-English summary
Black, a Python code formatter, could write cache files outside its intended location before version 26.3.1. The issue depends on attacker control of a formatting option value. Business risk is highest in automated tooling or CI environments that run Black with inputs influenced by untrusted users.
Executive priority
Treat as a high-priority developer tooling update, not an internet-facing emergency. Prioritize CI systems and shared build environments where untrusted code or configuration may be processed.
Technical view
CVE-2026-32274 is a CWE-22 path traversal-style flaw in Black before 26.3.1. The --python-cell-magics option was incorporated into a cache filename without sanitization, allowing cache writes to arbitrary filesystem locations where the Black process has permission.
Likely exposure
Exposure is most likely in Python development, CI, editor, or pre-commit workflows using Black versions before 26.3.1, especially where untrusted users can affect formatter arguments or configuration.
Exploitation context
The source bundle does not identify KEV listing or active exploitation. Exploitation requires control over the affected option value and depends on the filesystem permissions of the Black process.
Researcher notes
The fix is identified in Black 26.3.1, with related GitHub advisory, pull request, commit, and release references. Evidence provided does not establish remote service compromise or in-the-wild exploitation.
Mitigation direction
Upgrade Black to version 26.3.1 or later.
Use vendor-supported fixed packages where Black is supplied by a distribution.
Review CI and formatter workflows for untrusted control of Black options.
Restrict who can modify formatter configuration and pipeline inputs.
Run formatting jobs with least necessary filesystem write permissions.
Validation and detection
Inventory Black versions in lockfiles, virtual environments, containers, and CI images.
Confirm installed Black versions are 26.3.1 or later.
Check CI, editor, and pre-commit configuration for --python-cell-magics usage.
Verify untrusted contributors cannot change formatter arguments without review.
Review vendor advisories for applicable Red Hat package status.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-22: File access and web shell behavior lookup
File traversal and upload weaknesses can lead teams to review file, web shell, execution, and collection telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references file access or upload behavior, so file telemetry and web shell review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.