Loading tutorials
Intermediate · Mid: 15 chapters · 35 min read. States assumed prerequisites
Start reading$VARIABLE expansion. The chapter explains the step that makes script injection possible.${{ }} is an expression, and can write basic shell. It builds on the previous chapter, where ${{ }} was shown to be expanded into the script text before the shell starts.${{ }} expressions are expanded in run steps and why event fields such as titles and branch names are attacker-controlled. Here the same flaw appears in a different place: JavaScript source instead of shell.GITHUB_TOKEN is a short-lived credential GitHub gives each workflow run. Here you compare the two triggers that start a workflow when a pull request opens, and you learn which one is safe for rpull_request_target runs in the base repository's context. The earlier chapters showed how an attacker can run code in your job. Token permissions decide how much damage that code canpull_request and pull_request_target triggers. It also assumes you know what GITHUB_TOKEN permissions are.pull_request and pull_request_target triggers, the permissions key, and why a pwn request is dangerous. Here you will see the standard fix: separate the code that runs untrusted input from the code that holds privileges.pull_request and pull_request_target triggers, the default GITHUB_TOKEN permissions, and the split-workflow pattern from the previous chapter. Here you will see how the privileged half of that split can still be attacked through the data it receives.${{ }} expansion and on passing untrusted data through environment variables.pull_request and pull_request_target, and how GITHUB_TOKEN permissions work. The earlier chapters on those topics cover both. Here you add two human checkpoints that sit around a workflow: approval before fork code runs, and approval before pull_request and pull_request_target. It also assumes you know that GITHUB_TOKEN and repository secrets are available to jobs. Here we look at a different trust boundary: the code you pull in with uses:.