Skip to content
RCE Advisory Intermediate

GHSL-2026-199: Code execution in DataDog/trivy API Diff Check workflow

The API Diff Check workflow runs on pull_request_target, checks out the pull request merge ref, and then invokes a local composite action from that checkout. An external pull request author can modify that action to execute arbitrary code in the privileged base-repository workflow and steal the ORG_REPO_TOKEN secret.

jarlob Follow

Originally disclosed on GitHub Security Lab

The API Diff Check workflow runs on pullrequesttarget, checks out a pull request’s merge ref, and then invokes the checkout-relative ./.github/actions/setup-go composite action. An external pull request author can modify that local action and execute arbitrary code in the privileged base-repository workflow.

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 runs with base-repository privileges) but then checked out and executed a local action from the untrusted pull request tree.

Impact

An unaffiliated contributor could execute arbitrary commands in a privileged job, use the GITHUB_TOKEN to modify issues and pull requests, and gain access to whatever the ORG_REPO_TOKEN allows, depending on its scopes.

What the attacker needed

Ability to open a pull request from a fork; pull request changes a Go file under pkg/ or rpc/

The fix

The workflow was deleted after the report was accepted.

How it was found

  1. Open a pull request that changes a Go file under pkg/ or rpc/.
  2. Modify the local setup-go composite action in the pull request to add arbitrary shell steps.
  3. The workflow checks out the pull request merge ref and invokes the modified local action.
  4. The injected code runs in the privileged job and can read the job token and the ORG_REPO_TOKEN secret.

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 in a repository, such as a pull request. This workflow was set up to run with extra permissions when an outside person opened a pull request, and it then ran a setup script taken from that person's own copy of the code. That let the outsider run their own commands with the repository's permissions and read a secret token.

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.