Skip to content
Write-up Intermediate

Vulnerable GitHub Actions Workflows Part 2: Actions That Open the Door to CI/CD Pipeline Attacks

A third-party GitHub Action, dawidd6/action-download-artifact, extracts downloaded artifacts into the current working directory by default, overriding existing files. An attacker could exploit this to replace a script that is later executed, leading to privilege escalation in the CI/CD pipeline.

Noam Dotan Follow

Published on legitsecurity.com

In this blog post, we’ll explore a bug we’ve found in a popular third-party action and how in some cases it could lead to your SDLC pipeline being compromised. This post is the 2nd one in the series of Vulnerable GitHub Actions Workflows, following Part 1: Privilege Escalation Inside Your CI/CD Pipeline.

Noam Dotan, on legitsecurity.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The action defaults to extracting artifacts into the current working directory, which allows file overwrite.

Impact

An attacker could escalate privileges in the CI/CD pipeline, potentially stealing secrets and modifying artifacts.

What the attacker needed

Victim uses the action without 'path'; workflow triggered on workflow_run; attacker can fork the repository

How it was found

  1. Fork the vulnerable repository.
  2. Create a pull request that modifies a workflow to upload a malicious artifact.
  3. The workflow_run trigger automatically runs the privileged workflow.
  4. The privileged workflow downloads the malicious artifact without a path, overwriting a script.
  5. The overwritten script is executed, allowing the attacker to steal secrets or modify artifacts.

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 write-up has not been written yet. The Original tab links to the source.

A GitHub Action is a reusable step in a CI/CD pipeline. This action downloads files (artifacts) from another workflow, but if you don't specify a folder, it unpacks them into the current directory and overwrites any files with the same name. An attacker could upload a malicious artifact that replaces a script, and when the workflow runs that script, the attacker's code executes with the workflow's permissions.

More by Noam Dotan

View all

5 more disclosed reports, best first.

Similar reports

Same bug class and techniques, clearest first.