{"id":"CVE-2026-32274","aliases":["GHSA-3936-cmfr-pm3m","PYSEC-2026-2121"],"url":"https://o3.security/vulnerability/CVE-2026-32274","summary":"Black: Arbitrary file writes from unsanitized user input in cache file name","details":"### Impact\n\nBlack 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. \n\n### Patches\n\nFixed in Black 26.3.1.\n\n### Workarounds\n\nDo not allow untrusted user input into the value of the `--python-cell-magics` option.","published":"2026-03-12T19:47:07.464Z","modified":"2026-10-28T02:30:41.597341815Z","cvss":null,"epss":{"score":0.00621,"percentile":0.48199,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"black","fixedVersion":"26.3.1"}],"fix":{"url":"https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909d","label":"psf/black@4937fe6"},"references":[{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-32274"},{"type":"WEB","url":"https://github.com/psf/black/releases/tag/26.3.1"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32274.json"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:10184"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:13545"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:13553"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/32xxx/CVE-2026-32274.json"},{"type":"ADVISORY","url":"https://github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3m"},{"type":"ADVISORY","url":"https://github.com/pypa/advisory-database/tree/main/vulns/black/PYSEC-2026-2121.yaml"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32274"},{"type":"REPORT","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2447111"},{"type":"FIX","url":"https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909d"},{"type":"FIX","url":"https://github.com/psf/black/commit/ed770ba4dd50c419148a0fca2b43937a7447e1f9"},{"type":"FIX","url":"https://github.com/psf/black/pull/4176"},{"type":"FIX","url":"https://github.com/psf/black/pull/5038"},{"type":"PACKAGE","url":"https://github.com/psf/black"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:41.597341815Z"}}