Find Comment, Get Shell: Command Injection in dbt’s GitHub Actions
A reusable GitHub Actions workflow used the find-comment action to search for a bot comment but did not verify the comment's author. An attacker could post a matching comment containing shell metacharacters before the legitimate bot comment, causing command injection in the workflow runner and potential exposure of a bot personal access token.
Reusable workflows are supposed to eliminate duplicated automation logic. They can also eliminate any remaining certainty about where your trust boundaries actually are.
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 achieve command execution inside the GitHub Actions runner and potentially expose sensitive credentials such as the FISHTOWN_BOT_PAT, which could be used for authenticated cross-repository GitHub operations.
What the attacker needed
Public GitHub issue matching trigger; ability to comment on the issue; timing before bot comment
The fix
The workflow should validate the comment author and avoid interpolating untrusted workflow data directly into shell commands.
How it was found
- Monitor a public issue that matches the workflow trigger conditions (closed, completed, 'user docs' label).
- Seconds before the issue is closed, post a comment that matches the marker text expected by find-comment and contains a command injection payload.
- The workflow runs find-comment, which retrieves the attacker's comment before the legitimate bot comment.
- The comment body is interpolated into a Bash conditional, breaking out of the quoted expression and executing the injected command.
- The command runs inside the GitHub Actions runner, allowing exfiltration of CI secrets such as the FISHTOWN_BOT_PAT.
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 on GitHub, like an issue being closed. This workflow looked for a comment left by a bot to decide what to do next, but it did not check who wrote the comment. Anyone could post a fake comment with special characters that tricked the script into running their own commands.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.