GHSL-2021-015: Command injection in a2o/snoopy workflow
A GitHub workflow used a pull request branch name directly in a shell command, allowing command injection. An attacker could modify the base repository or exfiltrate secrets if the repository owner assigned a specific label to the pull request.
The code-qa-sonarcloud.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
If the repository owner assigns a '/ci run additional tests' label to a malicious pull request, an attacker could inject commands to modify the base repository or exfiltrate secrets.
What the attacker needed
Attacker opens a pull request; repository owner assigns a specific label
The fix
The issue was resolved, likely by avoiding direct interpolation of the branch name into the shell command.
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 someone opens a pull request. Here, the script took the name of the branch from the pull request and put it directly into a command without checking it. An attacker could name their branch in a way that tricks the script into running extra commands, like stealing secret tokens.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.