{"id":"CVE-2023-49291","published":"2023-12-04T23:21:33Z","modified":"2024-08-02T21:53:44Z","title":"Improper Sanitization of Branch Name Leads to Arbitrary Code Injection","vendor":"tj-actions","product":"branch-names","tier":"tail","description":{"text":"tj-actions/branch-names is a Github action to retrieve branch or tag names with support for all events. The `tj-actions/branch-names` GitHub Actions improperly references the `github.event.pull_request.head.ref` and `github.head_ref` context variables within a GitHub Actions `run` step. The head ref variable is the branch name and can be used to execute arbitrary code using a specially crafted branch name. As a result an attacker can use this vulnerability to steal secrets from or abuse `GITHUB_TOKEN` permissions. This vulnerability has been addressed in version 7.0.7. Users are advised to upgrade. There are no known workarounds for this vulnerability.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.3,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01448,"percentile":0.73233,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/tj-actions/branch-names/security/advisories/GHSA-8v8w-v8xg-79rf","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tj-actions/branch-names/commit/4923d1ca41f928c24f1c1b3af9daaadfb71e6337","tags":["x_refsource_MISC"]},{"url":"https://github.com/tj-actions/branch-names/commit/6c999acf206f5561e19f46301bb310e9e70d8815","tags":["x_refsource_MISC"]},{"url":"https://github.com/tj-actions/branch-names/commit/726fe9ba5e9da4fcc716223b7994ffd0358af060","tags":["x_refsource_MISC"]},{"url":"https://securitylab.github.com/research/github-actions-untrusted-input","tags":["x_refsource_MISC"]}],"priority":{"score":21.2,"factors":[{"name":"EPSS percentile","points":14.65},{"name":"CVSS severity","points":6.51}]},"vendorSlug":"tj-actions","affectedVersions":[{"vendor":"tj-actions","product":"branch-names","versions":["< 7.0.7"]}],"affected":[{"ecosystem":"GitHub Actions","package":"tj-actions/branch-names","vulnerableRanges":["<7.0.7"],"patched":["7.0.7"],"from":["GHSA-8v8w-v8xg-79rf"],"provenance":"source"}],"euvd":{"id":"EUVD-2023-3165","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tj-actions-branch-names-cve-2023-49291","children":[{"from":"CVE-2023-49291","to":"CVE-2025-54416","relation":"related","confidence":"high","kind":"lineage","evidence":[{"kind":"osv-related","provenance":"source","id":"GHSA-gq52-6phf-x2r6","via":"reference","url":"https://github.com/tj-actions/branch-names/security/advisories/GHSA-8v8w-v8xg-79rf"}]}]}}