Skip to content
RCE Advisory Intermediate

GHSL-2020-183: Arbitrary command injection in GitHub workflows of Checkstyle

The Checkstyle GitHub workflows used unsanitised Pull Request descriptions and step outputs to format shell commands, allowing an attacker to inject arbitrary commands. This could lead to unauthorised modification of the base repository and exfiltration of secrets.

jarlob Follow

Originally disclosed on GitHub Security Lab

The diffreport.yml and site.yml GitHub workflows are 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

An attacker could execute arbitrary commands, leading to unauthorised modification of the base repository and exfiltration of secrets.

What the attacker needed

Ability to create a Pull Request; Ability to comment on the Pull Request

The fix

The issue was fixed after multiple attempts, with a final fix rolled out on 2021-12-07.

How it was found

  1. Create a Pull Request with a specially crafted description.
  2. Add a comment 'GitHub, generate report' to trigger the workflow.
  3. The workflow runs and executes the injected 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.

GitHub Actions workflows run automated tasks. If a workflow puts user-controlled text directly into a shell command, an attacker can add extra commands. Here, a Pull Request description could contain shell commands that would run on the server, letting the attacker steal secrets or change the repository.

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.