Leave Em On Read Github Issue Comment Injection
A GitHub Actions workflow used an unsanitised issue comment body directly in a shell command, allowing an attacker to inject arbitrary commands. An attacker could execute code in the CI/CD pipeline by posting a crafted comment.
Published on infosecwriteups.com
Application security isn’t my forte. I’m content to sit in VS Code building scripts or poking around in an Active Directory environment all day, but I just haven’t taken to working with web apps yet.
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
An attacker could execute arbitrary commands in the CI/CD pipeline, potentially leading to further compromise.
What the attacker needed
GitHub account; repository with vulnerable workflow; ability to comment on issues
The fix
The workflow was fixed by moving the untrusted comment body into an environment variable and referencing it safely in the shell script.
How it was found
- Create an issue in the repository.
- Add a comment containing the trigger string and a command.
- Go to the Actions page and observe the workflow run.
- Open the job log to see the command output.
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.
A GitHub Actions workflow is an automated script that runs when something happens, like a new comment on an issue. This workflow took the text of the comment and put it straight into a shell command without cleaning it, so someone could type shell commands in a comment and have them run on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.