CVE-2026-31900
Black's vulnerable version parsing leads to RCE in GitHub Action
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.7
Black's vulnerable version parsing leads to RCE in GitHub Action
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.
- Record
CVE-2026-31900- CVSS 4.0
- 8.7 High
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 - Weakness
- CWE-20
- Updated
- 2026-11-02
EUVDEUVD-2026-11315
8.7
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.
- Record
EUVD-2026-11315- CVSS 4.0
- 8.7 High
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-v53h-f6m7-xcgm
8.7
Black's vulnerable version parsing leads to RCE in GitHub Action
Impact
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.
Patches
Version 26.3.0 fixes this vulnerability by tightening the validation of the version field. Users who use the GitHub Action as psf/black@stable will automatically pick up this update.
Workarounds
Do not use the use_pyproject: true option in the psf/black GitHub Action.
- Record
GHSA-v53h-f6m7-xcgm- CVSS 4.0
- 8.7 High
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 - Weakness
- CWE-20
- Updated
- 2026-11-02
NVD
8.7
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.
- Record
CVE-2026-31900- CVSS 4.0
- 8.7 High
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
OSV
8.7
Black's vulnerable version parsing leads to RCE in GitHub Action
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.
- Record
CVE-2026-31900- CVSS 4.0
- 8.7 High
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 - Weakness
- CWE-20
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-31900
9.8
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.
- Record
DEBIAN-CVE-2026-31900- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
Show 6 moreShow less
OSVGHSA-v53h-f6m7-xcgm
8.7
Black's vulnerable version parsing leads to RCE in GitHub Action
Impact
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.
Patches
Version 26.3.0 fixes this vulnerability by tightening the validation of the version field. Users who use the GitHub Action as psf/black@stable will automatically pick up this update.
Workarounds
Do not use the use_pyproject: true option in the psf/black GitHub Action.
- Record
GHSA-v53h-f6m7-xcgm- CVSS 4.0
- 8.7 High
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 - Weakness
- CWE-20
- Updated
- 2026-11-02
OSVPYSEC-2026-2120
9.8
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.
- Record
PYSEC-2026-2120- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-31900
8.7
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.
- Record
UBUNTU-CVE-2026-31900- CVSS 4.0
- 8.7 High
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 - CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVopenSUSE-SU-2026:10372-1 No score
python311-black-26.3.1-1.1 on GA media
These are all security issues fixed in the python311-black-26.3.1-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:10372-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:20417-1 No score
Security update for python-black
This update for python-black fixes the following issues:
- CVE-2026-31900: a malicious pyproject.toml edit can lead to arbitrary code execution (bsc#1259546).
- CVE-2026-32274: arbitrary file writes from unsanitized user input in cache file name (bsc#1259608).
- Record
openSUSE-SU-2026:20417-1- Updated
- 2026-11-02
OSVSUSE-SU-2026:20928-1 No score
Security update for python-black
This update for python-black fixes the following issues:
- CVE-2026-31900: a malicious pyproject.toml edit can lead to arbitrary code execution (bsc#1259546).
- CVE-2026-32274: arbitrary file writes from unsanitized user input in cache file name (bsc#1259608).
- Record
SUSE-SU-2026:20928-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
psf/blackGitHub Actions |
before 26.3.0 | 26.3.0 |
blackDebian:12 |
All versions, plus listed versions 23.1.0-123.10.0-123.10.1-123.11.0-123.3.0-1 Show 29 moreShow less23.3.0-1~exp123.7.0-123.9.1-124.1.1-124.10.0-124.10.0-224.10.0-324.2.0-124.4.0-124.4.0-224.4.2-124.4.2-224.4.2-2~0exp024.8.0-125.1.0-0exp25.1.0-125.1.0-225.1.0-325.11.0-125.12.0-125.12.0-225.9.0-126.1.0-126.10.0-126.10.0-226.10.1-126.3.1-126.5.1-126.5.1-2 |
None known |
blackDebian:13 |
All versions, plus listed versions 25.1.0-325.1.0-3+deb13u125.11.0-125.12.0-125.12.0-2 Show 8 moreShow less25.9.0-126.1.0-126.10.0-126.10.0-226.10.1-126.3.1-126.5.1-126.5.1-2 |
None known |
blackDebian:14 |
before 26.3.1-1, plus listed versions 25.1.0-325.11.0-125.12.0-125.12.0-225.9.0-126.1.0-1 |
26.3.1-1 |
blackPyPI |
before 26.3.0, plus listed versions 18.3a018.3a118.3a218.3a318.3a4 Show 45 moreShow less18.4a018.4a118.4a218.4a318.4a418.5b018.5b118.6b018.6b118.6b218.6b318.6b418.9b019.10b019.3b020.8b020.8b121.10b021.11b021.11b121.12b021.4b021.4b121.4b221.5b021.5b121.5b221.6b021.7b021.8b021.9b022.1.022.10.022.12.022.3.022.6.022.8.023.1.023.10.023.10.123.11.023.12.023.12.123.1a123.3.0 |
26.3.0 |
python-blackSUSE:Linux Enterprise Server 16.0 From an advisory covering 2 CVEs |
before 25.1.0-160000.3.1 | 25.1.0-160000.3.1 |
python-blackSUSE:Linux Enterprise Server for SAP applications 16.0 From an advisory covering 2 CVEs |
before 25.1.0-160000.3.1 | 25.1.0-160000.3.1 |
blackUbuntu:20.04:LTS |
All versions, plus listed versions 19.3b0-1 |
None known |
blackUbuntu:22.04:LTS |
All versions, plus listed versions 20.8b1-421.4b2-321.10b0-121.12b0-1 |
None known |
blackUbuntu:24.04:LTS |
All versions, plus listed versions 23.7.0-123.10.1-123.11.0-124.2.0-1ubuntu1 |
None known |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
blackUbuntu:25.10 |
All versions, plus listed versions 25.1.0-225.1.0-3 |
None known |
blackUbuntu:26.10 |
All versions, plus listed versions 26.3.1-126.5.1-1 |
None known |
blackUbuntu:26.04:LTS |
All versions, plus listed versions 25.1.0-325.9.0-125.11.0-125.12.0-126.1.0-126.1.0-1build126.3.1-1 |
None known |
python-blackopenSUSE:Tumbleweed From an advisory covering 2 CVEs |
before 26.3.1-1.1 | 26.3.1-1.1 |
python-blackopenSUSE:Leap 16.0 From an advisory covering 2 CVEs |
before 25.1.0-160000.3.1 | 25.1.0-160000.3.1 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | Batosay1337Lab/cve-2026-31900-lab | 2026-04-11 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| affected, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-31900 is a high vulnerability (CVSS 8.7) in Psf Black, published March 7, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.52%, the 44th percentile. Fixed in psf/black 26.3.0.
References
github.com/psf/black/security/advisories/GHSA-v53h-f6m7-xcgm
github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611
nvd.nist.gov/vuln/detail/CVE-2026-31900
github.com/advisories/GHSA-v53h-f6m7-xcgm
github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31900.json
security-tracker.debian.org/tracker/CVE-2026-31900
Left out here: 19 versions. The JSON record has them.