CVE-2026-31900: Psf/black Remote Code Execution Vulnerability
HIGHCVE-2026-31900 is a HIGH remote code execution vulnerability (CWE-20: Improper Input Validation) affecting Psf/black libraries in the GitHub Actions ecosystem. The issue involves black's vulnerable version parsing leads to rce in github action. Remediation is available by upgrading affected packages to version 26.3.0.
CVE-2026-31900 at a Glance
How to Fix CVE-2026-31900
To remediate this vulnerability, upgrade all affected Psf/black dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade psf/black to 26.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for psf/black
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-31900, inspect your project dependencies for Psf/black:
inspect dependencies for psf/black
Analyze the terminal output to locate any version of Psf/black in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 26.3.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Psf/black, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-31900 Affected Psf/black Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
psf/black
|
GitHub Actions |
< 26.3.0
|
26.3.0
|
References
Frequently Asked Questions
What is CVE-2026-31900?
Which Psf/black versions are affected?
What version fixes CVE-2026-31900?
Is psf/black affected?
What CWE is associated with CVE-2026-31900?
How can I check GitHub Actions dependencies for CVE-2026-31900?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v53h-f6m7-xcgm",
"modified" : "2026-03-11T21:37:22Z",
"published" : "2026-03-07T02:32:27Z",
"aliases" : [ "CVE-2026-31900" ],
"summary" : "Black's vulnerable version parsing leads to RCE in GitHub Action",
"details" : "### Impact\n\nBlack provides a [GitHub action](https://black.readthedocs.io/en/stable/integrations/github_actions.html) 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.\n\n### Patches\n\nVersion 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.\n\n### Workarounds\n\nDo not use the `use_pyproject: true` option in the psf/black GitHub Action.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "GitHub Actions",
"name" : "psf/black"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "26.3.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/psf/black/security/advisories/GHSA-v53h-f6m7-xcgm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-31900"
}, {
"type" : "WEB",
"url" : "https://github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/psf/black"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-07T02:32:27Z",
"nvd_published_at" : "2026-03-11T20:16:15Z"
}
}