Skip to content
Advisory Intermediate

GHSL-2024-303: Code execution in trusted context via a GitHub Action of Tribler

The GitHub Action checked out an untrusted pull request branch and then installed dependencies from that branch's requirements file, allowing a malicious PR author to execute arbitrary code in the runner. This could let an attacker modify repository content and exfiltrate secrets such as the GitHub token.

m-y-mo Follow

Originally disclosed on GitHub Security Lab

Checking out of untrusted branch allows code execution in trusted context in the pr-comment-validate Action

m-y-mo, 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 checked out and executed code from an untrusted pull request branch while running with write permissions.

Impact

This could lead to code execution in the runner with write permission, allowing repository content to be modified and secrets such as the GitHub token to be exfiltrated.

What the attacker needed

Ability to open a pull request; workflow runs on pull request

The fix

The issue was fixed by restricting the default permission for the GITHUB_TOKEN to read only.

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 Action is an automated script that runs when something happens on a repository, like a pull request. Here, the action ran code from the pull request itself, so anyone who opened a pull request could run their own commands on the project's servers. That could let them change files or steal secret keys.

More by m-y-mo

View all

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