GHSA-3936-cmfr-pm3m

Suggest an improvement
Source
https://github.com/advisories/GHSA-3936-cmfr-pm3m
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-3936-cmfr-pm3m/GHSA-3936-cmfr-pm3m.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-3936-cmfr-pm3m
Aliases
Downstream
Published
2026-03-12T18:33:10Z
Modified
2026-08-03T20:45:09.763127937Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N CVSS Calculator
  • 8.7 (High) CVSS_V4 - 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 CVSS Calculator
Summary
Black: Arbitrary file writes from unsanitized user input in cache file name
Details

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.

Database specific
{
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-12T18:33:10Z",
    "severity": "HIGH",
    "cwe_ids": [
        "CWE-22"
    ],
    "nvd_published_at": "2026-03-12T20:16:06Z"
}
References

Affected packages

PyPI / black

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
24.3.0
Fixed
26.3.1

Affected versions

24.*
24.3.0
24.4.0
24.4.1
24.4.2
24.8.0
24.10.0
25.*
25.1.0
25.9.0
25.11.0
25.12.0
26.*
26.1a1
26.1.0
26.3.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-3936-cmfr-pm3m/GHSA-3936-cmfr-pm3m.json"