Skip to content
RCE Advisory Intermediate

GHSL-2021-010: Command injection in getsentry/onpremise workflow

A GitHub Actions workflow in the getsentry/onpremise repository inserted the text of a newly opened issue directly into a shell command. An attacker could open an issue whose body contained shell syntax, causing the workflow to run their commands and leak the repository token.

jarlob Follow

Originally disclosed on GitHub Security Lab

The validate-new-issue.yml GitHub workflow is vulnerable to unauthorized modification of the base repository or secrets exfiltration.

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

Root cause

The workflow interpolated untrusted issue body text directly into a shell script instead of passing it as data, so shell metacharacters in the body were executed.

Impact

An attacker could run arbitrary commands in the workflow, modify the base repository and exfiltrate secrets such as the repository token.

What the attacker needed

Ability to open an issue on the repository

The fix

The issue was resolved the day after the report; the workflow should avoid interpolating untrusted issue text into shell commands.

How it was found

  1. Open a new issue on the repository with a title and a body containing shell syntax.
  2. The workflow triggers on the opened issue and runs the bash script.
  3. The issue body is written into the script and the injected command executes.
  4. The command sends the repository token to an attacker-controlled server.

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, such as a new issue being opened. This script pasted the issue's text straight into a command line, so text written by a stranger was treated as commands. That let the stranger make the script send the repository's access token to a server they control.

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.