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 package | Versions | Reported by |
|---|---|---|
| psf black | >= 24.3.0, < 26.3.1 | CVE List |
| ansible-automation-platform-25/hub-rhel8 | Not specified Not affected: from 1777393635 before * | CVE List |
| ansible-automation-platform-25/lightspeed-rhel8 | Not specified Not affected: from 1777403872 before * | CVE List |
| ansible-automation-platform-26/ansible-dev-tools-rhel9 | Not specified Not affected: from 1777390240 before * | CVE List |
| ansible-automation-platform-26/ee-minimal-rhel9 | Not specified Not affected: from 1777387537 before * | CVE List |
| ansible-automation-platform-26/hub-rhel9 | Not specified Not affected: from 1777299023 before * | CVE List |
| ansible-automation-platform-26/lightspeed-rhel9 | Not specified Not affected: from 1777387242 before * | CVE List |
| ansible-automation-platform-26/platform-resource-runner-rhel9 | Not specified Not affected: from 1777390333 before * | CVE List |
| rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9 | Not specified Not affected: from 1776319193 before * | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-cuda-py312-rhel9 | Not specified Not affected: from 1776319179 before * | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9 | Not specified Not affected: from 1776319185 before * | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-rocm-py312-rhel9 | Not specified Not affected: from 1776318795 before * | CVE List |
| rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9 | Not specified Not affected: from 1776319453 before * | CVE List |
| rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9 | Not specified Not affected: from 1776336534 before * | CVE List |
| rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9 | Not specified Not affected: from 1776319275 before * | CVE List |
| openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/ee-supported-rhel9 | Not specified | CVE List |
| ansible-automation-platform/ee-minimal-rhel8 | Not specified | CVE List |
| ansible-automation-platform/ee-minimal-rhel9 | Not specified | CVE List |
| ansible-automation-platform-tech-preview/ee-minimal-rhel8 | Not specified | CVE List |
| ansible-automation-platform-tech-preview/ee-minimal-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-agent-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-controller-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-router-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-storage-initializer-rhel9 | Not specified | CVE List |
| rhoai/odh-mlflow-rhel9 | Not specified | CVE List |
| rhoai/odh-model-registry-rhel8 | Not specified | CVE List |
| rhoai/odh-training-operator-rhel8 | Not specified | CVE List |
| container-native-virtualization/vm-network-latency-checkup-rhel9 | Not specified | CVE List |
| black (PyPI) | from 24.3.0 before 26.3.1, before 26.3.1 | GitHub Advisory Database, PyPA Advisory Database |
| python black | before 26.3.1 | NVD |
All scores
| GitHub_M | 8.7high CVSS:4.0 | CVSS: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-SADP | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
| PyPA Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N |
Classification
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
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-32274 changed 2026-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3936-cmfr-pm3m changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-32274 changed 2026-08-03 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2121 changed 2026-07-13 | CC-BY-4.0 |