CVE-2026-31900
HIGH 8.7CVSS 4.0Black's vulnerable version parsing leads to RCE in GitHub Action
Black is the uncompromising Python code formatter. Black provides a GitHub action for formatting code. This action supports an option, use_pyproject: true, for reading the version of Black to use from the repository pyproject.toml. A malicious pull request could edit pyproject.toml to use a direct URL reference to a malicious repository. This could lead to arbitrary code execution in the context of the GitHub Action. Attackers could then gain access to secrets or permissions available in the context of the action. Version 26.3.0 fixes this vulnerability.
- Published
- 11 Mar 2026
- Last modified
- 13 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-20
- Also known as
- GHSA-v53h-f6m7-xcgmPYSEC-2026-2120
- Sources
- NVDJSONOSV GHSA-v53h-f6m7-xcgmJSONOSV PYSEC-2026-2120JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | HIGH 8.7 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | python | blackcpe:2.3:a:python:black:*:*:*:*:*:*:*:* |
< 26.3.0 | 26.3.0 |
| OSV | GitHub Actions | psf/black | < 26.3.0 | 26.3.0 |
| OSV | PyPI | black | < 26.3.0 | 26.3.0 |
References
- https://github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611 · Patch, WEB, FIX
- https://github.com/psf/black/security/advisories/GHSA-v53h-f6m7-xcgm · Mitigation, Vendor Advisory, WEB, ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2026-31900 · ADVISORY
- https://github.com/psf/black · PACKAGE
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 11 Mar 2026)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 7 Mar 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 11 Mar 2026)