GHSL-2020-282: Unauthorized repository modification or secrets exfiltration in the GitHub workflow of open-telemetry/opentelemetry-ruby
The GitHub workflow used the pull_request_target event and explicitly checked out and ran code from a fork, giving untrusted code access to the base repository's write token and secrets. An attacker could modify the base repository or exfiltrate secrets.
The release-hook-on-open.yml GitHub workflow is 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
Impact
The vulnerability allows for unauthorized modification of the base repository and secrets exfiltration.
What the attacker needed
Ability to open a pull request from a fork
How it was found
- The workflow is triggered by pull_request_target events.
- The workflow checks out the merge ref of the pull request.
- The workflow installs Toys and runs the release _onopen script from the checked-out code.
- The script runs with the GITHUB_TOKEN secret available.
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 Actions workflow can be set to run when someone opens a pull request. The pull_request_target event gives the workflow powerful permissions, like writing to the main repository and reading secrets. If the workflow then checks out and runs code from the pull request, that untrusted code gets those same powers, letting an attacker change the repository or steal secrets.