Repository navigation
fix(audit): do not invent patched versions from <= vulnerable ranges - #13614
EduardoFernandess wants to merge 2 commits into
Conversation
inferPatchedVersions used semver.inc on `<=X.Y.Z` to produce `>=X.Y.(Z+1)`. When no such release exists, audit --fix wrote a caret override like `^4.18.1` that cannot install (ERR_PNPM_NO_MATCHING_VERSION). Only infer patches from exclusive `<X.Y.Z` bounds, which name a real first fixed version. Inclusive `<=` ranges leave patched_versions undefined so auto-fix is skipped. Fixes #12651 Co-authored-by: Cursor <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe audit logic no longer infers patched versions from vulnerable ranges using inclusive ChangesAudit patched version inference
Estimated code review effort: 2 (Simple) | ~10 minutes Assessment against linked issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoFix audit: avoid inventing patched versions from inclusive (<=) vulnerable ranges
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains within the scope of this follow-up review. Reviews (2): Last reviewed commit: "test(audit): update expectations when <=..." | Re-trigger Greptile |
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1. Substring version assertion
|
Inclusive vulnerable ranges no longer invent patched_versions, so refresh audit snapshots and assert auto-fix still works for exclusive bounds. Co-authored-by: Cursor <[email protected]>
|
Code review by qodo was updated up to the latest commit d433b7b |
1 similar comment
|
Code review by qodo was updated up to the latest commit d433b7b |
Summary
Fixes #12651.
inferPatchedVersionsturnedvulnerable_versions: "<=4.18.0"intopatched_versions: ">=4.18.1"viasemver.inc.audit --fix=overridethen wrote^4.18.1. When that patch never existed (only a later major fixed the issue), install failed withERR_PNPM_NO_MATCHING_VERSION.Change
Infer patched ranges only from exclusive upper bounds (
<X.Y.Z). Inclusive<=X.Y.Zno longer invents the next patch;patched_versionsstays undefined and auto-fix is skipped (same as other ranges we cannot map to a fix).Exclusive
<2.0.0→>=2.0.0behavior is unchanged.Test plan
<=4.18.0yields undefinedpatched_versions<2.0.0→>=2.0.0coverage remainsSummary by CodeRabbit
<=4.18.0) no longer infer an incorrect patched version.<X.Y.Z.