A workflow inserts a pull request title directly into a run script using ${{ github.event.pull_request.title }}. An attacker controls the title. Which correction best reduces script-injection risk?

Published
  1. Replace the title with the pull request branch name and continue interpolating it directly into the script.
  2. Pass the title as an environment value and quote its shell use.
  3. Base64-encode the title and then evaluate the decoded string as shell code.
  4. Grant the job additional token permissions so malicious title text is rejected.

Comments — 0