Security Breach in Stripe Repo: A Deep Dive into the "Pwn Request" Vulnerability
A public Stripe repository had GitHub Actions workflows triggered by pull_request_target that checked out code from untrusted forks, allowing a researcher to run malicious code with access to the repository's GitHub token. The researcher used the token to merge unauthorised commits into the main branch and later exfiltrated the token to a remote server.
stepsecurity.io
Published on stepsecurity.io
The Vulnerability in Stripe’s GitHub Actions Workflow Shows Why Securing CI/CD Pipelines Is Essential
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The workflow used the privileged pull_request_target trigger but then checked out and ran code from an explicit ref belonging to an untrusted fork, without limiting token scope or requiring approval.
Impact
An attacker could run arbitrary code in the CI/CD pipeline, steal CI/CD credentials such as the GitHub token, and merge unauthorised changes, potentially leading to supply chain compromise.
What the attacker needed
Public repository with vulnerable workflow; ability to fork and open a pull request; workflow triggered by pull_request_target
The fix
Workflows should avoid running untrusted code with privileged triggers, limit token permissions, and enforce strict branch protection; the text does not state that the issue was fixed.
How it was found
- Fork the Stripe repository and submit a pull request containing malicious code.
- The pull_request_target workflow runs the researcher's code with access to the repository's GitHub token.
- Export the GitHub token from the workflow environment.
- Use the token to merge the pull request into the main branch.
- Create another pull request that exfiltrates the token to a remote server using wget.
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 write-up has not been written yet. The Original tab links to the source.
GitHub Actions are automated tasks that run when something happens in a code repository, such as a pull request. A 'pwn request' happens when a workflow is set to run on pull requests from anyone and then runs code from that pull request with powerful permissions, like access to secret tokens. Here, that let an outsider run their own code inside Stripe's automation and steal a token that could merge changes.