How Dependabot Missing Cooldown Periods Happen in GitHub Actions and How to Fix It
The Supply Chain Risk You Didn't Know You Had
In modern software development, dependency management is automated—and for good reason. Tools like Dependabot scan for outdated packages and automatically propose updates. But this convenience comes with a hidden risk: what if that "new" package version was published just minutes ago and contains malicious code?
This is exactly the vulnerability discovered in a Node.js library's .github/dependabot.yml configuration. The repository had Dependabot enabled to automatically track npm package updates, but it was missing a critical safety mechanism: a cooldown period. This meant that the moment a new package version was published to npm, Dependabot could propose it for immediate adoption—before the community had time to identify and report malicious or unstable releases.
Understanding the Vulnerability
What's the Problem?
The vulnerable .github/dependabot.yml configuration looked like this:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
# Missing cooldown block here!
commit-message:
prefix: "chore(deps)"
Notice what's missing? There's no cooldown block. This means Dependabot operates on a hair-trigger: the instant a package maintainer publishes a new version to npm, Dependabot sees it and immediately proposes pulling it into your repository.
Why Is This Dangerous?
Consider this real-world attack scenario:
- Day 1, 2:00 PM: A malicious actor compromises a legitimate npm package (or publishes a typosquatted package with a similar name).
- Day 1, 2:15 PM: The malicious version is live on npm.
- Day 1, 2:30 PM: Dependabot detects the new version and opens a pull request proposing the update.
- Day 1, 3:00 PM: Your CI/CD pipeline runs tests, but the malicious code is subtle—it only exfiltrates data on production deployments, not in test environments.
- Day 1, 3:30 PM: A developer, trusting Dependabot and seeing the tests pass, merges the PR.
- Day 1, 4:00 PM: Your production system is compromised.
This isn't theoretical. The npm ecosystem has seen multiple high-profile supply chain attacks where malicious packages were published and pulled into thousands of projects before being detected.
The Real-World Impact for Node.js Libraries
This vulnerability is especially critical for Node.js libraries because vulnerabilities cascade downstream. If your library depends on a compromised package, then every application that uses your library is also at risk. You're not just protecting your own code—you're protecting everyone who depends on you.
The PR flagged this as a HIGH severity issue specifically because this is a library that affects downstream consumers. The attack surface is multiplied by the number of projects using this library.
The Fix in Detail
The fix is elegantly simple but incredibly effective. The corrected .github/dependabot.yml now includes:
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
commit-message:
prefix: "chore(deps)"
What Changed?
Two lines were added (lines 9-10 in the diff):
schedule:
interval: "weekly"
+ cooldown:
+ default-days: 7
How Does This Solve the Problem?
The cooldown block with default-days: 7 tells Dependabot: "Even if a new package version is published, don't propose it for 7 days."
This 7-day window is critical because:
- The community has time to test: If a package is malicious or critically broken, security researchers, package maintainers, and thousands of developers will discover and report it within 7 days.
- The npm security team can respond: npm's security team monitors for compromised packages and can yank malicious versions or warn users.
- Your team has intelligence: By day 7, there will likely be GitHub issues, security advisories, or npm warnings if something is wrong with the package.
- You maintain control: Dependabot won't automatically pull in risky updates. Your team can review the update proposal with full context of any known issues.
Prevention & Best Practices
For Your Dependabot Configuration
-
Always set a cooldown period: The recommended minimum is 7 days for npm packages. For critical infrastructure, consider 14 days.
-
Differentiate by package type: You might use different cooldown periods for different package ecosystems:
```yaml
updates:- package-ecosystem: "npm"
cooldown:
default-days: 7 - package-ecosystem: "pip"
cooldown:
default-days: 14 # More conservative for Python
```
- package-ecosystem: "npm"
-
Combine with other controls:
- Enable Dependabot security updates to still get critical patches immediately
- Use branch protection rules to require manual approval for Dependabot PRs
- Implement automated security scanning (SAST/SCA) on all dependency updates
Detection and Monitoring
Use these tools to catch missing cooldown configurations:
- Semgrep: The rule
package_managers.dependabot.dependabot-missing-cooldown.dependabot-missing-cooldownautomatically detects this pattern - GitHub's native scanning: Check
.github/dependabot.ymlduring code review - Orbis AppSec: Automatically scans configuration files for security gaps
Security Standards
This vulnerability maps to:
- CWE-494: Download of Code Without Integrity Check
- OWASP Top 10 2021 - A08:2021 – Software and Data Integrity Failures: Specifically, the risk of using untrusted package sources without verification
- SLSA Framework: This fix improves your supply chain security level by adding a verification delay
Key Takeaways
-
Dependabot's speed is a feature, not a guarantee of safety: Just because a package is new doesn't mean it's safe. A 7-day cooldown gives the community time to vet releases.
-
The
.github/dependabot.ymlfile is security-critical: This configuration file controls what code enters your repository. Treat it with the same rigor as your authentication logic. -
Node.js libraries have multiplied impact: A compromised dependency in your library affects every downstream consumer. The 7-day delay protects your entire ecosystem.
-
Cooldown periods don't block security updates: Dependabot still proposes critical security patches immediately. The cooldown only applies to regular version updates.
-
This is a configuration gap, not a code vulnerability: Unlike a buffer overflow or SQL injection, this is a missing security setting. It's easy to miss during initial setup, but equally easy to fix.
How Orbis AppSec Detected This
Source: The .github/dependabot.yml configuration file at line 5, specifically the updates section for the npm package-ecosystem entry.
Sink: The missing cooldown block that should prevent immediate package adoption after publication.
Missing control: No delay mechanism between package publication and Dependabot update proposals; no validation that newly published packages have been vetted by the community.
CWE: CWE-494 - Download of Code Without Integrity Check. This CWE specifically covers scenarios where code is downloaded and used without verification mechanisms to ensure it hasn't been tampered with or is malicious.
Fix: Added a cooldown block with default-days: 7 to the npm package-ecosystem entry in .github/dependabot.yml, creating a mandatory 7-day delay before Dependabot proposes updates to newly published package versions.
Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.
Conclusion
The absence of a Dependabot cooldown period is a subtle but serious supply chain vulnerability. In an ecosystem where malicious packages can be published and adopted within minutes, a 7-day delay is a cost-effective, low-friction security control that protects both your codebase and every project that depends on your library.
The fix required just two lines of YAML configuration—a reminder that sometimes the most impactful security improvements are the simplest ones. By implementing this change, you're not just protecting your code; you're contributing to a more secure software supply chain for the entire community.
Start securing your dependencies today: Review your .github/dependabot.yml file and ensure all package-ecosystem entries include a cooldown block. Your future self (and your downstream users) will thank you.
References
- CWE-494: Download of Code Without Integrity Check — https://cwe.mitre.org/data/definitions/494.html
- GitHub Dependabot Configuration Options — https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#cooldown
- OWASP Software Supply Chain Security — https://owasp.org/www-community/attacks/Supply_Chain_Attack
- npm Security Best Practices — https://docs.npmjs.com/policies/security
- Semgrep Rule: Dependabot Missing Cooldown — https://semgrep.dev/r?q=dependabot-missing-cooldown
- GitHub PR: fix: this dependabot configuration does not set a co... in... — fix: this dependabot configuration does not set a co... in...