Skip to content
RCE Advisory Intermediate

GHSL-2020-328: Arbitrary code execution in GoogleCloudPlatform/microservices-demo workflow

The GitHub workflow ci-pr.yaml used pull_request_target and explicitly checked out and ran code from a fork, giving untrusted code access to the base repository's write token and secrets. An attacker could modify the base repository or exfiltrate secrets.

jarlob Follow

Originally disclosed on GitHub Security Lab

The ci-pr.yaml GitHub workflow is vulnerable to unauthorized modification of the base repository or secrets exfiltration from a Pull Request.

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 open a pull request from a fork

The fix

The issue was resolved, but the text does not describe the fix; it should be fixed by not checking out and running untrusted code in a pull_request_target workflow, or by using pull_request without secrets and write permissions.

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 Actions workflow can be set to run when someone opens a pull request. The pull_request_target trigger gives the workflow powerful permissions, like writing to the main repository and reading secrets. Here, the workflow also checked out and ran code from the pull request itself, so an attacker could run their own code with those powerful permissions.

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.