GHSL-2020-249: Unauthorized repository modification or secrets exfiltration in the GitHub workflow of aws/amazon-chime-sdk-js
The GitHub workflow used pull_request_target and explicitly checked out and ran code from a fork, so an attacker could execute arbitrary code with write access to the base repository and access to secrets. This allowed unauthorised repository modification or secrets exfiltration.
The ‘continuous-integration.yml’ GitHub workflow is vulnerable to arbitrary code execution.
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
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 workflow should not check out and run untrusted code from forks in a pull_request_target context; it should use pull_request or avoid executing fork code with write permissions and secrets.
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 workflow is an automated script that runs when something happens, like a pull request. The pull_request_target trigger gives the workflow powerful permissions and secrets, but it is supposed to run only trusted code. Here, the workflow also downloaded and ran code from the pull request itself, which could be written by anyone, so that code got the powerful permissions.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.