Skip to content
OpenAdvisories
High · 8.7 CVE-2026-32274 EUVD-2026-11698GHSA-3936-cmfr-pm3mPYSEC-2026-2121

Black: Arbitrary file writes from unsanitized user input in cache file name

Published Mar 12, 2026 · Updated Aug 3, 2026 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
psf black >= 24.3.0, < 26.3.1 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 black 26.3.1-1 —
Debian 13 black 25.1.0-3+deb13u1 —
Debian 12 black No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 black No fix yet —
Ubuntu 26.04 LTS black No fix yet —
Ubuntu 25.10 black No fix yet —
Ubuntu 24.04 LTS black No fix yet —
Ubuntu 22.04 LTS black No fix yet —
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS black No fix yet —
ReleasePackageFixed inAdvisory
SLES for SAP 16.0 python-black 25.1.0-160000.3.1 SUSE-SU-2026:20928-1
SLES 16.0 python-black 25.1.0-160000.3.1 SUSE-SU-2026:20928-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed ansible-lint 26.9.0-1.1 openSUSE-SU-2026:11856-1
openSUSE Tumbleweed python-black 26.3.1-1.1 openSUSE-SU-2026:10372-1
openSUSE Leap 16.0 python-black 25.1.0-160000.3.1 openSUSE-SU-2026:20417-1
openSUSE Leap 15.6 python-black 24.3.0-150400.9.11.1 SUSE-SU-2026:0900-1

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling kserve-storage-controller 0.16.0-r22 —
Wolfi rolling open-webui 0.8.10-r1 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI black >= 24.3.0, < 26.3.1 26.3.1 GHSA-3936-cmfr-pm3m
PyPI black < 26.3.1 26.3.1 PYSEC-2026-2121

Advisories 6

References