Skip to content
RCE Advisory Intermediate

GHSL-2020-229: Command injection in allenevans/set-env workflow

A GitHub Actions workflow used a commit message directly in a shell command, allowing an attacker to inject arbitrary commands by crafting a malicious commit message. This could let the attacker exfiltrate secrets, make commits, or subvert the release process.

jarlob Follow

Originally disclosed on GitHub Security Lab

The ‘release.yml’ GitHub workflow is vulnerable to arbitrary 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

The attacker could exfiltrate secret tokens, make arbitrary commits, or subvert the release step, affecting dependent repositories.

What the attacker needed

Ability to create a commit and pull request; pull request must be merged; reviewer does not notice payload

The fix

The workflow should avoid using untrusted commit messages directly in shell commands, for example by passing them through environment variables or sanitising them.

How it was found

  1. Create a commit with a malicious message.
  2. Open a pull request containing that commit.
  3. Get the pull request merged (reviewer may miss the payload).
  4. The workflow runs on push to master and executes the injected 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 Actions workflow is an automated script that runs when something happens, like a push. Here, the workflow took the text of a commit message and pasted it straight into a shell command. An attacker could write a commit message that contains extra shell commands, which would then run with the workflow's permissions.

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.