{"id":"CVE-2026-31900","aliases":["CVE-2026-31900","GHSA-v53h-f6m7-xcgm","PYSEC-2026-2120"],"related":[],"kind":"vulnerability","state":"published","title":"Black's vulnerable version parsing leads to RCE in GitHub Action","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Black es el formateador de código Python intransigente. Black proporciona una acción de GitHub para formatear código. Esta acción admite una opción, use_pyproject: true, para leer la versión de Black a utilizar desde el archivo pyproject.toml del repositorio. Una solicitud de extracción maliciosa podría editar pyproject.toml para usar una referencia de URL directa a un repositorio malicioso. Esto podría conducir a la ejecución de código arbitrario en el contexto de la Acción de GitHub. Los atacantes podrían entonces obtener acceso a secretos o permisos disponibles en el contexto de la acción. La versión 26.3.0 corrige esta vulnerabilidad.","source":"nvd"}],"published":"2026-03-07T02:32:27.000Z","modified":"2026-07-13T07:26:50.828Z","severity":{"scorer":"GitHub_M","scheme":"CVSS: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","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS: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","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS: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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-20"],"affected":[{"ranges":[{"version":"< 26.3.0","status":"affected"}],"vendor":"psf","product":"black","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"26.3.0"}],"ecosystem":"GitHub Actions","package":"psf/black","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"26.3.0"}],"vendor":"python","product":"black","cpe":"cpe:2.3:a:python:black:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"26.3.0"}],"ecosystem":"PyPI","package":"black","purl":"pkg:pypi/black","source":"pysec"}],"references":[{"url":"https://github.com/psf/black/security/advisories/GHSA-v53h-f6m7-xcgm","tags":["advisory","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/psf/black/commit/0a2560b981364dde4c8cf8ce9d164c40669a8611","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31900","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/psf/black","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-03-12T00:00:00.000Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31900","url":"https://www.cve.org/CVERecord?id=CVE-2026-31900","licence":"CVE Terms of Use","modified":"2026-03-13T03:55:48.806Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-v53h-f6m7-xcgm","url":"https://github.com/advisories/GHSA-v53h-f6m7-xcgm","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:50.828Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31900","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31900","licence":"Public domain","modified":"2026-06-17T10:34:43.470Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2120","url":"https://osv.dev/vulnerability/PYSEC-2026-2120","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:15.712Z"}],"updatedAt":"2026-11-25T22:59:15.771Z","epss":{"score":0.00522,"percentile":0.45783,"date":"2026-12-01T12:00:22.000Z"}}