GHSL-2024-281: Actions expression injection in Ant-design-web3
A GitHub Actions workflow interpolated an attacker-controlled artifact value directly into a shell command, allowing command injection. An attacker could run arbitrary commands in the workflow, steal the SURGE_TOKEN secret and use the write-scoped GITHUB_TOKEN to approve pull requests.
Ant-design-web3 is vulnerable to Actions expression injection allowing an attacker to alter the repository and steal secrets.
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
The workflow placed an untrusted artifact value into a shell command via expression interpolation instead of passing it through an environment variable.
Impact
An attacker could steal the SURGE_TOKEN secret and, because the workflow has write permissions, approve other pull requests.
What the attacker needed
Ability to open a pull request; workflow_run trigger on pull_request completion
How it was found
- Open a pull request that modifies the preview-build workflow to write arbitrary content into the pr-id.txt artifact.
- Wait for the Preview Build workflow to complete and trigger preview-deploy.yml.
- The deploy workflow downloads the artifact and saves its contents as a step output.
- The output is interpolated into the surge upload command, executing the injected commands.
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 workflows are scripts that run automatically on GitHub. Here, a value taken from a file uploaded by a pull request was pasted straight into a shell command, so a malicious pull request could make the workflow run extra commands. That let the attacker read a stored secret and use the workflow's permissions to approve other pull requests.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.