Skip to content

security: Add dependency cool down(exclude-newer) option for uv#3472

Closed
christopherwoodall wants to merge 1 commit intoNousResearch:mainfrom
christopherwoodall:dep-cooldown
Closed

security: Add dependency cool down(exclude-newer) option for uv#3472
christopherwoodall wants to merge 1 commit intoNousResearch:mainfrom
christopherwoodall:dep-cooldown

Conversation

@christopherwoodall
Copy link
Copy Markdown
Contributor

@christopherwoodall christopherwoodall commented Mar 28, 2026

What does this PR do?

Implements a 7-day dependency cooldown using uv's exclude-newer feature to prevent installation of newly published packages, giving the PyPI community time to detect and yank compromised versions before they reach our environment.

This addresses the class of supply chain attacks demonstrated by the litellm 1.82.7/1.82.8 credential stealer (BerriAI/litellm#24512) and Trivy compromise (March 2026), where attackers exploit the narrow window between package publication and community detection.

Related Issue

No existing issue - this is a proactive security hardening measure following the pattern established in #2810 (version range pins) and #2812 (lockfile with hashes)

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Added exclude-newer = "7 days" to [tool.uv] section in pyproject.toml

How to Test

  1. Verify the configuration is syntactically correct:
   uv lock --check
  1. Confirm uv respects the cooldown during dependency resolution:
   uv pip compile --dry-run pyproject.toml
  1. Check that packages newer than 7 days are excluded from candidate versions:
   # Should not pull packages released in the last 7 days
   uv pip install --dry-run -e ".[all]"

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Trade-offs

  • Security patches delayed by 7 days: Acceptable for most dependencies; critical zero-days still require manual intervention
  • No impact on existing pins: uv.lock hash verification remains unchanged
  • Zero workflow changes: Applies automatically to all uv operations

References

@teknium1
Copy link
Copy Markdown
Contributor

Thanks @christopherwoodall! Your supply-chain hardening was cherry-picked and merged via #14311 with your authorship preserved.

@alt-glitch alt-glitch added type/security Security vulnerability or hardening P2 Medium — degraded but workaround exists labels Apr 23, 2026
@alt-glitch
Copy link
Copy Markdown
Collaborator

Superseded by #14311 which salvaged this change onto current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants