Skip to content
Misconfiguration Advisory Intermediate

GHSL-2020-372: Unauthorized repository modification or secrets exfiltration in GitHub workflows of 418sec/huntr

The GitHub workflow process-disclosure.yml was triggered on pull_request_target, which gives access to secrets and a write token, but it explicitly checked out and ran code from the pull request fork. An attacker could open a pull request with malicious code to modify the base repository or steal secrets.

jarlob Follow

Originally disclosed on GitHub Security Lab

The process-disclosure.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 the pull_request_target trigger, which grants write permissions and secrets, and then explicitly checked out and executed code from the untrusted pull request fork.

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

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 in a repository, like a pull request. The pull_request_target trigger runs the workflow with powerful permissions (write access and secrets) even for pull requests from strangers. Here, the workflow also downloaded and ran code from the stranger's pull request, so that code could use the powerful permissions to change the repository or steal secrets.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

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.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.