Skip to content
RCE Advisory Intermediate

GHSL-2023-101: Actions command injection in the CI workflow of zcash/zcash

The zcash/zcash repository's GitHub Actions workflow was triggered on pull_request_target and used the fork's branch name directly in a shell command, allowing an attacker to inject arbitrary commands. An attacker could take over the GitHub Runner, steal workflow secrets, and modify the repository.

jorgectf Follow

Originally disclosed on GitHub Security Lab

The zcash/zcash repository is vulnerable to a command injection in Actions, allowing an attacker to take over the contents of the repository and leak secrets.

jorgectf, 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

Impact

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

What the attacker needed

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

The fix

The issue was fixed by a commit that likely removes the untrusted input from the shell command.

How it was found

  1. Fork the zcash/zcash repository.
  2. Create a branch in the fork with a name containing shell metacharacters and a command.
  3. Push any change to that branch.
  4. Create a pull request from that branch to zcash/zcash:master.
  5. Check the workflow runs to see the injected command executed.

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 in a repository, like a new pull request. Here, the workflow used the name of the branch from a fork (a copy of the repository) directly in a command without checking it. Because branch names can contain special characters, an attacker could craft a branch name that makes the command run extra instructions, letting them run their own code on the server that runs the workflow.

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 jorgectf

View all

34 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.