GHSL-2020-270: Unauthorized repository modification or secrets exfiltration in a GitHub workflow of ant-design-colorful
The GitHub workflow used the pull_request_target event, which gives access to secrets and a write token, but then checked out and ran code from the pull request's fork. An attacker could open a pull request with malicious code to modify the base repository or steal secrets.
The preview.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
Attacker can open a pull request from a fork
The fix
The issue was resolved, but the text does not describe the fix; it should be fixed by not running untrusted fork code in a pull_request_target workflow, for example by using pull_request instead or by avoiding checkout of the fork's 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 is meant to let workflows safely interact with pull requests from strangers, but it gives the workflow powerful permissions. Here, the workflow also downloaded and ran the stranger's code, so that code could use those permissions to change the project or steal secret keys.