Advisory

PYSEC-2026-2120

Also known as: CVE-2026-31900, GHSA-v53h-f6m7-xcgm

Summary

The record has no summary.

Details

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.

Severity

Critical Basis: CVSS v3 score 9.8, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Dates

Published
2026-03-11 20:16 UTC
Modified
2026-07-13 07:15 UTC

Affected packages and fixes

black

PyPI · All systems

Affected

  • introduced 0, fixed 26.3.0 (ecosystem)

Fixed versions

26.3.0

Fix

  • Fixed version 26.3.0
    pip install --upgrade black==26.3.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences