Skip to content
RCE Advisory Intermediate

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.

jorgectf Follow

Originally disclosed on GitHub Security Lab

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.

jorgectf, on GitHub Security Lab

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.

More by jorgectf

View all

34 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.