Skip to content
RCE Write-up Intermediate

Executive Summary

Misconfigured GitHub Actions workflows in several open-source projects allowed command injection through issue titles and comments, enabling attackers to execute arbitrary code on build runners and access privileged tokens. This could lead to supply-chain attacks by committing malicious code or exfiltrating secrets.

cycode.com

Published on cycode.com

The upsurge of supply-chain incidents in recent years highlights the importance of protecting build servers and deployment processes. In the case of GitHub Actions, GitHub has implemented many security features for their hosted runners – isolation, ephemeral environments, golden images, and more.

Alex Ilgayev, on cycode.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

Impact

Attackers could execute arbitrary code on runners, steal secrets, and commit malicious code to repositories, potentially affecting millions of users through supply-chain attacks.

What the attacker needed

Public repository with vulnerable workflow; ability to create issues or comments

The fix

The vulnerabilities were fixed by the maintainers, as indicated by the applied fixes in the listed projects.

How it was found

  1. Create a new issue with a title containing shell metacharacters and commands.
  2. The workflow runs and executes the injected commands on the runner.
  3. Use a reverse shell to interact with the runner.
  4. Extract secrets from environment variables, git config, or temporary files.
  5. Commit malicious code to the repository using the GITHUB_TOKEN.

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.

GitHub Actions is a tool that automatically runs tasks like building code when something happens, such as a new issue being opened. If the workflow puts user-controlled text (like an issue title) directly into a command without cleaning it, an attacker can sneak in extra commands. This lets them run their own code on the build server, potentially stealing secrets or changing the code.

What is RCE?

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

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.