GHSA-cg8m-r9f2-5wm2: Pip/black vulnerability

Published Oct 22, 2026
·
Updated

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

1 affected componentFixes available
pip/black<26.10.1
26.10.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/black to a version that resolves this vulnerability.

    Fixed in 26.10.1

Event History

Oct 22, 2026
Advisory Published
via GitHub·04:18 PM
Data Sourced
via GitHub·04:18 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

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.

2

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.

3

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203