{"id":"CVE-2026-31900","published":"2026-03-11T19:15:20Z","modified":"2026-03-13T03:55:48Z","title":"Black's vulnerable version parsing leads to RCE in GitHub Action","vendor":"psf","product":"black","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.7,"severity":"HIGH","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00522,"percentile":0.45207,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/psf/black/security/advisories/GHSA-v53h-f6m7-xcgm","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611","tags":["x_refsource_MISC"]}],"priority":{"score":20.1,"factors":[{"name":"EPSS percentile","points":9.04},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.09}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-04-11","earliestUrl":"https://github.com/Batosay1337Lab/cve-2026-31900-lab","repos":[{"name":"Batosay1337Lab/cve-2026-31900-lab","url":"https://github.com/Batosay1337Lab/cve-2026-31900-lab","stars":1,"created":"2026-04-11"}]},"first":{"date":"2026-04-11","source":"PoC-in-GitHub","url":"https://github.com/Batosay1337Lab/cve-2026-31900-lab"},"provenance":"source"},"vendorSlug":"psf","affectedVersions":[{"vendor":"psf","product":"black","versions":["< 26.3.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-03-12T00:00:00+00:00","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"GitHub Actions","package":"psf/black","vulnerableRanges":["<26.3.0"],"patched":["26.3.0"],"from":["GHSA-v53h-f6m7-xcgm"],"provenance":"source"},{"ecosystem":"PyPI","package":"black","vulnerableRanges":["<26.3.0"],"patched":["26.3.0"],"from":["PYSEC-2026-2120"],"provenance":"source"}],"summary":{"text":"The flaw is in the GitHub Action provided by Black, the Python code formatter, specifically in its handling of the Black version read from a repository's pyproject.toml when the use_pyproject option is enabled, where improper input validation of the version specification occurs. An attacker who can submit a pull request to a repository using this action can edit pyproject.toml to reference a malicious repository by direct URL, achieving arbitrary code execution in the context of the GitHub Action and potentially gaining access to secrets or permissions available to that action.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:32:21Z"},"euvd":{"id":"EUVD-2026-11315","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-psf-black-cve-2026-31900","children":[{"from":"CVE-2026-31900","to":"CVE-2026-114134","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["action/main.py"],"commits":["https://github.com/psf/black/commit/ac1f71563aeccf73cf13ece00f231d9d6c66a514","https://github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2024-21503","published":"2024-03-19","fixed":"24.3.0","kev":false},{"cve":"CVE-2026-31900","published":"2026-03-11","fixed":"26.3.0","kev":false},{"cve":"CVE-2026-32274","published":"2026-03-12","fixed":"26.3.1","kev":false,"link":{"from":"CVE-2026-31900","to":"CVE-2026-32274","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:black","fromFixed":"26.3.0","toFixed":"26.3.1","daysApart":1},{"kind":"similar","provenance":"machine","score":0.39,"basis":"same product + description similarity"}]}},{"cve":"CVE-2026-114134","published":"2026-11-05","fixed":"26.10.1","kev":false}],"package":"PyPI:black"}}