GHSL-2026-167: TOCTOU in the MongoDB JS BSON release notes workflow
The releasenotes workflow checks out a mutable pull request ref after a maintainer authorizes a run. An external contributor can exploit this race condition to execute code with a write-scoped GITHUBTOKEN.
Other sources
The releasenotes workflow authorizes a maintainer to trigger a run, but does not bind that authorization to the commit that the maintainer reviewed. It subsequently checks out the mutable refs/pull/<number>/head ref and executes files from that checkout. An external pull request author can update the ref after the maintainer’s decision and have attacker-controlled code execute in a job whose GITHUBTOKEN has contents: write and pull-requests: write permissions.
— GitHub Security Lab
Affected Software
Event History
Frequently Asked Questions
Who can exploit this workflow?
An external contributor with a pull request is the relevant attacker. They can change the mutable pull request ref after a maintainer authorizes the workflow run.
What level of access could successful exploitation provide?
The attacker could execute code using a write-scoped GITHUB_TOKEN, giving the workflow code write-level repository token permissions.
Does exploitation require maintainer interaction?
Yes. The workflow must first be authorized by a maintainer before the contributor can exploit the race by changing the pull request ref.