CVE-2023-49291

9.3 CRITICAL

📋 TL;DR

This vulnerability in the tj-actions/branch-names GitHub Action allows attackers to execute arbitrary code by using specially crafted branch names. The vulnerability occurs because the action improperly references untrusted input variables within GitHub Actions run steps, enabling attackers to steal secrets or abuse GITHUB_TOKEN permissions. Anyone using vulnerable versions of this GitHub Action in their workflows is affected.

💻 Affected Systems

Products:
  • tj-actions/branch-names GitHub Action
Versions: All versions before 7.0.7
Operating Systems: All platforms where GitHub Actions runs
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability affects any GitHub workflow using the vulnerable action, regardless of operating system or configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of the GitHub Actions runner environment, theft of all repository secrets, unauthorized code execution, and potential lateral movement to connected systems.

🟠

Likely Case

Theft of repository secrets, unauthorized code execution within the GitHub Actions environment, and potential abuse of GITHUB_TOKEN permissions for malicious repository modifications.

🟢

If Mitigated

Limited impact due to proper branch protection rules, minimal secrets exposure, and restricted GITHUB_TOKEN permissions.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires ability to create branches in the repository, making it accessible to repository contributors. GitHub Security Lab has published research demonstrating exploitation techniques.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 7.0.7

Vendor Advisory: https://github.com/tj-actions/branch-names/security/advisories/GHSA-8v8w-v8xg-79rf

Restart Required: No

Instructions:

1. Update your GitHub workflow YAML files to reference tj-actions/branch-names@v7.0.7 or later. 2. Replace any version tags like @v7 or @v7.0.6 with @v7.0.7. 3. Test your workflows to ensure compatibility with the updated version.

🔧 Temporary Workarounds

No workarounds available

all

The vendor advisory states there are no known workarounds for this vulnerability.

🧯 If You Can't Patch

  • Temporarily disable workflows using the vulnerable action until patching is possible
  • Implement strict branch protection rules to prevent unauthorized branch creation

🔍 How to Verify

Check if Vulnerable:

Check your GitHub workflow YAML files for references to tj-actions/branch-names with version tags older than v7.0.7 or using major version tags like @v7 without specific patch version.

Check Version:

grep -r "tj-actions/branch-names" .github/workflows/

Verify Fix Applied:

Verify that all workflow files reference tj-actions/branch-names@v7.0.7 or later, then run your workflows to confirm they execute without errors.

📡 Detection & Monitoring

Log Indicators:

  • Unusual branch names containing shell metacharacters or code injection patterns in GitHub Actions logs
  • Unexpected command execution in branch-names action steps
  • Unauthorized access attempts to secrets or sensitive data

Network Indicators:

  • Unexpected outbound connections from GitHub Actions runners during branch name processing

SIEM Query:

source="github-actions" AND "branch-names" AND ("github.event.pull_request.head.ref" OR "github.head_ref")

🔗 References

📤 Share & Export