GHSL-2020-272: Unauthorized repository modification or secrets exfiltration in the GitHub workflow of lampepfl/dotty
The GitHub workflow used pull_request_target but then checked out and ran code from the pull request's fork, giving untrusted code access to the base repository's write token and secrets. An attacker could modify the base repository or exfiltrate secrets.
The scala3doc.yaml 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
The fix
The issue was resolved by the maintainers.
How it was found
- Fork the repository and open a pull request.
- The pull_request_target workflow triggers and checks out the pull request's merge ref.
- The workflow runs the build script from the pull request, executing attacker-controlled code.
- The attacker's code can push to the base repository or read secrets.
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 Actions workflow can be triggered by a pull request from a fork. The pull_request_target event gives the workflow write access to the main repository and access to secrets, but it is supposed to run only trusted code. Here the workflow explicitly fetched and ran code from the fork, so an attacker could run their own code with those privileges.