Black: GitHub Action installs unvalidated required-version from pyproject.toml
Summary
The GitHub Action bundled with Black can read the version from tool.black.required-version if use_pyproject is set to True. This version is not validated and therefore can be used to execute untrusted code in the context of a victim's repository.
Details
This is similar to the previous CVE-2026-31900. The value in tool.black.required-version is accepted as the version to be installed by the action without validation.
Proof of concept
Reproduction requires a victim to use Black's GitHub Action with use_pyproject: true. The attacker would then issue a PR to the victim's repository with pyproject.toml edited so that Black points to a malicious repository.
Impact
This is a remote code execution vulnerability impacting users using the GitHub Action bundled with psf/black and using the use_pyproject: true setting.
What to do
Upgrade black to version 26.10.1 or later.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | black | < 26.10.1 | 26.10.1 |
References
- CVSS vector
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- Weakness (CWE)
CWE-829- Platform
- Python (PyPI)
- Package
black- Disclosed
- 22.10.2026
- Updated
- 25.10.2026 10:00
Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.
OSV / GitHub Advisory Database - GHSA-cg8m-r9f2-5wm2 - CC BY 4.0
Vulnerability history: black
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 4
- First → latest
- 03.2024 10.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 2
- Medium 1
Disclosures per year
- 2024: 1
- 2025: 0
- 2026: 3
-
Black: GitHub Action installs unvalidated required-version from pyproject.toml this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.