Skip to content
Advisory Intermediate

GHSL-2021-003: Unauthorized repository modification or secrets exfiltration in GitHub workflows of alisw/alidist and alisw/ali-bot

GitHub workflows triggered on pull_request_target 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 by submitting a malicious pull request.

jarlob Follow

Originally disclosed on GitHub Security Lab

Multiple branches of recipe-checks.yml and pr-check.yml GitHub workflows are 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 workflows used the pull_request_target trigger, which grants write tokens and secrets, and then explicitly checked out and executed code from the untrusted pull request head.

Impact

The vulnerability allows for unauthorized modification of the base repository and secrets exfiltration.

What the attacker needed

Attacker can open a pull request from a fork

The fix

The issues were resolved, but the text does not describe the fix; likely the workflows should avoid 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.

When a GitHub workflow runs on a pull request from a fork, it normally gets no write access and no secrets. But if the workflow uses the pull_request_target trigger and then checks out the fork's code, that code runs with the base repository's privileges. An attacker can then 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.