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
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| 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.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | black | 26.3.1-1 | — |
| Debian 13 | black | 25.1.0-3+deb13u1 | — |
| Debian 12 | black | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | black | No fix yet | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 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
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | kserve-storage-controller | 0.16.0-r22 | — |
| Wolfi rolling | open-webui | 0.8.10-r1 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| 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
- WID-SEC-2026-3046 IBM Concert: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 10, 2026
- openSUSE-SU-2026:11856-1 ansible-lint-26.9.0-1.1 on GA media SUSE / openSUSE Security Updates · Sep 24, 2026
- SUSE-SU-2026:20928-1 Security update for python-black SUSE / openSUSE Security Updates · Apr 2, 2026
- openSUSE-SU-2026:20417-1 Security update for python-black SUSE / openSUSE Security Updates · Mar 29, 2026
- SUSE-SU-2026:0900-1 Security update for python-black SUSE / openSUSE Security Updates · Mar 23, 2026
- openSUSE-SU-2026:10372-1 python311-black-26.3.1-1.1 on GA media SUSE / openSUSE Security Updates · Mar 15, 2026
References
- https://github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3m
- https://github.com/psf/black/pull/4176
- https://github.com/psf/black/pull/5038
- https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909d
- https://github.com/psf/black/commit/ed770ba4dd50c419148a0fca2b43937a7447e1f9
- https://access.redhat.com/errata/RHSA-2026:10184
- https://access.redhat.com/errata/RHSA-2026:13545
- https://access.redhat.com/errata/RHSA-2026:13553
- https://access.redhat.com/security/cve/CVE-2026-32274
- https://bugzilla.redhat.com/show_bug.cgi?id=2447111
- https://github.com/psf/black/releases/tag/26.3.1
- https://github.com/pypa/advisory-database/tree/main/vulns/black/PYSEC-2026-2121.yaml
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32274.json