GHSL-2024-314: Poisoned Pipeline Execution (PPE) in AWS Karpenter Provider
The GitHub Actions workflows in the AWS Karpenter Provider repository were vulnerable to Poisoned Pipeline Execution because they checked out and executed attacker-controlled code from a pull request. An attacker could exploit this to obtain short-lived AWS credentials and potentially access sensitive resources such as Docker Hub credentials or release roles.
Originally disclosed on GitHub Security Lab
aws/karpenter-provider-aws repository is vulnerable to Poisoned Pipeline Execution (PPE) which may lead to AWS Key exfiltration
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could obtain short-lived AWS credentials for roles such as GithubSnapshot, GithubActionsRole, GithubReadOnly, and GithubRelease, potentially allowing access to Docker Hub credentials and the ability to publish new releases, though the exact permissions were not evaluated.
What the attacker needed
GitHub account; Ability to submit a pull request; Ability to submit a pull request review
How it was found
- Submit a pull request to the repository.
- Submit a pull request review containing a magic word (e.g., 'scale', 'snapshot', 'versionCompatibility') to trigger the ApprovalComment workflow.
- The ApprovalComment workflow uploads an artifact containing the review body, PR number, and commit SHA.
- The vulnerable workflow (e.g., snapshot-pr, e2e-scale-trigger) downloads the artifact and extracts the PR commit SHA.
- The workflow checks out the attacker-controlled commit and executes code (e.g., via `make snapshot` or local actions).
- The attacker's code runs with the workflow's permissions, including `id-token: write`, allowing it to request AWS credentials.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
GitHub Actions is a system that runs automated tasks (workflows) when something happens, like a pull request. If a workflow runs code from an untrusted pull request, an attacker can sneak in malicious commands. Here, the workflows ran code from a pull request and then used special permissions to get temporary cloud credentials, which could let the attacker access sensitive systems.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.