Skip to content
Advisory Intermediate

GHSL-2024-254: Poisoned Pipeline Execution (PPE) in Amplification leading to potential acccount takeover

The pr-labeler.yml workflow used pull_request_target and checked out the attacker's pull request code, then ran bun install, allowing arbitrary code execution. An attacker could execute commands with full write permissions, potentially taking over the repository.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

Amplification is vulnerable to Poisoned Pipeline Execution (PPE) allowing malicious actors to take over the repository.

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 pull_request_target event and checked out the attacker-controlled pull request code, then executed bun install, which runs scripts from package.json.

Impact

This issue may lead to full repository take over.

What the attacker needed

GitHub account; Ability to create a pull request

The fix

The issue was fixed by commits 32b704d and 4395bb9.

How it was found

  1. Install the gh CLI tool.
  2. Clone the amplication/amplication repository.
  3. Create a new branch named poc.
  4. Modify package.json to include a preinstall script with arbitrary commands.
  5. Commit the changes and create a pull request using gh pr create.
  6. Observe the workflow run and the output of the Install Dependencies step.

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 Actions workflow is a set of automated steps that run when something happens, like a pull request. Here, the workflow ran code from the pull request itself, so an attacker could include a script that runs commands on the server. Because the workflow had write access to the repository, the attacker could change code or settings.

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.