Skip to content
RCE Advisory Intermediate

GHSL-2020-369: Arbitrary code execution in nrfconnect/sdk-nrf workflow

The GitHub workflow docbuild.yml was triggered on pull_request_target, which gives access to secrets and write tokens, but it explicitly checked out and ran code from a fork. An attacker could open a pull request from a fork to execute arbitrary code with those privileges, leading to unauthorised modification of the base repository or exfiltration of secrets.

jarlob Follow

Originally disclosed on GitHub Security Lab

The docbuild.yml 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

Root cause

The workflow used pull_request_target (which grants write tokens and secrets) but then explicitly checked out and executed code from the untrusted fork.

What the attacker needed

Attacker can open a pull request from a fork

The fix

The issue was resolved, likely by not running untrusted code with pull_request_target privileges.

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 is an automated script that runs when something happens, like a pull request. The pull_request_target event gives the workflow powerful permissions, including access to secrets and the ability to write to the repository. Here, the workflow checked out and ran code from the pull request itself, so an attacker could put malicious code in their fork and have it executed 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.