GHSL-2021-004: Arbitrary code execution in aeraki workflows
Three GitHub Actions workflows in the aeraki repository were triggered by pull_request_target and explicitly checked out and ran code from the pull request's fork. An attacker could open a pull request from a fork to execute arbitrary code with write access to the base repository and access to secrets.
The e2e-thrift.yaml, e2e-dubbo.yaml and e2e-kafka-zookeeper.yaml GitHub workflows are vulnerable to unauthorized modification of the base repository or secrets exfiltration from a Pull Request.
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 workflows used the pull_request_target event, which grants write tokens and secrets, and then explicitly checked out and executed code from the pull request's fork, running untrusted code in a privileged context.
Impact
The vulnerability allows for unauthorized modification of the base repository and secrets exfiltration.
What the attacker needed
Ability to fork the repository; Ability to open a pull request
The fix
The issue was resolved, likely by changing the workflow trigger or removing the checkout of untrusted code.
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 are automated tasks that run when something happens in a repository, like a pull request. The pull_request_target event gives the workflow powerful permissions and secrets, but if the workflow then checks out and runs code from the pull request's fork, an attacker can run their own code with those permissions. This report shows that three workflows did exactly that, allowing an attacker to modify the main repository or steal secrets.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.