Skip to content
RCE Advisory Intermediate

GHSL-2020-240: Command injection in scikit-learn/scikit-learn workflow

The GitHub workflow used the forked branch name directly in a shell command, allowing command injection. An attacker could exfiltrate the temporary GitHub token and potentially modify the repository.

jarlob Follow

Originally disclosed on GitHub Security Lab

The ‘syncpullrequest.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 injection could exfiltrate the temporary GitHub token to an attacker-controlled server, and the attacker could delay the workflow to give the server time to modify the repository.

What the attacker needed

Attacker can create a pull request; authorised person assigns 'ci sync' label

The fix

The issue was resolved.

How it was found

  1. Create a pull request from a branch with a malicious name.
  2. Trick an authorised person into assigning the 'ci sync' label to the pull request.
  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.

A GitHub workflow is an automated script that runs when something happens, like adding a label to a pull request. Here, the branch name from a pull request was inserted into a shell command without checking it, so a malicious branch name could run extra commands. This let an attacker steal a temporary access token and possibly 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.