---
title: "CVE-2023-49291: tj-actions/branch-names's Improper Sanitization of Branch Name Leads to Arbitrary Code Injection"
url: https://erroneo.us/security/cve/CVE-2023-49291/
description: "CVE-2023-49291 (tj-actions/branch-names (GitHub Actions)): tj-actions/branch-names is a Github action to retrieve branch or tag names with support for all…"
type: vulnerability-record
section: "Security Digest"
date_published: 2023-12-04
date_modified: 2024-08-02
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2023-49291"
kev: false
cvss: 9.3
epss: 0.01448
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2023-49291: tj-actions/branch-names's Improper Sanitization of Branch Name Leads to Arbitrary Code Injection

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

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

## Affected packages

- GitHub Actions `tj-actions/branch-names` < 7.0.7 → fixed: 7.0.7

## Affected products (CVE record)

- tj-actions branch-names: < 7.0.7

## Severity

- GitHub_M CVSS 3.1: 9.3 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N`
- GitHub CVSS 3.1: 9.3 `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N`

## Exploitation

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

## Sources

- [GitHub Advisory GHSA-8v8w-v8xg-79rf](https://github.com/advisories/GHSA-8v8w-v8xg-79rf)
- [CVE.org record CVE-2023-49291](https://www.cve.org/CVERecord?id=CVE-2023-49291)
- [NVD entry CVE-2023-49291](https://nvd.nist.gov/vuln/detail/CVE-2023-49291)
- [github.com](https://github.com/tj-actions/branch-names/security/advisories/GHSA-8v8w-v8xg-79rf)
- [github.com](https://github.com/tj-actions/branch-names/commit/4923d1ca41f928c24f1c1b3af9daaadfb71e6337)
- [github.com](https://github.com/tj-actions/branch-names/commit/6c999acf206f5561e19f46301bb310e9e70d8815)
- [github.com](https://github.com/tj-actions/branch-names/commit/726fe9ba5e9da4fcc716223b7994ffd0358af060)
- [securitylab.github.com](https://securitylab.github.com/research/github-actions-untrusted-input)

---
Source page: https://erroneo.us/security/cve/CVE-2023-49291/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
