Vulnerability · Published Mar 12, 2026 · Assigned by GitHub_M

CVE-2026-32274Black: Arbitrary file writes from unsanitized user input in cache file name

High 7.5

In plain English

A high-severity path traversal in black from psf. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 51% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)0.6%top 48.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12blackno fix listedDEBIAN-CVE-2026-32274
Debian:13black25.1.0-3+deb13u1DEBIAN-CVE-2026-32274
Debian:14black26.3.1-1DEBIAN-CVE-2026-32274
PyPIblack26.3.1GHSA-3936-cmfr-pm3m
PyPIblack26.3.1PYSEC-2026-2121
Ubuntu:22.04:LTSblackno fix listedUBUNTU-CVE-2026-32274
Ubuntu:24.04:LTSblackno fix listedUBUNTU-CVE-2026-32274
Ubuntu:25.10blackno fix listedUBUNTU-CVE-2026-32274
Ubuntu:26.04:LTSblackno fix listedUBUNTU-CVE-2026-32274
Ubuntu:26.10blackno fix listedUBUNTU-CVE-2026-32274

Affected products (as reported)

VendorProductVersions
psf black >= 24.3.0, < 26.3.1

Weakness: CWE-22 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

References