Skip to content
RCE Advisory Intermediate

GHSL-2020-245: Arbitrary code execution in strimzi/strimzi-ui workflow

The GitHub workflow used pull_request_target but then checked out and ran code from the pull request's fork, giving untrusted code access to the base repository's write token and secrets. An attacker could modify the base repository and exfiltrate secrets.

jarlob Follow

Originally disclosed on GitHub Security Lab

The ‘node-pr-jobs-secure.yml’ GitHub workflow is vulnerable to arbitrary code execution.

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 vulnerability allows for unauthorized modification of the base repository and secrets exfiltration.

What the attacker needed

Ability to fork the repository; ability to open a pull request

The fix

The issue was resolved, likely by not checking out and running untrusted code in a pull_request_target workflow.

How it was found

  1. Fork the repository and create a pull request with malicious code in the build scripts.
  2. The pull_request_target workflow triggers and checks out the fork's branch.
  3. The workflow runs npm ci and npm run build, executing the attacker's code.
  4. The attacker's code can push to the base repository and read secrets.

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 pull request. The pull_request_target trigger is meant to run safely with extra permissions, but here the workflow then downloaded and ran code from the pull request itself, which could be written by anyone. That let an outsider run their own code with the repository's secret keys and write access.

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.