Code exec on Github runner via Pull request name
A GitHub Actions workflow used an untrusted pull request title inside a shell command, allowing an attacker to inject arbitrary commands. An attacker could run commands on the runner and read the repository's access token, potentially compromising the organisation.
Originally disclosed on HackerOne
- Triaged in 6 days
- Fixed in 8 days
- Paid in 8 days
- Disclosed after 9 days
Hi,
I have discovered command injection vulnerability in one of your Github repos.
Apologies for any inconvenience if this type of bug is not of interest to you. Allow me to explain the problem.
GitHub Actions, a powerful tool for automating workflows, can inadvertently introduce security vulnerabilities if not configured securely. Insecure GitHub Actions configuration can lead to various risks, including unauthorized access, data breaches, and code injection attacks.
Currently https://github.com/hyperledger/cacti/tree/HEAD/.github/workflows/test_weaver-pre-release.yaml#L28 allows attacker to inject arbitrary command and run it on the Github runner. Note the usage of double quotes and untrusted pull_request.name.
Steps to reproduce
- Create a new branch within your fork
- Create a pull request with the
U";cat $GITHUB_WORKSPACE/.git/config | xxd -p | base64; echo "Dtitle - config file contains the access token in base64 form
- Wait until
check_releaseworkflow will be triggered - Check job logs for encoded
$GITHUB_TOKEN(by default Github will replace it with *** if you will try just echo it, that is why I used xxd + base64) - I refrained from creating a PR on your repository to prevent the disclosure of sensitive information to the public and to avoid publicly exposing the vulnerability.
Example run could be found in my fork, attached as screenshot.
Impact
Such scenario leaves possibility to access $GITHUB_TOKEN environment variable, potentially compromising the whole GitHub organization.
Good explanation of the problem could be found at github docs: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions
There are few limits to the attack:
$GITHUB_TOKENis a short lived token and for the real life attack, whole attack should be scripted until job is still running
Attachments

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 interpolated the untrusted pull request title directly into a shell command inside double quotes, allowing command injection.
Impact
An attacker could access the $GITHUB_TOKEN environment variable, potentially compromising the whole GitHub organisation, though the token is short-lived and the attack must be scripted to complete before the job ends.
What the attacker needed
Ability to create a fork and pull request; workflow triggered by pull request
How it was found
- Create a new branch in a fork of the repository.
- Create a pull request whose title contains shell metacharacters and commands.
- Wait for the check_release workflow to be triggered.
- Check the job logs for the encoded 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 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, like a pull request. This workflow put the pull request's title directly into a command without cleaning it, so someone could put special characters in the title to make the runner execute extra commands. That let them read a secret token that gives access to the repository.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.