Skip to content
Advisory Intermediate

GHSL-2020-264: Unauthorized repository modification or secrets exfiltration in a GitHub workflow of youan/vant

The GitHub workflow 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 preview.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

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 fixed.

How it was found

  1. A pull request is opened from a fork.
  2. The workflow triggers on pull_request_target.
  3. The workflow checks out the merge ref of the pull request.
  4. The workflow runs the build script from the fork.
  5. The untrusted code can push to the base repository and access 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 runs with extra permissions and secrets, but the workflow here also downloaded and ran code from the pull request, which comes from an untrusted person. That let the attacker's code use those permissions to change the repository or steal secrets.

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

Same bug class and techniques, clearest first.