Skip to content
Write-up Advanced

Web3’s Achilles’ Heel: A Supply Chain Attack on Astar Network

A public repository used a non-ephemeral self-hosted GitHub Actions runner that ran workflows on pull requests from forks without approval, letting anyone who could open a pull request execute code on the runner. The researcher used this to obtain a token and replace release binaries for validator nodes, which could have caused loss of funds.

Adnan Khan Follow

Published on adnanthekhan.com

John Stawinski and I have been conducting research and submitting bug bounty reports focusing on a specific type of poisoned pipeline execution attack that I like to refer as “Self-Hosted Runner Takeover”. It manifests when a public repository has an attached non-ephemeral self-hosted runner without requiring approval…

Adnan Khan, on adnanthekhan.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

Likely the repository attached a non-ephemeral self-hosted runner and allowed pull_request workflows from forks to run without approval, so untrusted code executed on a persistent build machine.

Impact

An attacker could modify release binaries for validator nodes and wasm runtimes, which could cause loss of funds; the text notes the release was low priority and runtime-only, and the team removed the binaries shortly after the report.

What the attacker needed

Public repository; self-hosted runner without approval; ability to open a pull request

The fix

The text says the self-hosted runner vulnerability was mitigated by requiring approval for fork pull request workflows.

How it was found

  1. Run a tool against the organisation to find a non-ephemeral self-hosted runner attached to the repository.
  2. Open a pull request with a small typo fix to become a contributor and test whether workflows need approval.
  3. Push a workflow change that runs a script to install another self-hosted runner on the build machine.
  4. Use the new runner access to enumerate the host and find a stored token in bash history.
  5. Place a post-checkout hook that captures the build token and delays the checkout.
  6. Use the stolen token to delete and re-upload release binaries, then submit the report.

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 build runner is a computer that automatically runs jobs when code is pushed or a pull request is opened. Here, that computer was shared and not reset between jobs, and it ran jobs from strangers' pull requests without anyone approving them first. That let an outsider run their own commands on the machine and later swap the official download files for the project's node software.

More by Adnan Khan

View all

4 more disclosed reports, best first.

Similar reports

Same bug class and techniques, clearest first.