GHSL-2021-006: Arbitrary code execution in Decathlon/vitamin-web workflow
The GitHub workflow build-pr.yml used pull_request_target and checked out and ran code from a 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 build-pr.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
Root cause
The workflow used the pull_request_target event, which grants write access and secrets, and then explicitly checked out and executed code from the untrusted pull request.
Impact
The vulnerability allows for unauthorized modification of the base repository and secrets exfiltration.
What the attacker needed
Pull request from a fork
The fix
The issue was resolved, likely by not running untrusted code with pull_request_target or by restricting permissions.
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 is an automated script that runs when something happens, like a pull request. This workflow was set to run on pull requests from forks and then ran the fork's code with powerful permissions, so an attacker could use it to change the main project or steal secret keys.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.