GHSL-2025-078: Untrusted pull request code execution in the nf-core/tools snapshot workflow
The update-textual-snapshots.yml workflow could be triggered by any issue comment and then checked out and ran code from the associated pull request. An attacker could therefore execute arbitrary code in the workflow and potentially push commits to the main branch.
Originally disclosed on GitHub Security Lab
The nf-core/tools project was vulnerable in its main version (commit https://github.com/nf-core/tools/commit/75e643ad2c62cdc8ecd39aa56c0c314efd4b13e4) because the update-textual-snapshots.yml workflow could run untrusted code.
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 workflow was triggered by an event any user can cause and then checked out and executed code from an untrusted pull request using a privileged token.
Impact
This could lead to full repository takeover, for example by pushing new commits to the main branch.
What the attacker needed
Ability to open a pull request; ability to comment on an issue
The fix
The workflow should not run untrusted pull request code with a privileged token; a fix was created and later merged.
How it was found
- Create a pull request containing malicious code.
- Add a comment on the issue with the trigger phrase.
- The workflow checks out the pull request code.
- The workflow runs pytest on the checked-out code, executing the attacker's 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.
A GitHub Actions workflow is an automated script that runs when something happens on GitHub. This one ran whenever anyone commented on an issue, and it then downloaded and ran the code from a linked pull request. Because anyone can comment and open a pull request, an outsider could make the workflow run their own code with the project's access.