How a Single Mistyped Operator in GitHub Actions Triggered a $2,500 CI/CD Meltdown
A timing bug in GitHub Actions Runner's wait logic used an equality check on a seconds counter, which could be skipped due to CPU scheduling delays, causing an infinite loop. An attacker could trigger this to make a workflow run for hours, incurring large compute costs.
blog.stackademic.com
Published on blog.stackademic.com
In 2022, a three-line change inside GitHub Actions Runner introduced a timing bug so subtle, so innocent-looking, and so easy to overlook that it silently slipped through code review, shipped to production, survived for two full years, and ultimately cost developers thousands of dollars in wasted compute bills.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the use of an equality comparison against a time counter that can skip values due to scheduling delays, instead of a boundary check.
What the attacker needed
GitHub Actions workflow with sleep; CPU contention causing timer jump
The fix
GitHub rewrote the wait logic to use native sleep, ping-based timeouts, and a loop with a less-than condition instead of equality.
How it was found
- A user runs a GitHub Actions workflow with a sleep command.
- The runner's fallback wait logic uses a loop that checks if the seconds counter equals the target.
- Due to CPU contention, the counter jumps past the target value.
- The loop never terminates, causing the workflow to run for hours.
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 write-up has not been written yet. The Original tab links to the source.
A wait command in GitHub Actions was supposed to pause for a few seconds, but it used a check that could miss the exact second it was waiting for. If the computer was busy, the timer could jump past that second, so the loop never stopped. This made the workflow run for hours and cost the user a lot of money.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.