GHSL-2024-031_GHSL-2024-032: unauthorized repository modification or secrets exfiltration in Actions workflows of fabric.js
Two GitHub Actions workflows in fabric.js were insecure: one checked out and ran untrusted pull request code with write permissions, and another injected the pull request title into a JavaScript script. An attacker could exploit these to modify the repository or exfiltrate secrets.
Originally disclosed on GitHub Security Lab
Insecure usage of pullrequesttarget and PR title make fabric.js repository vulnerable to an unauthorized repository modification or secrets exfiltration.
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
Running untrusted code with a privileged repository token and access to secrets may lead to an unauthorized repository modification or exfiltration of the secrets.
What the attacker needed
Ability to open a pull request
The fix
The vulnerable workflow was removed.
How it was found
- Clone the repository.
- Edit package.json to replace the build script with a command that contacts an attacker-controlled server.
- Create a new branch and commit the change.
- Open a pull request.
- The workflow triggers and runs the malicious build script, sending a request to the attacker's server.
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. If these tasks run code from an untrusted source with too many permissions, an attacker can take over the repository or steal secret keys. Here, two workflows did exactly that.