Skip to content
RCE Advisory Intermediate

GHSL-2021-046: Command injection in a GitHub workflow of AmazeFileManager

A GitHub workflow used an untrusted pull request branch name to format a shell script, allowing command injection. An attacker could craft a branch name to execute arbitrary commands, potentially modifying the base repository and exfiltrating secrets.

jarlob Follow

Originally disclosed on GitHub Security Lab

The android-debug-artifact-ondemand.yml GitHub workflow is vulnerable to command injection.

jarlob, 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

If an authorised user is tricked into commenting, an attacker could execute arbitrary commands, potentially modifying the base repository and exfiltrating secrets.

What the attacker needed

Attacker can create a pull request from a fork; authorised user comments 'Build test apk'

The fix

The issue was fixed by the maintainers.

How it was found

  1. Create a pull request from a forked repository with a malicious branch name.
  2. Trick one of the authorised users into commenting 'Build test apk' on the pull request.
  3. The workflow runs and the branch name is injected into the shell script, executing arbitrary commands.

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 comment. Here, the workflow took a branch name from a pull request and put it directly into a shell command. Because the branch name can be controlled by an attacker, they could sneak in extra commands that the workflow would run.

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 jarlob

View all

192 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.