GHSA-cg8m-r9f2-5wm2: Pip/black vulnerability
Summary
The GitHub Action bundled with Black can read the version from tool.black.required-version if usepyproject 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 usepyproject: 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 usepyproject: true setting.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/blackto a version that resolves this vulnerability.Fixed in 26.10.1
Event History
Frequently Asked Questions
Which workflows are exposed?
Workflows using the GitHub Action bundled with Black are affected when they set use_pyproject: true. The issue concerns the action's handling of tool.black.required-version in pyproject.toml.
What does an attacker need to do to exploit this?
An attacker needs to submit a pull request that modifies pyproject.toml so that the Black required-version value points to a malicious repository. The action accepts that value as the version to install without validation, allowing untrusted code execution in the repository context.
How can I identify potentially affected repositories?
Review workflows that use Black's bundled GitHub Action and look for use_pyproject: true. Then check whether those workflows rely on tool.black.required-version from pyproject.toml, particularly where pull requests can modify that file.