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

- Severity: High 8.7 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.83%, higher than 55% of CVEs (2026-11-30)
- Published: 2026-03-12T18:33:10.000Z
- Modified: 2026-09-10T03:50:36.703Z
- Also known as: GHSA-3936-cmfr-pm3m, PYSEC-2026-2121
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- psf black: >= 24.3.0, < 26.3.1
- ansible-automation-platform-25/hub-rhel8: no versions given (not affected: from 1777393635 before *)
- ansible-automation-platform-25/lightspeed-rhel8: no versions given (not affected: from 1777403872 before *)
- ansible-automation-platform-26/ansible-dev-tools-rhel9: no versions given (not affected: from 1777390240 before *)
- ansible-automation-platform-26/ee-minimal-rhel9: no versions given (not affected: from 1777387537 before *)
- ansible-automation-platform-26/hub-rhel9: no versions given (not affected: from 1777299023 before *)
- ansible-automation-platform-26/lightspeed-rhel9: no versions given (not affected: from 1777387242 before *)
- ansible-automation-platform-26/platform-resource-runner-rhel9: no versions given (not affected: from 1777390333 before *)
- rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9: no versions given (not affected: from 1776319193 before *)
- rhoai/odh-workbench-jupyter-pytorch-cuda-py312-rhel9: no versions given (not affected: from 1776319179 before *)
- rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9: no versions given (not affected: from 1776319185 before *)
- rhoai/odh-workbench-jupyter-pytorch-rocm-py312-rhel9: no versions given (not affected: from 1776318795 before *)
- rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9: no versions given (not affected: from 1776319453 before *)
- rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9: no versions given (not affected: from 1776336534 before *)
- rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9: no versions given (not affected: from 1776319275 before *)
- openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9: no versions given
- ansible-automation-platform-26/ee-supported-rhel9: no versions given
- ansible-automation-platform/ee-minimal-rhel8: no versions given
- ansible-automation-platform/ee-minimal-rhel9: no versions given
- ansible-automation-platform-tech-preview/ee-minimal-rhel8: no versions given
- ansible-automation-platform-tech-preview/ee-minimal-rhel9: no versions given
- rhoai/odh-kserve-agent-rhel9: no versions given
- rhoai/odh-kserve-controller-rhel9: no versions given
- rhoai/odh-kserve-router-rhel9: no versions given
- rhoai/odh-kserve-storage-initializer-rhel9: no versions given
- rhoai/odh-mlflow-rhel9: no versions given
- rhoai/odh-model-registry-rhel8: no versions given
- rhoai/odh-training-operator-rhel8: no versions given
- container-native-virtualization/vm-network-latency-checkup-rhel9: no versions given
- black (PyPI): from 24.3.0 before 26.3.1; before 26.3.1
- python black: before 26.3.1

## Every score

- GitHub_M: CVSS:4.0 8.7 High `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: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:4.0 High `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: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`
- PyPA Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`

## References

- <https://github.com/psf/black/security/advisories/GHSA-3936-cmfr-pm3m> (advisory, vendor-advisory, web)
- <https://github.com/psf/black/pull/4176> (web)
- <https://github.com/psf/black/pull/5038> (fix, issue-tracking, patch, web)
- <https://github.com/psf/black/commit/4937fe6cf241139ddbfc16b0bdbb5b422798909d> (fix, patch, web)
- <https://github.com/psf/black/commit/ed770ba4dd50c419148a0fca2b43937a7447e1f9> (web)
- <https://access.redhat.com/errata/RHSA-2026:10184> (advisory, vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:13545> (advisory, vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2026:13553> (advisory, vendor-advisory, web)
- <https://access.redhat.com/security/cve/CVE-2026-32274> (vdb-entry, web)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2447111> (issue-tracking, report, web)
- <https://github.com/psf/black/releases/tag/26.3.1> (advisory, release-notes, web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/black/PYSEC-2026-2121.yaml> (web)
- <https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-32274.json> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-32274> (advisory)
- <https://github.com/psf/black> (package)

## Sources

- CVE List: [CVE-2026-32274](https://www.cve.org/CVERecord?id=CVE-2026-32274), CVE Terms of Use, modified 2026-08-03
- GitHub Advisory Database: [GHSA-3936-cmfr-pm3m](https://github.com/advisories/GHSA-3936-cmfr-pm3m), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-32274](https://nvd.nist.gov/vuln/detail/CVE-2026-32274), Public domain, modified 2026-08-03
- PyPA Advisory Database: [PYSEC-2026-2121](https://osv.dev/vulnerability/PYSEC-2026-2121), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-32274 · Whole record: https://cve.day/CVE-2026-32274.json · Rebuilt by cve.day 2026-11-25T22:59:15.855Z
