Skip to content
RCE Advisory Intermediate

GHSL-2020-233: Command injection in ONSdigital workflows

A GitHub Actions workflow took the text of an issue comment and inserted it directly into a shell command, so a commenter could run their own commands on the runner. This could let an attacker send the workflow's secret tokens to a server they control.

jarlob Follow

Originally disclosed on GitHub Security Lab

The ‘comment.yml’ and main.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 run arbitrary commands on the workflow runner and may exfiltrate secret tokens to a server they control.

What the attacker needed

Ability to comment on an issue; workflow triggered by issue comments

The fix

The issue was resolved according to the disclosure timeline.

How it was found

  1. Post an issue comment whose text starts with the expected deploy keyword followed by shell metacharacters and an extra command.
  2. The workflow runs and inserts the comment text into the shell command.
  3. The extra command executes on the runner, as shown by the test output appearing in the log.

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 are automated jobs that run when something happens on a repository, such as a new comment. Here the job pasted the comment text straight into a command line, so characters like a closing bracket and a semicolon let a commenter end the intended command and start their own. The job runs with secret tokens available, so those secrets could be stolen.

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.