CVE-2026-32274 — Vulnerability in black — CVE Details
Black: Arbitrary file writes from unsanitized user input in cache file name
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.83%). Schedule for your next planned update.
Does your project use an affected black version?
Paste your requirements.txt to check it for CVE-2026-32274 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Impact
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.
Patches
Fixed in Black 26.3.1.
Workarounds
Do not allow untrusted user input into the value of the --python-cell-magics option.
Advisory Timeline
- First published March 12, 2026 (259 days ago).
- Last revised September 10, 2026 — 181 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "black>=26.3.1"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| black PyPI · Affected: 24.10.0, 24.3.0, 24.4.0, 24.4.1 (+9 more) | 26.3.1 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-22Path TraversalMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
References
- https://github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3mWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-32274ADVISORY
- https://github.com/psf/black/pull/4176WEB
- https://github.com/psf/black/pull/5038WEB
- https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909dWEB
- https://github.com/psf/black/commit/ed770ba4dd50c419148a0fca2b43937a7447e1f9WEB
- https://access.redhat.com/errata/RHSA-2026:10184WEB
- https://access.redhat.com/errata/RHSA-2026:13545WEB
- https://access.redhat.com/errata/RHSA-2026:13553WEB
- https://access.redhat.com/security/cve/CVE-2026-32274WEB
- https://bugzilla.redhat.com/show_bug.cgi?id=2447111WEB
- https://github.com/psf/blackPACKAGE
- https://github.com/psf/black/releases/tag/26.3.1WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/black/PYSEC-2026-2121.yamlWEB
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32274.jsonWEB
Frequently Asked Questions
- What is CVE-2026-32274?
- Black: Arbitrary file writes from unsanitized user input in cache file name. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2026-32274?
- CVE-2026-32274 affects black. It has a 0.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-32274 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 54.8% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-31900CRITICAL
- CVE-2026-114134HIGH
Black: GitHub Action installs unvalidated required-version from pyproject.toml
- CVE-2026-128139HIGH
NLTK: XMLCorpusView comment and CDATA parsing permits quadratic CPU denial of service
- CVE-2026-129222HIGH
Natural Language Toolkit (NLTK): Uncontrolled recursion (crash DoS) in DependencyGraph.tree()/triples()