GHSL-2020-278: Unauthorized repository modification or secrets exfiltration in the GitHub workflow of stm32-rs/stm32-rs
The GitHub workflow used pull_request_target 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 mmapspr.yaml 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 fork the repository; ability to open a pull request
The fix
The issue was resolved, likely by not running untrusted code with pull_request_target or by restricting permissions.
How it was found
- Fork the repository and create a pull request with malicious changes.
- The workflow triggers on pull_request_target and checks out the pull request code.
- The workflow runs the build script from the pull request, which can execute arbitrary commands.
- The malicious code uses the workflow's token to push to the base repository or reads 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 Actions workflow can run automatically when someone opens a pull request. This workflow used a setting that gives the workflow powerful permissions, but then it ran code from the pull request itself. That meant an attacker could submit a pull request with malicious code and have it run with those powerful permissions.