Skip to content

fix: check-overrides.js compares severity buckets, not just a flat total - #847

Merged
AnujVishwakarma-src merged 1 commit into
adobe:masterfrom
AnujVishwakarma-src:fix-check-overrides-severity
Sep 21, 2026
Merged

AnujVishwakarma-src merged 1 commit into
adobe:masterfrom
AnujVishwakarma-src:fix-check-overrides-severity

Conversation

@AnujVishwakarma-src

@AnujVishwakarma-src AnujVishwakarma-src commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

bin/check-overrides.js decides whether an override is removable by comparing a single flat sum (critical + high + moderate + low) before and after removal. This misses severity regressions where the total happens to stay flat.

Fix

Compare each severity bucket (critical/high/moderate/low) independently. An override is only reported as removable if no bucket gets worse, regardless of what the flat total does.

Validated

  • Re-ran against the real repo state: tar now correctly reports KEEP ... removing changes: +8 high, -8 moderate instead of the previous false REMOVE.
  • @octokit/rest and @yeoman/conflicter > diff still correctly report KEEP (unchanged behavior for genuine single-direction regressions).
  • npm test: 53/53 pass, lint clean (this script lives in bin/, outside the enforced src/** lint/coverage scope, same as before).
  • Both plain and --markdown output modes checked.

Example:

"overrides": {
"tar": "^7.4.3",
"@octokit/rest": "^20.0.2",
"@yeoman/conflicter": {
"diff": "^8.0.4"
}
},

Override Removal Report

check-overrides.js:219============================================================
check-overrides.js:228 KEEP tar removing adds +21 vulns
check-overrides.js:228 KEEP @octokit/rest removing adds +20 vulns
check-overrides.js:228 KEEP @yeoman/conflicter > diff removing adds +15 vulns

with override : 53 vulnerabilities (7 low, 25 moderate, 20 high, 1 critical)
without override: 53 vulnerabilities (7 low, 17 moderate, 28 high, 1 critical)

Ideally overrride should be there!! ::-->

The old comparison summed critical+high+moderate+low into one number, so a
shift from moderate to high severity (equal counts) looked like zero net
change and got reported as 'safe to remove'. Found on the tar override:
removing it keeps the total at 54 either way, but tar sprawls from 2
consolidated copies to 6 per-consumer ones (cacache/node-gyp/pacote/npm/
yeoman-generator), reintroducing 6 older high-severity hardlink/symlink
path-traversal CVEs that the pinned version was protecting against.

Now compares each severity bucket independently — an override is only
reported removable if no bucket gets worse, regardless of what the flat
total does.
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AnujVishwakarma-src
AnujVishwakarma-src merged commit 678b96c into adobe:master Sep 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant