GHSL-2023-108: GitHub Actions command injection in Stash
The Stash repository's GitHub Actions workflow e2e.yml is triggered by issue comments and directly interpolates the comment body into a shell command, allowing an attacker to inject arbitrary commands. An attacker could take over the GitHub Runner to run custom commands, potentially stealing workflow secrets and modifying the repository.
The e2e.yml workflow is triggered on issuecomment [created] (i.e., when a when a comment inside an Issue or Pull Request is created). The workflow starts with full write-permissions GitHub repository token since the default workflow permissions on Organization/Repository level are set to read-write.
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
This issue may lead to stealing workflow secrets and modification of the repository.
What the attacker needed
Ability to comment on a pull request
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.
GitHub Actions is a tool that runs automated tasks when something happens on GitHub, like a comment. In this case, the workflow took the text of a comment and put it directly into a command without checking it. That means someone could write a comment that includes extra commands, and those commands would run on the server that handles the workflow.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.