{"id":"CVE-2026-31900","aliases":["DEBIAN-CVE-2026-31900","EUVD-2026-11315","GHSA-v53h-f6m7-xcgm","PYSEC-2026-2120","SUSE-SU-2026:20928-1","UBUNTU-CVE-2026-31900","openSUSE-SU-2026:10372-1","openSUSE-SU-2026:20417-1"],"status":"published","title":"Black's vulnerable version parsing leads to RCE in GitHub Action","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.","severity":{"version":"4.0","score":8.7,"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","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00522,"percentile":0.44629,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-20"],"published":"2026-03-07T02:32:27Z","modified":"2026-11-03T21:00:07Z","exploits":[{"source":"pocgithub","id":"Batosay1337Lab/cve-2026-31900-lab","title":"Batosay1337Lab/cve-2026-31900-lab","date":"2026-04-11","url":"https://github.com/Batosay1337Lab/cve-2026-31900-lab"}],"fixes":[{"ecosystem":"GitHub Actions","package":"psf/black","fixed_in":["26.3.0"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:14","package":"black","fixed_in":["26.3.1-1"],"sources":["osv"]},{"ecosystem":"PyPI","package":"black","fixed_in":["26.3.0"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"GitHub Actions","package":"psf/black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.3.0"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["23.1.0-1","23.10.0-1","23.10.1-1","23.11.0-1","23.3.0-1","23.3.0-1~exp1","23.7.0-1","23.9.1-1","24.1.1-1","24.10.0-1","24.10.0-2","24.10.0-3","24.2.0-1","24.4.0-1","24.4.0-2","24.4.2-1","24.4.2-2","24.4.2-2~0exp0","24.8.0-1","25.1.0-0exp","25.1.0-1","25.1.0-2","25.1.0-3","25.11.0-1","25.12.0-1","25.12.0-2","25.9.0-1","26.1.0-1","26.10.0-1","26.10.0-2","26.10.1-1","26.3.1-1","26.5.1-1","26.5.1-2"]},{"source":"osv","ecosystem":"Debian:13","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["25.1.0-3","25.1.0-3+deb13u1","25.11.0-1","25.12.0-1","25.12.0-2","25.9.0-1","26.1.0-1","26.10.0-1","26.10.0-2","26.10.1-1","26.3.1-1","26.5.1-1","26.5.1-2"]},{"source":"osv","ecosystem":"Debian:14","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.3.1-1"}]}],"versions":["25.1.0-3","25.11.0-1","25.12.0-1","25.12.0-2","25.9.0-1","26.1.0-1"]},{"source":"osv","ecosystem":"GitHub Actions","package":"psf/black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.3.0"}]}]},{"source":"osv","ecosystem":"PyPI","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.3.0"}]}],"versions":["18.3a0","18.3a1","18.3a2","18.3a3","18.3a4","18.4a0","18.4a1","18.4a2","18.4a3","18.4a4","18.5b0","18.5b1","18.6b0","18.6b1","18.6b2","18.6b3","18.6b4","18.9b0","19.10b0","19.3b0","20.8b0","20.8b1","21.10b0","21.11b0","21.11b1","21.12b0","21.4b0","21.4b1","21.4b2","21.5b0","21.5b1","21.5b2","21.6b0","21.7b0","21.8b0","21.9b0","22.1.0","22.10.0","22.12.0","22.3.0","22.6.0","22.8.0","23.1.0","23.10.0","23.10.1","23.11.0","23.12.0","23.12.1","23.1a1","23.3.0","23.7.0","23.9.0","23.9.1","24.1.0","24.1.1","24.10.0","24.1a1","24.2.0","24.3.0","24.4.0","24.4.1","24.4.2","24.8.0","25.1.0","25.11.0","25.12.0","25.9.0","26.1.0","26.1a1"]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 16.0","package":"python-black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"25.1.0-160000.3.1"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP applications 16.0","package":"python-black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"25.1.0-160000.3.1"}]}],"bundled":2},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["19.3b0-1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["20.8b1-4","21.4b2-3","21.10b0-1","21.12b0-1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["23.7.0-1","23.10.1-1","23.11.0-1","24.2.0-1ubuntu1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["25.1.0-2","25.1.0-3"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["26.3.1-1","26.5.1-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["25.1.0-3","25.9.0-1","25.11.0-1","25.12.0-1","26.1.0-1","26.1.0-1build1","26.3.1-1"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.3.1-1.1"}]}],"bundled":2},{"source":"osv","ecosystem":"openSUSE:Leap 16.0","package":"python-black","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"25.1.0-160000.3.1"}]}],"bundled":2}],"products":[{"vendor":"psf","product":"black"},{"vendor":"python","product":"black"}],"references":[{"url":"https://github.com/psf/black/security/advisories/GHSA-v53h-f6m7-xcgm","tags":["x_refsource_CONFIRM","Mitigation","Vendor Advisory","advisory","web"]},{"url":"https://github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31900","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-v53h-f6m7-xcgm"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31900.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-31900","tags":["advisory"]},{"url":"https://github.com/psf/black","tags":["package"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-202620928-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1259546","tags":["report"]},{"url":"https://bugzilla.suse.com/1259608","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2026-31900","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-32274","tags":["web"]},{"url":"https://ubuntu.com/security/CVE-2026-31900","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-31900","tags":["report"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2026-31900","title":"Black's vulnerable version parsing leads to RCE in GitHub Action","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.","status":"published","published":"2026-03-11T19:15:20.822Z","modified":"2026-03-13T03:55:48.806Z","cvss":[{"version":"4.0","score":8.7,"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","level":"high","assessor":"cna"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:19:51.277563Z"}],"euvd":[{"id":"EUVD-2026-11315","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.","status":"published","published":"2026-03-11T19:15:20Z","modified":"2026-03-13T03:55:48Z","cvss":[{"version":"4.0","score":8.7,"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","level":"high"}],"updated_at":"2026-11-02T19:25:35.389351Z"}],"ghsa":[{"id":"GHSA-v53h-f6m7-xcgm","title":"Black's vulnerable version parsing leads to RCE in GitHub Action","description":"### 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.","status":"published","published":"2026-03-07T02:32:27Z","modified":"2026-03-11T21:37:23Z","cvss":[{"version":"4.0","score":8.7,"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","level":"high"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:39:34.616253Z"}],"nvd":[{"id":"CVE-2026-31900","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.","status":"published","published":"2026-03-11T20:16:15.96Z","modified":"2026-06-17T10:34:43.47Z","cvss":[{"version":"4.0","score":8.7,"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/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","level":"high","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:12:08.98071Z"}],"osv":[{"id":"CVE-2026-31900","title":"Black's vulnerable version parsing leads to RCE in GitHub Action","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.","status":"published","published":"2026-03-11T19:15:20.822Z","modified":"2026-11-11T10:30:50.488478154Z","cvss":[{"version":"4.0","score":8.7,"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","level":"high"}],"cwes":["CWE-20"],"updated_at":"2026-11-11T11:06:43.834798Z"},{"id":"DEBIAN-CVE-2026-31900","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.","status":"published","published":"2026-03-11T20:16:15.96Z","modified":"2026-11-03T21:00:07.48107324Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-03T21:05:16.218603Z"},{"id":"GHSA-v53h-f6m7-xcgm","title":"Black's vulnerable version parsing leads to RCE in GitHub Action","description":"### 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.","status":"published","published":"2026-03-07T02:32:27Z","modified":"2026-07-13T07:26:50.828721304Z","cvss":[{"version":"4.0","score":8.7,"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","level":"high"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T15:46:56.639206Z"},{"id":"PYSEC-2026-2120","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.","status":"published","published":"2026-03-11T20:16:15.96Z","modified":"2026-07-13T07:15:15.712525536Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:52:55.537808Z"},{"id":"UBUNTU-CVE-2026-31900","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.","status":"published","published":"2026-03-11T20:16:00Z","modified":"2026-10-17T12:58:09.013748433Z","cvss":[{"version":"4.0","score":8.7,"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","level":"high"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T16:56:16.036833Z"},{"id":"openSUSE-SU-2026:10372-1","title":"python311-black-26.3.1-1.1 on GA media","description":"These are all security issues fixed in the python311-black-26.3.1-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-03-14T00:00:00Z","modified":"2026-03-15T11:45:28.327849Z","updated_at":"2026-11-02T16:58:38.415593Z"},{"id":"openSUSE-SU-2026:20417-1","title":"Security update for python-black","description":"This update for python-black fixes the following issues:\n\n- CVE-2026-31900: a malicious pyproject.toml edit can lead to arbitrary code execution (bsc#1259546).\n- CVE-2026-32274: arbitrary file writes from unsanitized user input in cache file name (bsc#1259608).\n","status":"published","published":"2026-03-24T19:40:55Z","modified":"2026-03-29T17:26:30.038096Z","updated_at":"2026-11-02T16:58:41.463445Z"},{"id":"SUSE-SU-2026:20928-1","title":"Security update for python-black","description":"This update for python-black fixes the following issues:\n\n- CVE-2026-31900: a malicious pyproject.toml edit can lead to arbitrary code execution (bsc#1259546).\n- CVE-2026-32274: arbitrary file writes from unsanitized user input in cache file name (bsc#1259608).\n","status":"published","published":"2026-03-24T19:40:56Z","modified":"2026-04-02T17:24:34.507309Z","updated_at":"2026-11-02T15:54:01.953589Z"}]}}
