GHSL-2020-281: Unauthorized repository modification or secrets exfiltration in the GitHub workflow of tskit-dev/msprime
The GitHub workflow used pull_request_target but explicitly checked out and ran code from a fork, so untrusted code ran with a read/write token and access to secrets. An attacker could modify the base repository or exfiltrate secrets.
The docs.yml GitHub workflow is vulnerable to unauthorized modification of the base repository or secrets exfiltration from a Pull Request.
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
The vulnerability allows for unauthorized modification of the base repository and secrets exfiltration.
What the attacker needed
Ability to open a pull request from a fork
How it was found
- A pull request is opened from a fork.
- The pull_request_target workflow triggers.
- The workflow checks out the fork's code using the head ref and repository.
- The workflow runs build commands on that untrusted code.
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.
A GitHub workflow is an automated script that runs when something happens, like a pull request. The pull_request_target trigger gives that script powerful permissions and secrets, but it is supposed to run only trusted code from the main repository. Here the workflow also downloaded and ran code from the pull request, so an outsider could make the script do harmful things.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.