CVE-2026-31900 Black's vulnerable version parsing leads to RCE in GitHub Action
Attackers can achieve arbitrary code execution in GitHub Actions by manipulating pyproject.toml when the use_pyproject option is enabled.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-31900?
CVE-2026-31900 is a high-severity code injection vulnerability in psf black, published on 11 Mar 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Official 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.
Weakness: CWE-20
Which versions are affected by CVE-2026-31900?
2 open source packages ship an affected version, including psf/black and black. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
psf/black GitHub Actions | All versions | 26.3.0 |
black PyPI | All versions | 26.3.0 |
Products include Python Black.
How do I fix CVE-2026-31900?
Upgrade psf/black to 26.3.0 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-31900 being exploited?
There is no known exploitation of CVE-2026-31900 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in psf black
Sources
Also known as CLEANSTART-2026-DV70312, DEBIAN-CVE-2026-31900, GHSA-v53h-f6m7-xcgm, PYSEC-2026-2120, UBUNTU-CVE-2026-31900.