Skip to content
Advisory Intermediate

GHSL-2021-1032: Unauthorized repository modification or secrets exfiltration from a Pull Request in Solana GitHub workflow

The Explorer GitHub workflow used pull_request_target and checked out the pull request's head commit, then ran build scripts from that untrusted code. An attacker could open a pull request with a modified package.json to execute arbitrary commands in a context that could push to the base repository and access secrets.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

Explorer GitHub workflow is vulnerable to unauthorized modification of the base repository or secrets exfiltration from a Pull Request.

ghsecuritylab, 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; Pull request modifies explorer/package.json

The fix

The issue was fixed by the maintainers.

How it was found

  1. Create a pull request that modifies explorer/package.json.
  2. The workflow triggers on pull_request_target for changes under explorer/**.
  3. The workflow checks out the pull request's head commit.
  4. The workflow runs npm ci, npm run format, npm run build, and npm run test, executing the modified scripts.

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 trigger runs in a privileged context with access to secrets and write permissions. If the workflow then checks out and runs code from the pull request, an attacker can run their own commands with those privileges.

More by ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.