High severityNVD Advisory· Published Mar 12, 2026· Updated Mar 13, 2026
Black: Arbitrary file writes from unsanitized user input in cache file name
CVE-2026-32274
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
blackPyPI | < 26.3.1 | 26.3.1 |
Affected products
13- osv-coords12 versionspkg:apk/chainguard/kserve-storage-controllerpkg:apk/chainguard/label-studiopkg:apk/chainguard/nemopkg:apk/chainguard/open-webuipkg:apk/wolfi/kserve-storage-controllerpkg:apk/wolfi/open-webuipkg:pypi/blackpkg:rpm/opensuse/python-black&distro=openSUSE%20Leap%2015.6pkg:rpm/opensuse/python-black&distro=openSUSE%20Leap%2016.0pkg:rpm/opensuse/python-black&distro=openSUSE%20Tumbleweedpkg:rpm/suse/python-black&distro=SUSE%20Linux%20Enterprise%20Server%2016.0pkg:rpm/suse/python-black&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20applications%2016.0
< 0.16.0-r22+ 11 more
- (no CPE)range: < 0.16.0-r22
- (no CPE)range: < 1.23.0-r0
- (no CPE)range: < 2.7.0-r2
- (no CPE)range: < 0.8.10-r1
- (no CPE)range: < 0.16.0-r22
- (no CPE)range: < 0.8.10-r1
- (no CPE)range: < 26.3.1
- (no CPE)range: < 24.3.0-150400.9.11.1
- (no CPE)range: < 25.1.0-160000.3.1
- (no CPE)range: < 26.3.1-1.1
- (no CPE)range: < 25.1.0-160000.3.1
- (no CPE)range: < 25.1.0-160000.3.1
Patches
Vulnerability mechanics
References
6- github.com/advisories/GHSA-3936-cmfr-pm3mghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-32274ghsaADVISORY
- github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909dghsax_refsource_MISCWEB
- github.com/psf/black/pull/5038ghsax_refsource_MISCWEB
- github.com/psf/black/releases/tag/26.3.1ghsax_refsource_MISCWEB
- github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3mghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.