Black: GitHub Action installs unvalidated required-version from pyproject.toml
What fixes it
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
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.
Text from GitHub Advisory Database
Affected versions 52
- black, pip< 26.10.1GitHub
- black, PyPIfrom first release, fixed in 26.10.1OSV
- black, PyPI18.3a0OSV
- black, PyPI18.3a1OSV
- black, PyPI18.3a2OSV
- black, PyPI18.3a3OSV
- black, PyPI18.3a4OSV
- black, PyPI18.4a0OSV
- black, PyPI18.4a1OSV
- black, PyPI18.4a2OSV
- black, PyPI18.4a3OSV
- black, PyPI18.4a4OSV
- black, PyPI18.5b0OSV
- black, PyPI18.5b1OSV
- black, PyPI18.6b0OSV
- black, PyPI18.6b1OSV
- black, PyPI18.6b2OSV
- black, PyPI18.6b3OSV
- black, PyPI18.6b4OSV
- black, PyPI18.9b0OSV
- black, PyPI19.10b0OSV
- black, PyPI19.3b0OSV
- black, PyPI20.8b0OSV
- black, PyPI20.8b1OSV
- black, PyPI21.10b0OSV
- black, PyPI21.11b0OSV
- black, PyPI21.11b1OSV
- black, PyPI21.12b0OSV
- black, PyPI21.4b0OSV
- black, PyPI21.4b1OSV
- black, PyPI21.4b2OSV
- black, PyPI21.5b0OSV
- black, PyPI21.5b1OSV
- black, PyPI21.5b2OSV
- black, PyPI21.6b0OSV
- black, PyPI21.7b0OSV
- black, PyPI21.8b0OSV
- black, PyPI21.9b0OSV
- black, PyPI22.1.0OSV
- black, PyPI22.10.0OSV
- black, PyPI22.12.0OSV
- black, PyPI22.3.0OSV
- black, PyPI22.6.0OSV
- black, PyPI22.8.0OSV
- black, PyPI23.1.0OSV
- black, PyPI23.10.0OSV
- black, PyPI23.10.1OSV
- black, PyPI23.11.0OSV
- black, PyPI23.12.0OSV
- black, PyPI23.12.1OSV
- black, PyPI23.1a1OSV
- black, PyPI23.3.0OSV
References 5
- github.com/psf/black/commit/ac1f71563aeccf73cf13ece00f231d9d6c66a514Fixvia GitHub
- github.com/psf/black/releases/tag/26.10.1Fixvia GitHub
- github.com/psf/black/security/advisories/GHSA-cg8m-r9f2-5wm2Advisoryvia GitHub
- github.com/advisories/GHSA-cg8m-r9f2-5wm2Advisoryvia GitHub
- github.com/psf/black/pull/5510Referencevia GitHub