Back to all lessons
Awareness Lessons
2 months ago

GitHub Actions CI/CD Workflow Exposes Snowflake to Command Injection via Crafted Issues

A misconfigured GitHub Actions workflow in Snowflake's public repository allowed attackers to inject arbitrary commands by submitting specially crafted GitHub Issues, which were processed unsafely by a Jira integration script. The root cause was a failure to treat user-supplied input (GitHub issue content) as untrusted data within an automated CI/CD pipeline — a classic command injection pattern. This is particularly dangerous in public repositories where any unauthenticated user can submit issues, effectively giving them a vector to trigger privileged workflow execution. The exposure of internal Jira credentials demonstrates how CI/CD misconfigurations can bridge external attack surfaces to internal systems. This incident underscores the growing risk of supply chain and pipeline security gaps as organizations automate more developer workflows.

Tactical Insight

Immediate actions

  • Audit all GitHub Actions workflows in public repositories to ensure user-supplied input (issue titles, body, labels) is never passed unsanitized to shell commands or scripts.
  • Rotate any secrets or tokens that could have been exposed by the vulnerable workflow, and scope new tokens to the minimum required permissions.
  • Restrict workflow triggers (e.g., `issue_comment`, `issues`) in public repos to require maintainer approval before executing privileged steps.

Long-term improvements

  • Adopt static analysis tools (e.g., `zizmor`, `actionlint`) to automatically detect injection-prone patterns in GitHub Actions YAML files as part of the CI pipeline.
  • Apply the principle of least privilege to all CI/CD service accounts, ensuring workflow tokens cannot access internal systems beyond their specific integration need.
  • Store sensitive credentials in a dedicated secrets manager (e.g., HashiCorp Vault, AWS Secrets Manager) with short-lived tokens rather than long-lived static credentials.

Detection measures

  • Enable audit logging for all GitHub Actions workflow runs and alert on unexpected or anomalous job executions triggered from issue events in public repositories.
  • Implement secret scanning across all repositories to detect accidentally exposed credentials or tokens in workflow logs, code, or comments.