Skip to content
Advisory Advanced

GHSL-2024-121_GHSL-2024-122: Actions expression injection in Ant-Design

Two GitHub Actions workflows in the Ant-Design repository downloaded artifacts whose contents were controlled by a pull request author, then inserted that content into a script and a shell command. An attacker could therefore run their own code on the runner with elevated privileges, potentially stealing workflow secrets and altering the repository.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

Ant-Design is vulnerable to Actions expression injection allowing an attacker to alter the repository and steal secrets.

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

Likely the workflows treated artifact contents from an untrusted pull request as trusted input and interpolated them directly into a github-script body and a shell run step, so the data was executed as code.

Impact

This may lead to stealing workflow secrets and modification of the repository.

What the attacker needed

Ability to open a pull request; workflow_run trigger on build workflow

The fix

The issues were fixed by merged pull requests that stopped the untrusted artifact content from being interpolated into executable steps.

How it was found

  1. Open a pull request that modifies the build workflow so the uploaded artifact contains arbitrary content.
  2. The build workflow runs and stores the attacker-controlled artifact.
  3. The finish workflow triggers on workflow_run and downloads that artifact.
  4. The artifact content is saved into a step output variable.
  5. The variable is interpolated into the github-script or run step, executing attacker code with elevated privileges.

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 are automated jobs that run when something happens in a repository, such as a pull request. These jobs can pass small pieces of text between each other, and here the project trusted text that came from an outside contributor without checking it, so that text was treated as part of the job's own instructions. That let an outsider make the job run their commands instead.

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.