Skip to content
RCE Advisory Intermediate

GHSL-2024-148_GHSL-2024-149: Code Injection and Execution of Untrusted Code in Astro's Actions workflows

The Astro repository's benchmark workflow allowed code injection through a comment command and execution of untrusted pull request code, enabling an attacker to steal a Vercel token and poison the build cache.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

Astro contains Actions workflows that are vulnerable to Code Injection and Execution of Untrusted Code which could be leverage to steal secrets and poison the cache.

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 workflow inserted untrusted comment text directly into a shell command and also ran package installation on untrusted pull request code without isolation.

Impact

This could leak the TURBO_TOKEN secret and allow cache poisoning, potentially affecting other workflows.

What the attacker needed

A GitHub account; ability to open a pull request; comment on the pull request

The fix

The workflow was fixed by restricting the benchmark command to allowed characters.

How it was found

  1. Create a pull request in the Astro organisation.
  2. Add a comment containing the magic word and a command to the pull request.
  3. The workflow runs the command on the runner, which contacts the attacker's server.

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 an automated script that runs when something happens on GitHub, like a new comment. Here, a comment containing a special word could make the workflow run a command chosen by the commenter, and a pull request could include code that runs automatically. This let an outsider run their own commands on the project's build system and potentially steal a secret token.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

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

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.