{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2023-49291","id":"CVE-2023-49291","title":"Improper Sanitization of Branch Name Leads to Arbitrary Code Injection","description":"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 bra","descriptionLong":"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.","published":"2023-12-04T23:21:33.367Z","updated":"2026-10-28T02:31:12.474489637Z","reserved":"2023-11-24T16:45:24.313Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","rating":"critical","source":"GitHub_M"},"metrics":[{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","rating":"critical","source":"GitHub_M"},{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","rating":"critical","source":"github.com"},{"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","rating":"critical","source":"NVD"},{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","rating":"critical","source":"OSV"},{"version":"3.1","score":9.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N","rating":"critical","source":"GitHub"}],"rating":"critical","products":["tj-actions branch-names"],"affectedProducts":[{"vendor":"tj-actions","product":"branch-names","defaultStatus":null,"versions":[{"version":"< 7.0.7","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"GitHub Actions","name":"tj-actions/branch-names","purl":null,"ranges":["<7.0.7"],"fixed":["7.0.7"],"advisory":"GHSA-8v8w-v8xg-79rf"}],"cwes":["CWE-20"],"aliases":["GHSA-8v8w-v8xg-79rf"],"references":[{"url":"https://github.com/tj-actions/branch-names/security/advisories/GHSA-8v8w-v8xg-79rf","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/tj-actions/branch-names/commit/4923d1ca41f928c24f1c1b3af9daaadfb71e6337","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/tj-actions/branch-names/commit/6c999acf206f5561e19f46301bb310e9e70d8815","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/tj-actions/branch-names/commit/726fe9ba5e9da4fcc716223b7994ffd0358af060","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://securitylab.github.com/research/github-actions-untrusted-input","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/49xxx/CVE-2023-49291.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-49291","tags":["advisory"]},{"url":"https://github.com/tj-actions/branch-names","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.01448,"epssPercentile":0.73856,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2023-49291","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-49291","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2023-49291","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-8v8w-v8xg-79rf","ok":true,"note":"GHSA-8v8w-v8xg-79rf"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2023-49291","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}