Skip to content
Write-up Intermediate

Novel Pipeline Vulnerability Discovered; Rust Found Vulnerable

A GitHub Actions workflow in the rust-lang/rustc_codegen_gcc repository downloaded an artifact from another repository without verifying its source, allowing any GitHub user to poison the artifact and execute arbitrary code in a privileged pipeline. This could let an attacker steal secrets, modify repository contents, or tamper with source code.

Noam Dotan Follow

Published on legitsecurity.com

The Legit Security Research Team discovered a new class of software supply chain vulnerabilities that leverages artifact poisoning and attacks the underlying software development pipelines for projects using GitHub Actions. In this fourth blog covering vulnerable GitHub Actions, we will explore this new technique of…

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 artifact download action did not distinguish between artifacts created by forked repositories and the original repository, allowing untrusted artifacts to be used.

Impact

An attacker could execute code in a privileged pipeline, potentially stealing secrets, modifying repository contents, and moving laterally within the organization.

What the attacker needed

GitHub account; ability to fork the repository; ability to create a pull request

The fix

The issue was fixed by the Rust security team after the report.

How it was found

  1. Fork the antoyo/gcc repository.
  2. Modify the main.yml workflow to upload a malicious libgccjit.so artifact.
  3. Create a pull request from the fork to the original repository.
  4. The rust workflow downloads the latest artifact named libgccjit.so from antoyo/gcc, which now includes the malicious one.
  5. The workflow sets environment variables to use the downloaded library, executing the attacker's code.

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 software supply chain attack is when someone sneaks malicious code into a part of the build process. Here, a workflow that builds software downloaded a file from another project without checking who made it, so an attacker could upload a malicious version and have it run with high privileges.