CVEfocus › CVE database › CVE-2026-32274

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

CVSS 8.7 HighEPSS 0.8% (higher than 55% of CVEs)Published 2026-03-12Updated 2026-08-03Assigner: GitHub_M

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.

CWE-22

What to do

Fixed builds are available from Debian, PyPI: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

3Fixed
3Fix pending
3Under investigation
1Will not fix

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10blackFix pendingUBUNTU-CVE-2026-32274
Ubuntu 26.04blackUnder investigationUBUNTU-CVE-2026-32274
Ubuntu 25.10blackWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2026-32274
Ubuntu 24.04blackUnder investigationUBUNTU-CVE-2026-32274
Ubuntu 22.04blackUnder investigationUBUNTU-CVE-2026-32274
Ubuntu 20.04blackFix pendingUBUNTU-CVE-2026-32274
Debian 14blackFixed26.3.1-1DEBIAN-CVE-2026-32274
Debian 13blackFixed25.1.0-3+deb13u1DEBIAN-CVE-2026-32274
Debian 12blackFix pendingDEBIAN-CVE-2026-32274
PyPI libraryblackFixed26.3.1PYSEC-2026-2121

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.