A popular GitHub Action you use was compromised and now dumps secrets into workflow logs. What do you do?
AdvancedScenarioSecurity incidents
Answer
Situation read → This is a supply-chain incident. Any workflow that ran the bad version may have leaked every secret it could see, and public repos' logs are readable by anyone.
What I'd do →
- Find exposure: search the org for the action and list runs in the affected time window.
gh search code --owner acme "uses: some-org/changed-files" --limit 200
gh run list --repo acme/api --created ">=2026-11-01" --json databaseId,workflowName,createdAt
- Stop using it: remove or pin it to a known-good commit SHA across all repos.
- Rotate every secret available to those workflows (repo, environment and org secrets), starting with cloud and registry credentials.
- Delete affected run logs and check the systems behind each secret for misuse.
- Prevent:
- Pin third-party actions to full commit SHAs, and let Dependabot update the pins.
- Restrict allowed actions in org settings to verified creators and an allowlist.
- Use OIDC for cloud access so there are no long-lived keys to steal.
- Set
permissions:to the minimum, withcontents: readas the default.
Why → Tags can be moved to malicious commits; a SHA can't.
Interview tip → "Pin to SHA plus least-privilege permissions:" is the expected prevention answer.
More on Security incidents
An AWS access key for a production IAM user was pushed to a public GitHub repo 20 minutes ago. What do you do in the first 30 minutes?AdvancedYou find pods in your cluster running a crypto miner. What do you do?AdvancedA critical CVE is announced in a library you use. You have 200 images across 40 repos. How do you find and patch everything fast?IntermediateGuardDuty reports an EC2 instance talking to a known command-and-control IP. What do you do?AdvancedYou discover an S3 bucket with customer data has been public for three months. What now?IntermediateAn engineer left the company three weeks ago and you find their access key was used yesterday. How do you respond and fix the process?Beginner