How Dependabot Missing Cooldown Periods Enable Supply Chain Attacks and How to Fix It
Introduction
In this Node.js library, Dependabot was configured to propose updates for three package ecosystems—pip, npm, and GitHub Actions—but a critical detail was missing: no cooldown period. This meant that the moment a new package version was published to PyPI, npm, or the GitHub Actions marketplace, Dependabot would immediately propose updating to it. For a downstream library distributed to other developers, this created a direct attack vector: a malicious actor could publish a weaponized package version and have it automatically adopted within minutes, potentially compromising all consumers of this library.
The vulnerability was detected in .github/dependabot.yml at line 5 (and subsequently at lines 14 and 25 for additional package ecosystems), where three package-ecosystem entries lacked the critical cooldown configuration block. The fix added cooldown: default-days: 7 to each ecosystem, creating a 7-day safety window that aligns with security community best practices.
The Vulnerability Explained
How It Manifests in the Code
The vulnerable configuration looked like this:
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: daily
Notice what's missing: there is no cooldown block. This means Dependabot will propose an update to every new pip package release immediately, with no delay. Similarly, the npm and GitHub Actions configurations (at lines 14 and 25 in the original file) lacked cooldown periods.
Why This Is a Supply Chain Attack Vector
In a typical typosquatting or package injection attack, a malicious actor would:
- Wait for a legitimate package update (e.g., a new version of a popular npm dependency)
- Publish a malicious version with a similar name or compromise an account
- Within minutes, Dependabot automatically proposes the malicious version
- Without human review delay, maintainers might merge the PR thinking it's a routine security update
- The malicious code is now in the library's dependencies and propagates to all downstream consumers
Real-world examples include the eslint-scope package hijacking (2018) and the UAParser.js compromise (2021), where malicious code was published and automatically pulled into projects within hours.
The Real Impact for This Project
Because this is a Node.js library distributed to downstream consumers, the risk is amplified:
- Every time a dependency publishes a new version, Dependabot instantly proposes the update
- The library maintainers might merge during off-hours or without careful review
- The malicious dependency version is now baked into the library's dependency tree
- When developers install this library, they inherit the compromised dependency
- One malicious package affects potentially thousands of downstream projects
The 7-day cooldown doesn't eliminate risk, but it provides a critical window for:
- Security researchers to analyze new package releases
- The community to report suspicious behavior
- Package registries to act on reports and remove malicious packages
- Your team to review security advisories before auto-updating
The Fix
What Changed
The fix added a cooldown block with default-days: 7 to each of the three package-ecosystem entries. Here's the before-and-after for the pip ecosystem (lines 5-8):
Before:
- package-ecosystem: pip
directory: /
schedule:
interval: daily
After:
- package-ecosystem: pip
directory: /
schedule:
interval: daily
cooldown:
default-days: 7
This same pattern was applied to both the npm ecosystem (lines 14-16 in the diff) and the GitHub Actions ecosystem (lines 25-27 in the diff).
How This Solves the Problem
According to GitHub's Dependabot documentation, the cooldown parameter tells Dependabot to wait a specified number of days after a package version is published before proposing an update:
- 7 days is a security industry standard, balancing protection with timely updates
- During this window, security tools and the community analyze new releases
- Malicious packages are typically flagged within days
- Your team has time to review security advisories (CVEs, GitHub Security Advisories, etc.)
- Critical patches can still be deployed manually if needed
The fix applies uniformly across all three package ecosystems (pip, npm, and GitHub Actions), ensuring that no dependency system bypasses the cooldown protection.
Prevention & Best Practices
1. Always Configure Cooldown Periods in Dependabot
Every .github/dependabot.yml file should include:
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: daily
cooldown:
default-days: 7 # Minimum recommended: 3-7 days
The 7-day default aligns with NIST and CISA recommendations for supply chain risk management.
2. Implement Additional Safeguards
Beyond cooldown periods, consider:
- Require Pull Request Review: Set branch protection rules requiring manual approval before merging Dependabot PRs
- Use Vulnerability Scanning: Tools like
npm audit,pip check, and GitHub's Dependency Alert system catch known issues before you merge - Group Related Updates: Use Dependabot's
groupsfeature (already present in this PR for dev dependencies) to batch updates and reduce PR fatigue - Monitor for Typosquatting: Use tools like Socket.dev or Snyk to detect suspicious packages in your dependency tree
3. Detect This Issue with Static Analysis
Semgrep and other SAST tools can automatically flag missing cooldown blocks:
semgrep --config=p/owasp-dependency-check .github/dependabot.yml
Alternatively, use this pattern to detect the vulnerability:
- id: dependabot-missing-cooldown
pattern: |
version: 2
updates:
- package-ecosystem: $ECOSYSTEM
...
schedule:
interval: $INTERVAL
# Missing cooldown block triggers the rule
4. Apply Defense in Depth
- Use signed commits and require signature verification for dependency updates
- Implement Software Bill of Materials (SBOM) generation with tools like CycloneDX
- Enable GitHub's Secret Scanning to catch leaked credentials in dependencies
- Consider dependency pinning for critical production environments
Key Takeaways
-
Dependabot configurations without cooldown periods expose Node.js libraries to instant supply chain attacks: A malicious package can be auto-adopted within minutes, compromising all downstream consumers.
-
The
.github/dependabot.ymlfile is production security infrastructure: Missing thecooldownblock at line 5 (pip), line 14 (npm), and line 25 (GitHub Actions) created three separate attack vectors. -
7-day cooldown periods align with NIST/CISA supply chain security standards: This delay provides the security community time to detect and report malicious packages before your project auto-updates.
-
Dependabot's
cooldownconfiguration requires explicit YAML entry: Unlike some security features that are enabled by default, cooldown periods must be manually configured in eachpackage-ecosystemblock. -
Static analysis tools like Semgrep now detect this vulnerability automatically: Organizations can integrate this check into CI/CD pipelines to prevent future misconfigurations.
How Orbis AppSec Detected This
- Source: GitHub Actions Dependabot configuration file (
.github/dependabot.yml) - Sink:
package-ecosystementries lacking acooldownblock (lines 5, 14, 25) - Missing Control: No delay buffer between package publication and auto-update proposal
- CWE: CWE-1104 (Use of Unmaintained Third Party Components) and CWE-494 (Download of Code Without Integrity Check)
- Fix: Added
cooldown: default-days: 7block to all threepackage-ecosystementries underupdates
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 missing Dependabot cooldown period is a high-severity supply chain vulnerability that can turn a routine dependency update into an attack vector. By adding a 7-day cooldown to each package ecosystem, this Node.js library now protects both itself and its downstream consumers from malicious package adoption.
For teams managing open-source libraries or critical infrastructure, configuring Dependabot cooldown periods is as essential as enabling branch protection rules. Combined with code review requirements, vulnerability scanning, and community monitoring, it forms a robust defense against supply chain attacks.
If you maintain a library or depend on hundreds of packages, audit your .github/dependabot.yml configuration today. Your users are counting on you to update safely.
References
- GitHub Dependabot Configuration Documentation: cooldown
- CWE-1104: Use of Unmaintained Third Party Components
- CWE-494: Download of Code Without Integrity Check
- NIST Software Supply Chain Security Guidance
- OWASP Vulnerable and Outdated Components
- Semgrep Package Managers Rule: dependabot-missing-cooldown
- fix: this dependabot configuration does not set a co... in...