CVE-2026-32274
JSON

8.7high

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

Severity
8.7high CVSS:4.0 by GitHub_M
Exploit likelihood
0.83% (higher than 55% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-3936-cmfr-pm3mPYSEC-2026-2121

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

Product or packageVersionsReported by
psf black>= 24.3.0, < 26.3.1CVE List
ansible-automation-platform-25/hub-rhel8Not specified
Not affected: from 1777393635 before *
CVE List
ansible-automation-platform-25/lightspeed-rhel8Not specified
Not affected: from 1777403872 before *
CVE List
ansible-automation-platform-26/ansible-dev-tools-rhel9Not specified
Not affected: from 1777390240 before *
CVE List
ansible-automation-platform-26/ee-minimal-rhel9Not specified
Not affected: from 1777387537 before *
CVE List
ansible-automation-platform-26/hub-rhel9Not specified
Not affected: from 1777299023 before *
CVE List
ansible-automation-platform-26/lightspeed-rhel9Not specified
Not affected: from 1777387242 before *
CVE List
ansible-automation-platform-26/platform-resource-runner-rhel9Not specified
Not affected: from 1777390333 before *
CVE List
rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9Not specified
Not affected: from 1776319193 before *
CVE List
rhoai/odh-workbench-jupyter-pytorch-cuda-py312-rhel9Not specified
Not affected: from 1776319179 before *
CVE List
rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9Not specified
Not affected: from 1776319185 before *
CVE List
rhoai/odh-workbench-jupyter-pytorch-rocm-py312-rhel9Not specified
Not affected: from 1776318795 before *
CVE List

All scores

GitHub_M8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
redhat-SADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
PyPA Advisory Database7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Classification

CWE-22

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
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.

NVD (es)

Black es el formateador de código Python intransigente. Antes de la versión 26.3.1, Black escribe un archivo de caché, cuyo nombre se calcula a partir de varias opciones de formato. El valor de la opción --python-cell-magics se colocaba en el nombre del archivo sin sanitización, lo que permitía a un atacante que controla el valor de este argumento escribir archivos de caché en ubicaciones arbitrarias del sistema de archivos. Corregido en Black 26.3.1.

PyPA Advisory Database

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.

References

https://github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3madvisory, vendor-advisory, web
https://github.com/psf/black/pull/4176web
https://github.com/psf/black/pull/5038fix, issue-tracking, patch, web
https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909dfix, patch, web
https://github.com/psf/black/commit/ed770ba4dd50c419148a0fca2b43937a7447e1f9web
https://access.redhat.com/errata/RHSA-2026:10184advisory, vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:13545advisory, vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:13553advisory, vendor-advisory, web
https://access.redhat.com/security/cve/CVE-2026-32274vdb-entry, web
https://bugzilla.redhat.com/show_bug.cgi?id=2447111issue-tracking, report, web
https://github.com/psf/black/releases/tag/26.3.1advisory, release-notes, web
https://github.com/pypa/advisory-database/tree/main/vulns/black/PYSEC-2026-2121.yamlweb

Sources

SourceRecordLicence
CVE ListCVE-2026-32274 changed 2026-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-3936-cmfr-pm3m changed 2026-09-10CC-BY-4.0
NVDCVE-2026-32274 changed 2026-08-03Public domain
PyPA Advisory DatabasePYSEC-2026-2121 changed 2026-07-13CC-BY-4.0