GHSL-2020-176: Template injection in the GitHub workflows of codacy-scalameta repository
GitHub workflows in the codacy-scalameta repository passed issue titles, bodies, and comments into Atlassian Jira actions, which internally expanded double-curly-brace expressions. An attacker could create an issue containing such an expression to execute arbitrary code on the GitHub runner and exfiltrate the Jira API token.
Automatic GitHub workflows in codacy-scalameta repository are vulnerable to template injection from user comments.
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
An attacker could execute arbitrary code on the GitHub runner and exfiltrate the Jira API token.
What the attacker needed
Ability to create an issue or comment
The fix
The issue was fixed by the vendor.
How it was found
- Create an issue whose title or body contains a double-curly-brace expression.
- The workflow passes the issue title or body to the Jira create or comment action.
- The action evaluates the expression as Node.js code on the GitHub runner.
- The code can read the Jira credentials file and send it to an attacker-controlled server.
- The attacker may then edit the issue body and close it to reduce visibility.
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.
When a GitHub workflow runs, it can use text from issues or comments as input to other tools. Here, the Jira action treated that text as a template and evaluated anything inside double curly braces as code. That let an attacker run commands on the workflow machine and steal a stored secret.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.