What’s Vulnerable › Vulnerabilities
CVE-2026-31900: Black's vulnerable version parsing leads to RCE in GitHub Action
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.5% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2026-03-11 · updated 2026-06-17
- Weakness: CWE-20
Description
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.
Affected products
- psf black: before 26.3.0 — fixed in 26.3.0
How to fix
Upgrade to a fixed version: psf black 26.3.0. Check the vendor advisory for mitigations.
References
- https://github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611
- https://github.com/psf/black/security/advisories/GHSA-v53h-f6m7-xcgm
Get alerted when CVE-2026-31900 or the next vulnerability affects your stack