# CVE-2026-31900: PYSEC-2026-2120 - Black is the uncompromising Python code formatter. Black provides a GitHub action for formatting…

Source: https://junglewise.ai/threats/cve-2026-31900-pysec-2026-2120-black-is-the-uncompromising-python-code-formatter  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-11  
License: CC BY 4.0 with a link back

CVE-2026-31900 · Severity: low · CVSS 3.1 · Published 2026-03-11

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.

Technologies: [black (PyPI)](https://junglewise.ai/threats/technologies/pypi-black). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-31900 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-31900 being exploited in the wild.

**How severe is CVE-2026-31900?** Low severity, with a CVSS score of 3.1, published 11 March 2026.

**Which products and versions are affected?** black (PyPI) ECOSYSTEM:introduced=0,fixed=26.3.0.

**Is there a fix for CVE-2026-31900?** Yes. black (PyPI): upgrade to 26.3.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2026-31900?** Check whether you run black (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- black (PyPI): upgrade to 26.3.0 or later

  ```sh
  pip install "black>=26.3.0"
  ```


## Affected products

- black (PyPI) ECOSYSTEM:introduced=0,fixed=26.3.0

## Identifiers

- CVE-2026-31900
- PYSEC-2026-2120

## Related threats

- [Black GitHub Action code injection via unvalidated required-version](https://junglewise.ai/threats/cve-2026-114134-black-github-action-installs-unvalidated-required-version-from)
- [psf Black arbitrary file write via unsanitized cache filename](https://junglewise.ai/threats/cve-2026-32274-psf-black-arbitrary-file-write-via-unsanitized-cache-filename)
- [Black vulnerable to Regular Expression Denial of Service (ReDoS)](https://junglewise.ai/threats/cve-2024-21503-black-vulnerable-to-regular-expression-denial-of-service-redos)
