{"id":"CVE-2026-32274","published":"2026-03-12T19:47:07Z","modified":"2026-08-03T20:36:42Z","title":"Black: Arbitrary file writes from unsanitized user input in cache file name","vendor":"psf","product":"black","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.7,"severity":"HIGH","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00691,"percentile":0.53741,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3m","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/psf/black/pull/4176","tags":["x_refsource_MISC"]},{"url":"https://github.com/psf/black/pull/5038","tags":["x_refsource_MISC"]},{"url":"https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909d","tags":["x_refsource_MISC"]},{"url":"https://github.com/psf/black/commit/ed770ba4dd50c419148a0fca2b43937a7447e1f9","tags":["x_refsource_MISC"]},{"url":"https://access.redhat.com/errata/RHSA-2026:10184","tags":["x_refsource_MISC"]},{"url":"https://access.redhat.com/errata/RHSA-2026:13545","tags":["x_refsource_MISC"]},{"url":"https://access.redhat.com/errata/RHSA-2026:13553","tags":["x_refsource_MISC"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-32274","tags":["x_refsource_MISC"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2447111","tags":["x_refsource_MISC"]},{"url":"https://github.com/psf/black/releases/tag/26.3.1","tags":["x_refsource_MISC"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/black/PYSEC-2026-2121.yaml","tags":["x_refsource_MISC"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32274.json","tags":["x_refsource_MISC"]}],"priority":{"score":16.8,"factors":[{"name":"EPSS percentile","points":10.75},{"name":"CVSS severity","points":6.09}]},"vendorSlug":"psf","affectedVersions":[{"vendor":"psf","product":"black","versions":[">= 24.3.0, < 26.3.1"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-03-13T16:10:43.937677Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"black","vulnerableRanges":[">=24.3.0, <26.3.1","<26.3.1"],"patched":["26.3.1"],"from":["GHSA-3936-cmfr-pm3m","PYSEC-2026-2121"],"provenance":"source"}],"summary":{"text":"Black, the Python code formatter, contains a path traversal flaw in its cache file naming: the value of the --python-cell-magics option is inserted unsanitized into the cache file name. An attacker who can control that option's value can cause Black to write cache files to arbitrary locations on the file system, with no authentication or user interaction required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:03:30Z"},"euvd":{"id":"EUVD-2026-11698","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-21503","published":"2024-03-19","fixed":"24.3.0","kev":false},{"cve":"CVE-2026-31900","published":"2026-03-11","fixed":"26.3.0","kev":false,"link":{"from":"CVE-2026-31900","to":"CVE-2026-32274","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:black","fromFixed":"26.3.0","toFixed":"26.3.1","daysApart":1},{"kind":"similar","provenance":"machine","score":0.39,"basis":"same product + description similarity"}]}},{"cve":"CVE-2026-32274","published":"2026-03-12","fixed":"26.3.1","kev":false},{"cve":"CVE-2026-114134","published":"2026-11-05","fixed":"26.10.1","kev":false,"link":{"from":"CVE-2026-32274","to":"CVE-2026-114134","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:black","fromFixed":"26.3.1","toFixed":"26.10.1","daysApart":238}]}}],"package":"PyPI:black"}}