GitHub Actions Security Risks: Dangerous Triggers, Script Injection, and Compromised Actions

Summary
A security explainer details how GitHub Actions misconfigurations enabled supply-chain attacks, secret theft, and script injection, and recommends safer trigger use, careful handling of untrusted inputs, and pinning third-party actions.
Key points
- The article identifies three main risks: dangerous workflow triggers, script injection, and compromised third-party actions.
- A misconfigured pull_request_target workflow can run attacker-controlled code with repository secrets and write permissions.
- Issue titles, pull request content, and branch names can become script-injection vectors when inserted directly into shell commands.
- The Ultralytics supply-chain attack used an unsafe workflow input to steal GitHub tokens and PyPI publishing credentials, then poison releases with a cryptominer.
- The tj-actions/changed-files compromise affected workflows in more than 22,000 public repositories and exposed base64-encoded secrets in logs.
- Recommended mitigations include avoiding pull_request_target where possible, reviewing workflows manually, treating untrusted inputs safely, and pinning third-party actions to commit SHAs.
Article Details
- Topic
- GitHub Actions security risks, including dangerous workflow triggers, script injection, and compromised third-party actions
Malware
Products
GitHub Actionschain was breached through a workflow the authors believed was secure. All three attacks exploited GitHub Actions misconfigurations that remain common today.PyPIThe tj-actions compromise hit 22,000 repositories. Ultralytics had cryptominers injected into PyPI releases. Trivy's supply chain was breached through a workflow the authors believed was secure. All three attacksYOLOIn December 2024, Ultralytics (the organization behind the massively popular YOLO computer vision models) suffered a severe software supply chain attack. Threat actors compromised the project's PyPI releases, infecting
