GHSL-2025-038: TOCTOU leading to Potential arbitrary code execution in the GitHub IssueOps Branch Deploy Action
The Branch Deploy Action had a time-of-check time-of-use flaw where an attacker could push a malicious commit after a maintainer approved a deployment but before the action checked the commit, bypassing the safety check because the commit date is attacker-controlled. This could lead to arbitrary code execution in the workflow context and potentially cache poisoning.
TOCTOU (Time of Check Time of Use) .deploy approval bypass if no additional branch protections are enabled.
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 bypass may lead to arbitrary code execution by the attacker in the context of the GitHub workflow, and even with restricted permissions, it allows for cache poisoning that could compromise the repository, its releases, and secrets.
What the attacker needed
Repository uses branch-deploy action; deployments from forks allowed; no branch protection requiring PR approvals; attacker can fork and open PR
The fix
The action was fixed in version 10.4.0 by adding a deployment_confirmation feature.
How it was found
- Fork a repository that uses the branch-deploy action.
- Create a new branch and make a pull request with a change likely to be accepted.
- Modify a script that runs during deployment (e.g., add a malicious command) and commit it locally without pushing.
- Set up a script to monitor for a '.deploy' comment every 0.5 seconds.
- When a maintainer comments '.deploy', the script pushes the malicious commit.
- The commit's date is older than the comment, so the safety check passes and the deployment runs the malicious 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.
This is a race condition in a GitHub Action that lets maintainers deploy pull requests by commenting '.deploy'. An attacker could quickly push a malicious change after the approval comment but before the action checks the commit, and because the commit date can be faked, the safety check passes. This could let the attacker run their own code on the deployment server.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.