StaffCoder
GitHub Actions
8 modules · 24 challengesSign up
Module 8 of 8 · 3 challenges

GitHub Actions Workflow Security

Harden a contributor pipeline: keep untrusted input out of shell commands, pin actions to a commit, and confine secrets to the jobs that need them.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

3 challenges

Untrusted Input Injection

Sign up to unlock
—No data yethard
About this challenge

A labeler pastes the pull request title straight into a shell command, and the next contributor's title is a command substitution. Route every untrusted field through the environment instead. Graded on consequence: the payload must not execute, and the field must arrive byte for byte, which a workflow that records nothing cannot fake. The grader runs the same payload through a deliberately vulnerable workflow of its own, so an absent canary only counts once the payload has been shown to fire.

Solved in a browser IDE and graded by tests. Sign up to solve

Least Privilege and Pinning

Sign up to unlock
—No data yethard
About this challenge

Two workflows run with a write-all token, reference every action by a movable tag, and hand the base repository's token to contributor code through pull_request_target. Narrow the token to the jobs that need it, pin every external action to the commit SHA the environment resolved at start, replace the pull_request_target checkout, and keep the signing key out of reach of pull request events. The pin check is paired with a run: act resolves a pin rather than merely parsing it, so an invented SHA fails outright and a removed step produces no artifact.

Solved in a browser IDE and graded by tests. Sign up to solve

Hardened Contributor Pipeline

STAR
Solving it completes the module
—No data yethard
About this challenge

A pipeline about to go public pastes contributor text into a shell, runs every job with a write-all token, references actions by movable tags, hands the repository token to contributor code through pull_request_target, and lets a pull request reach the job that holds the signing key. Harden all of it. Graded on consequence across five runs: four malicious fields must arrive verbatim and inert, a benign contribution must still be labelled, only a push to main may sign, and the composition check reads whether the job that touched the stranger's text was itself able to sign, which one job doing everything cannot pass.

Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.