Every CVE Search/ Get API key

CVE-2026-32274

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

8.7 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
High
Availability
None

Exploit likelihood

0.69%Up 0.7 points since Mar 13, 2026
90%50%10%1%

What each source reports

CVE List Score used 8.7

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

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.

Record
CVE-2026-32274
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weakness
CWE-22, CWE-22
Updated
2026-11-02
EUVDEUVD-2026-11698 8.7

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.

Record
EUVD-2026-11698
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-3936-cmfr-pm3m 8.7

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

Impact

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.

Patches

Fixed in Black 26.3.1.

Workarounds

Do not allow untrusted user input into the value of the --python-cell-magics option.

Record
GHSA-3936-cmfr-pm3m
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weakness
CWE-22
Updated
2026-11-02
NVD 8.7

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.

Record
CVE-2026-32274
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weakness
CWE-22
Updated
2026-11-02
OSV 8.7

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

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.

Record
CVE-2026-32274
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
Weakness
CWE-22
Updated
2026-11-02
OSVDEBIAN-CVE-2026-32274 7.5

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.

Record
DEBIAN-CVE-2026-32274
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
Show 10 moreShow less
OSVGHSA-3936-cmfr-pm3m 8.7

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

Impact

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.

Patches

Fixed in Black 26.3.1.

Workarounds

Do not allow untrusted user input into the value of the --python-cell-magics option.

Record
GHSA-3936-cmfr-pm3m
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Weakness
CWE-22
Updated
2026-11-02
OSVOESA-2026-4064 7.5

python-black security update

The uncompromising code formatter

Security Fix(es):

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.(CVE-2026-32274)

Record
OESA-2026-4064
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
OSVPYSEC-2026-2121 7.5

Black is the uncompromising Python code formatter. Prior to 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.

Record
PYSEC-2026-2121
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
OSVROOT-APP-PYPI-CVE-2026-32274 7.5

CVE-2026-32274 in black - Patched by Root

Root has patched CVE-2026-32274 in the black package for Root:PyPI. Multiple fixed versions available.

Record
ROOT-APP-PYPI-CVE-2026-32274
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
OSVUBUNTU-CVE-2026-32274 8.7

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.

Record
UBUNTU-CVE-2026-32274
CVSS 4.0
8.7 HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
OSVopenSUSE-SU-2026:10372-1 No score

python311-black-26.3.1-1.1 on GA media

These are all security issues fixed in the python311-black-26.3.1-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:10372-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:11856-1 No score

ansible-lint-26.9.0-1.1 on GA media

These are all security issues fixed in the ansible-lint-26.9.0-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:11856-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:20417-1 No score

Security update for python-black

This update for python-black fixes the following issues:

  • CVE-2026-31900: a malicious pyproject.toml edit can lead to arbitrary code execution (bsc#1259546).
  • CVE-2026-32274: arbitrary file writes from unsanitized user input in cache file name (bsc#1259608).
Record
openSUSE-SU-2026:20417-1
Updated
2026-11-02
OSVSUSE-SU-2026:0900-1 No score

Security update for python-black

This update for python-black fixes the following issue:

  • CVE-2026-32274: arbitrary file writes from unsanitized user input in cache file name (bsc#1259608).
Record
SUSE-SU-2026:0900-1
Updated
2026-11-02
OSVSUSE-SU-2026:20928-1 No score

Security update for python-black

This update for python-black fixes the following issues:

  • CVE-2026-31900: a malicious pyproject.toml edit can lead to arbitrary code execution (bsc#1259546).
  • CVE-2026-32274: arbitrary file writes from unsanitized user input in cache file name (bsc#1259608).
Record
SUSE-SU-2026:20928-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
black
PyPI
24.3.0 up to 26.3.1
26.3.1
black
Debian:12
All versions, plus listed versions
23.1.0-123.10.0-123.10.1-123.11.0-123.3.0-1
Show 26 moreShow less
23.3.0-1~exp123.7.0-123.9.1-124.1.1-124.10.0-124.10.0-224.10.0-324.2.0-124.4.0-124.4.0-224.4.2-124.4.2-224.4.2-2~0exp024.8.0-125.1.0-0exp25.1.0-125.1.0-225.1.0-325.11.0-125.12.0-125.12.0-225.9.0-126.1.0-126.3.1-126.5.1-126.5.1-2
None known
black
Debian:13
before 25.1.0-3+deb13u1, plus listed versions
25.1.0-3
25.1.0-3+deb13u1
black
Debian:14
before 26.3.1-1, plus listed versions
25.1.0-325.11.0-125.12.0-125.12.0-225.9.0-126.1.0-1
26.3.1-1
black
PyPI
24.3.0 up to 26.3.1, plus listed versions
24.10.024.4.024.4.124.4.224.8.0
Show 7 moreShow less
25.1.025.11.025.12.025.9.026.1.026.1a126.3.0
26.3.1
python-black
openEuler:24.03-LTS-SP3
before 24.2.0-3.oe2403sp3
24.2.0-3.oe2403sp3
black
PyPI
before 26.3.1, plus listed versions
18.3a018.3a118.3a218.3a318.3a4
Show 45 moreShow less
18.4a018.4a118.4a218.4a318.4a418.5b018.5b118.6b018.6b118.6b218.6b318.6b418.9b019.10b019.3b020.8b020.8b121.10b021.11b021.11b121.12b021.4b021.4b121.4b221.5b021.5b121.5b221.6b021.7b021.8b021.9b022.1.022.10.022.12.022.3.022.6.022.8.023.1.023.10.023.10.123.11.023.12.023.12.123.1a123.3.0
26.3.1
black
Root:PyPI
before 24.3.0+aikido.2
24.3.0+aikido.226.1.0+aikido.224.10.0+aikido.225.11.0+aikido.224.4.2+aikido.225.9.0+aikido.323.1a1+aikido.123.9.0+aikido.123.1.0+aikido.123.10.1+aikido.123.12.0+aikido.123.7.0+aikido.123.12.1+aikido.123.9.1+aikido.123.3.0+aikido.123.10.0+aikido.123.11.0+aikido.125.12.0+aikido.123.12.1+aikido.223.10.0+aikido.223.3.0+aikido.223.1a1+aikido.223.9.1+aikido.223.12.0+aikido.223.1.0+aikido.223.11.0+aikido.223.7.0+aikido.223.10.1+aikido.223.9.0+aikido.225.12.0+aikido.2
python-black
openSUSE:Leap 15.6
before 24.3.0-150400.9.11.1
24.3.0-150400.9.11.1
python-black
SUSE:Linux Enterprise Server 16.0
From an advisory covering 2 CVEs
before 25.1.0-160000.3.1
25.1.0-160000.3.1
Show 10 moreShow less
Affected packages
PackageAffectedFixed
python-black
SUSE:Linux Enterprise Server for SAP applications 16.0
From an advisory covering 2 CVEs
before 25.1.0-160000.3.1
25.1.0-160000.3.1
black
Ubuntu:20.04:LTS
All versions, plus listed versions
19.3b0-1
None known
black
Ubuntu:22.04:LTS
All versions, plus listed versions
20.8b1-421.4b2-321.10b0-121.12b0-1
None known
black
Ubuntu:24.04:LTS
All versions, plus listed versions
23.7.0-123.10.1-123.11.0-124.2.0-1ubuntu1
None known
black
Ubuntu:25.10
All versions, plus listed versions
25.1.0-225.1.0-3
None known
black
Ubuntu:26.10
All versions, plus listed versions
26.3.1-126.5.1-1
None known
black
Ubuntu:26.04:LTS
All versions, plus listed versions
25.1.0-325.9.0-125.11.0-125.12.0-126.1.0-126.1.0-1build126.3.1-1
None known
python-black
openSUSE:Tumbleweed
From an advisory covering 2 CVEs
before 26.3.1-1.1
26.3.1-1.1
ansible-lint
openSUSE:Tumbleweed
before 26.9.0-1.1
26.9.0-1.1
python-black
openSUSE:Leap 16.0
From an advisory covering 2 CVEs
before 25.1.0-160000.3.1
25.1.0-160000.3.1

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-32274 is a high vulnerability (CVSS 8.7) in Psf Black, published March 12, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.69%, the 53rd percentile. Fixed in black 26.3.1.

References

Show 21 moreShow less
This page doesn't list everything

Left out here: 20 versions. The JSON record has them.

MoveEnter Open