Skip to content
RCE Advisory Intermediate

GHSL-2020-208: Template injection in a GitHub workflow of SourcePointUSA/android-cmp-app repository

A GitHub workflow used user-controlled issue title and body as input to a third-party action that internally expanded double-curly-brace expressions, allowing an attacker to execute arbitrary code on the GitHub runner and exfiltrate a secret Jira API token.

jarlob Follow

Originally disclosed on GitHub Security Lab

Automatic GitHub workflow in SourcePointUSA/android-cmp-app repository is vulnerable to template injection from user comments.

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

An attacker could execute arbitrary code on the GitHub runner and exfiltrate the secret Jira API token.

What the attacker needed

Ability to create an issue in the repository

The fix

The issue was resolved, likely by updating the workflow to avoid passing untrusted input to the vulnerable action or by using a safe action.

How it was found

  1. Create an issue with a body containing a double-curly-brace expression that executes a command.
  2. The workflow runs and passes the issue body to the vulnerable action.
  3. The action expands the expression, executing the command on the runner.
  4. The command exfiltrates the Jira API token to an attacker-controlled server.
  5. Optionally, modify the issue to 'Never mind my bad' and close it to reduce visibility.

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 new issue. Here, the workflow took the issue's title and body and passed them to a third-party action. That action had a hidden feature: it evaluated anything inside double curly braces as code. So an attacker could write code in an issue and have it run on GitHub's servers, stealing a secret token.

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.