8.7High

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

psf black; Red Hat Red Hat Ansible Automation Platform 2.5; Red Hat Red Hat Ansible Automation Platform 2.6; Red Hat Red Hat OpenShift AI 2.25 Published: (8 months ago)

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.

Weakness (CWE): CWE-22

Data: CVE.org, NVD, CISA KEV, FIRST EPSS, Ubuntu. Published as the sources state it, in English.

Affected products and versions

References and patches

CPE matches (NVD) (1)

  • cpe:2.3:a:python:black:*:*:*:*:*:python:*:* < 26.3.1