Arbitrary file writes via unhashed cache key
Published Mar 12, 2026 · Updated Mar 12, 2026
Path traversal in Black 24.3.0 through 26.3.0 allows attackers to write cache files outside the cache directory via --python-cell-magics. Black's Mode.get_cache_key method inserted --python-cell-magics values directly into the cache key, so path separators and parent-directory segments became part of the output path. Exploitation requires control of that option when Black processes a Jupyter notebook, and writes remain limited to locations permitted to the Black process.
Summary
What happened
Path traversal in Black 24.3.0 through 26.3.0 allows attackers to write cache files outside the cache directory via --python-cell-magics. Black's Mode.get_cache_key method inserted --python-cell-magics values directly into the cache key, so path separators and parent-directory segments became part of the output path. Exploitation requires control of that option when Black processes a Jupyter notebook, and writes remain limited to locations permitted to the Black process.
The record
- CVE
- CVE-2026-32274
- Published
- Mar 12, 2026
- Updated
- Mar 12, 2026
- Vendor
- Python Software Foundation
- Product
- Black
- Classifications
- CWE-22, T1565.001
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Mar 12, 2026CVE publishedPublication date reported by the CVE source.
- Mar 12, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=< 26.3.1
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
No public exploit references are available in this record.
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo