CVE-2023-51664

7.3 HIGH

📋 TL;DR

CVE-2023-51664 is a command injection vulnerability in the tj-actions/changed-files GitHub Action that allows attackers to execute arbitrary commands on GitHub Runners by manipulating changed filenames. This can lead to secret leakage, repository compromise, and unauthorized access to CI/CD pipelines. Anyone using vulnerable versions of this GitHub Action in their workflows is affected.

💻 Affected Systems

Products:
  • tj-actions/changed-files GitHub Action
Versions: All versions prior to 41.0.0
Operating Systems: All platforms where GitHub Actions run (Linux, Windows, macOS)
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists when the action processes changed filenames from untrusted sources, such as pull requests from external contributors.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete compromise of GitHub Runner with ability to exfiltrate repository secrets, modify source code, deploy malicious artifacts, and pivot to other systems in the CI/CD pipeline.

🟠

Likely Case

Unauthorized command execution leading to secret leakage (tokens, credentials), repository data exfiltration, and potential supply chain attacks through compromised builds.

🟢

If Mitigated

Limited impact due to restricted runner permissions, network isolation, and minimal secrets exposure, potentially only affecting non-sensitive operations.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires ability to create or modify files in a repository (typically through pull requests). The vulnerability is well-documented in the security advisory with technical details.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 41.0.0 and later

Vendor Advisory: https://github.com/tj-actions/changed-files/security/advisories/GHSA-mcph-m25j-8j63

Restart Required: No

Instructions:

1. Update your GitHub workflow YAML files to reference tj-actions/changed-files@v41.0.0 or later. 2. Replace any version tags like @v40 or @main with @v41.0.0. 3. Test your workflows to ensure compatibility with the updated version.

🔧 Temporary Workarounds

Pin to safe version

all

Explicitly pin the action to version 41.0.0 or later in all workflow files

- uses: tj-actions/changed-files@v41.0.0

Temporary disable action

all

Temporarily remove or comment out the changed-files action from workflows until patching

# - uses: tj-actions/changed-files

🧯 If You Can't Patch

  • Implement strict code review for all pull requests, especially those modifying workflow files
  • Limit GitHub Runner permissions to minimum required and use ephemeral runners

🔍 How to Verify

Check if Vulnerable:

Check your GitHub workflow YAML files for references to tj-actions/changed-files with version tags older than v41.0.0 or using @main/@master without explicit version pinning.

Check Version:

grep -r "tj-actions/changed-files" .github/workflows/

Verify Fix Applied:

Verify all workflow files reference tj-actions/changed-files@v41.0.0 or later. Run a test workflow to confirm the action functions correctly with the updated version.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected command execution in GitHub Actions logs
  • Suspicious shell commands in changed-files action output
  • Failed workflow runs with command injection errors

Network Indicators:

  • Unexpected outbound connections from GitHub Runners during changed-files execution
  • DNS requests to suspicious domains from action context

SIEM Query:

source="github-actions" action="changed-files" (command_injection OR shell_exec OR suspicious_command)

🔗 References

📤 Share & Export