Flashcardsfor IT Certifications

D5: Mitigating Script Injection

GH-200 GitHub Actions exam practice questions · 10 flashcards

Question
What is script injection in Actions?
1 / 10

Tip: Space flips the card, ← / → navigate.

Last updated: · Report an error on this page

Show all 10 Mitigating Script Injection practice questions and answers
  1. What is script injection in Actions?
    Untrusted input (PR title, issue body, branch name) interpolated into run: executes attacker commands.
  2. Vulnerable example?
    run: echo "${{ github.event.issue.title }}".
  3. Safe pattern?
    env: TITLE: ${{ github.event.issue.title }} then run: echo "$TITLE".
  4. Untrusted contexts?
    github.event.*.title/body, head_ref, comment body, commit messages, author names.
  5. Prefer actions over inline scripts?
    Pass untrusted data as action inputs instead of shell interpolation.
  6. Shell quoting?
    Always quote variables to avoid word splitting/command injection.
  7. pull_request_target risk?
    Checking out PR head code with secrets available enables pwn requests.
  8. workflow_run risk?
    Artifacts from untrusted runs must be treated as untrusted.
  9. Code scanning for workflows?
    CodeQL can detect Actions injection patterns.
  10. Least privilege as mitigation?
    Limits impact if injection happens.