Skip to content
Advisory Intermediate

GHSL-2024-168: Poisoned Pipeline Execution (PPE) in Stencil's pack-and-comment.yml and tech-debt-burndown.yml

The pack-and-comment.yml and tech-debt-burndown.yml workflows use the privileged pull_request_target trigger but then check out and execute code from the pull request. An attacker could open a pull request that modifies a local action to run malicious commands with a high-privileged token, potentially taking over the repository.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

Stencil’s pack-and-comment.yml and tech-debt-burndown.yml workflows are vulnerable to Poisoned Pipeline Execution (PPE).

pwntester, 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 privileged pull_request_target trigger but then checked out and executed untrusted code from the pull request.

Impact

This issue may lead to a repository takeover.

What the attacker needed

Ability to open a pull request

The fix

The issue was fixed.

How it was found

  1. Open a pull request that modifies the local action file get-core-dependencies/action.yml.
  2. The pack-and-comment.yml workflow triggers on pull_request_target.
  3. The workflow checks out the pull request's code.
  4. The workflow runs the modified local action, executing the attacker's commands with a high-privileged token.

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.

GitHub Actions workflows can run automatically when someone opens a pull request. Some triggers, like pull_request_target, give the workflow access to secrets and a powerful token. Here, the workflow checked out the pull request's code and then ran a script from that code, so an attacker could make the script do harmful things with that token.

More by Alvaro Muñoz

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.