CVE-2023-49291:
tj-actions/branch-names's Improper Sanitization of Branch Name Leads to Arbitrary Code Injection
9.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.77319%
CWE
Published
12/5/2023
Updated
12/7/2023
KEV Status
No
Technology
GitHub Actions
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
tj-actions/branch-names | actions | < 7.0.7 | 7.0.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The primary vulnerability stems from direct interpolation of GitHub context variables containing attacker-controlled branch names into bash script commands. The patch moved these variables to environment variables first before use. The 'branch' step's run command is clearly vulnerable due to unsanitized ${{ }} expansion of head_ref/base_ref in command substitution. The 'current_branch' step shows similar patterns with github.ref usage. Confidence is high for the branch step due to explicit code execution examples in advisories, and medium for current_branch as defense-in-depth hardening.