Interview Prep/CI/CD/Supply Chain and Pipeline Security

What is the "pwn request" attack and how do you defend against it?

AdvancedProductionSupply Chain and Pipeline Security
Answer

An attacker opens a fork PR that modifies code a privileged workflow will run. This happens when a workflow triggered by pull_request_target (or workflow_run) checks out the PR head and runs build or test scripts with write permissions and secrets. Defences: never check out and execute untrusted PR code in privileged contexts; split into an unprivileged build workflow and a privileged follow-up that only consumes inert data; set minimal permissions; require approval for first-time contributor workflows; and lint workflows with zizmor, which flags dangerous triggers.

All CI/CD questions

More on Supply Chain and Pipeline Security