CVE-2026-32274
HIGH 8.7CVSS 4.0Black: Arbitrary file writes from unsanitized user input in cache file name
Black is the uncompromising Python code formatter. Starting in version 24.3.0 and prior to version 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.
- Published
- 12 Mar 2026
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-22
- Also known as
- GHSA-3936-cmfr-pm3mPYSEC-2026-2121
- Sources
- NVDJSONOSV GHSA-3936-cmfr-pm3mJSONOSV PYSEC-2026-2121JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | HIGH 8.7 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | 0b0ca135-0b70-47e7-9f44-1890c2a1c46c (Secondary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| OSV | PyPA | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | python | blackcpe:2.3:a:python:black:*:*:*:*:*:python:*:* |
< 26.3.1 | 26.3.1 |
| OSV | PyPI | black | >= 24.3.0, < 26.3.1 | 26.3.1 |
| OSV | PyPI | black | < 26.3.1 | 26.3.1 |
References
- https://access.redhat.com/errata/RHSA-2026:10184 · WEB, ADVISORY
- https://access.redhat.com/errata/RHSA-2026:13545 · WEB, ADVISORY
- https://access.redhat.com/errata/RHSA-2026:13553 · WEB, ADVISORY
- https://access.redhat.com/security/cve/CVE-2026-32274 · WEB
- https://bugzilla.redhat.com/show_bug.cgi?id=2447111 · WEB, REPORT
- https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909d · Patch, WEB, FIX
- https://github.com/psf/black/commit/ed770ba4dd50c419148a0fca2b43937a7447e1f9 · WEB
- https://github.com/psf/black/pull/4176 · WEB
- https://github.com/psf/black/pull/5038 · Issue Tracking, Patch, WEB, FIX
- https://github.com/psf/black/releases/tag/26.3.1 · Release Notes, WEB, ADVISORY
- https://github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3m · Vendor Advisory, WEB, ADVISORY
- https://github.com/pypa/advisory-database/tree/main/vulns/black/PYSEC-2026-2121.yaml · WEB
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32274.json · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-32274 · ADVISORY
- https://github.com/psf/black · PACKAGE
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 12 Mar 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 12 Mar 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 12 Mar 2026)