Skip to content
oss-kit
GitHubInstall

Untrusted input never reaches a privileged context

Rule
R-SEC-07
Forge scope
GitHub and GitLab
Fixed by
oss-harden

Forge-supplied text such as an issue title, a branch name, or a commit message is written by whoever opened the contribution. Interpolated into a shell command it runs as code, and a workflow that builds a fork’s contribution while holding secrets hands those secrets to its author.

Observable check

on GitHub, no user-controlled ${{ github.event.* }} or ${{ github.head_ref }} expression appears inside a run: block, such values reach the shell through an env: block instead, and no pull_request_target or workflow_run workflow executes contributor-controlled code; on GitLab, user-controlled predefined variables are quoted when used in script:, no job evaluates them as generated shell, and every sensitive variable is masked with variable-reference expansion disabled.

Read the whole standard