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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| psf | black | < 26.3.0 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | black | 26.3.1-1 | — |
| Debian 13 | black | No fix yet | — |
| Debian 12 | black | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | black | No fix yet | — |
| Ubuntu 26.04 LTS | black | No fix yet | — |
| Ubuntu 25.10 | black | No fix yet | — |
| Ubuntu 24.04 LTS | black | No fix yet | — |
| Ubuntu 22.04 LTS | black | No fix yet | — |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | black | No fix yet | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 16.0 | python-black | 25.1.0-160000.3.1 | SUSE-SU-2026:20928-1 |
| SLES 16.0 | python-black | 25.1.0-160000.3.1 | SUSE-SU-2026:20928-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-black | 26.3.1-1.1 | openSUSE-SU-2026:10372-1 |
| openSUSE Leap 16.0 | python-black | 25.1.0-160000.3.1 | openSUSE-SU-2026:20417-1 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
Batosay1337Lab/cve-2026-31900-lab ★ 1 · Apr 11, 2026
CVE-2026-31900 Vulnerable Lab - psf/black GitHub Action RCE
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| GitHub Actions | psf/black | < 26.3.0 | 26.3.0 | GHSA-v53h-f6m7-xcgm |
| PyPI | black | < 26.3.0 | 26.3.0 | PYSEC-2026-2120 |
Advisories 4
- WID-SEC-2026-3046 IBM Concert: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 10, 2026
- SUSE-SU-2026:20928-1 Security update for python-black SUSE / openSUSE Security Updates · Apr 2, 2026
- openSUSE-SU-2026:20417-1 Security update for python-black SUSE / openSUSE Security Updates · Mar 29, 2026
- openSUSE-SU-2026:10372-1 python311-black-26.3.1-1.1 on GA media SUSE / openSUSE Security Updates · Mar 15, 2026