CVE-2023-49291

Public Exploit
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 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.

Category

9.3
CVSS
Severity: Critical
CVSS 3.1 •
EPSS 1.13% Top 25%
Vendor Advisory github.com
Affected: tj-actions branch-names
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2023-49291?
CVE-2023-49291 has been scored as a critical severity vulnerability.
How to fix CVE-2023-49291?
To fix CVE-2023-49291, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2023-49291 being actively exploited in the wild?
It is possible that CVE-2023-49291 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~1% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2023-49291?
CVE-2023-49291 affects tj-actions branch-names.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.