scorecard
scorecard copied to clipboard
Dangerous workflows: detect refs
Workflows that use labels to enforce reviews before running test on pull_request_targets checkout the repo with ref: ${{github.event.pull_request.head.sha}}. One mistake some developers make is use ref: ${{github.event.pull_request.head.ref}} instead, which is subject to a TOCTOU attack.
- Maintainer reviews the RP code and adds a label
- Attacker pushes different code before the workflow is triggered / the repo is checked out.
Scorecard can detect these as part of the dangerous workflow check.