Skip to content

fix(deps): clear 34 trivy findings in the lockfile - #317

Merged
rohit-sourcefuse merged 1 commit into
masterfrom
GH-316
Nov 20, 2026
Merged

rohit-sourcefuse merged 1 commit into
masterfrom
GH-316

Conversation

@piyushsinghgaur1

Copy link
Copy Markdown
Contributor

Description

This clears the 34 open Trivy findings in package-lock.json. Three are critical. The rest are high or medium. The change is a lockfile update plus two overrides lines in package.json. No source code changes.

Most packages move within their existing semver ranges, so the dependencies in package.json stay as they are. Two packages need an override, because something pins them below the fixed version:

  • qs is overridden to ^6.16.1. Express 4 and body-parser pin qs to 6.15.x, so an in-range update can't reach the fix.
  • minimatch@>=10 is overridden to ^11.0.1. Only the copies that ask for ^10 move. Copies that ask for ^9 or ^3 keep their versions.

The other packages are updated in range with npm update --package-lock-only. Fixed versions:

Package Fixed in
fast-uri 3.1.9
handlebars 4.7.10
proxy-addr 2.0.8
js-yaml 4.3.2 (3.15.2 for the 3.x copies)
msgpack5 6.1.0
undici 6.29.1
body-parser 1.20.9 (2.4.0 for the 2.x copy)
brace-expansion 1.1.22, 2.1.8, 5.0.13
qs 6.17.1
minimatch 11.0.9

I tried minimatch@>=7 first. It also moved the root minimatch 9.0.9 that mocha, typescript-estree and rimraf use. That created new nested copies and more drift, so I narrowed the override to >=10.

Not covered

  • uuid 8.3.2 is still flagged. It comes in through hyperid and @loopback/context, and it wasn't in the 34 findings this PR targets. I left it alone. It can be a follow-up if you want it in scope.
  • The npm copies bundled under semantic-release/npm (brace-expansion 5.0.7, minimatch 10.2.5, undici 6.27.0) are dev-only, and an override can't reach them. They stay as they are.

Fixes #316

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

How Has This Been Tested ?

  • npx npm@10 ci --ignore-scripts installs cleanly. I used npm 10 on purpose, because npm 11 lockfiles can fail a CI npm ci.
  • npm ls --all reports no invalid dependencies.
  • npm test passes: clean, build, 230 tests, prettier and eslint all green.
  • Trivy scan of package-lock.json at medium and above: the 34 findings drop to 0. The only remaining hit is the unmailed uuid 8.3.2 noted above.

No new tests were added, since the change is to the dependency tree and the existing suite covers the runtime paths.

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated (no API change)

- Update fast-uri, handlebars, proxy-addr, js-yaml, msgpack5, undici, body-parser
  and brace-expansion within their ranges.
- Override qs to ^6.16.1, because express 4 and body-parser pin qs to 6.15.x.
- Override minimatch@>=10 to ^11.0.1. Copies that ask for ^9 or ^3 keep their versions.
- Leave the dev-only copies bundled under semantic-release/npm alone. They cannot be overridden.

Checks: npm@10 ci passes, npm ls reports no invalid tree, and npm test passes 230 tests.

Refs GH-316
@sonarqubecloud

Copy link
Copy Markdown

@rohit-sourcefuse rohit-sourcefuse left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this locally.

  • npx npm@10 ci, build, lint and all 230 tests pass, and npm ls --all exits 0. Master gives the same results.
  • The lockfile is stable under npm 10. All 31 new entries resolve from registry.npmjs.org with an integrity hash.
  • Prod Trivy goes from 39 findings to 1, the uuid 8.3.2 noted in the description.
  • qs 6.17.1 under express 4: query strings, nested filters and urlencoded bodies parse the same as with 6.15.3.
  • minimatch 11 under juggler: kv-memory keys({match}) returns the same keys as with 10.2.6.
  • commitizen keeps glob 7.2.3 and minimatch 3.1.5, so the range key leaves git cz alone.

One small, optional point. The table lists brace-expansion 2.1.8, but the lockfile still has 2.1.4 (dev only, under mocha's minimatch 9 and filelist). It is in range, so it can move without an override:

npx npm@10 update brace-expansion --package-lock-only --ignore-scripts

This changes 3 lines in the lockfile. After it, npm ci, npm ls --all and the tests pass, and Trivy with dev dependencies no longer reports brace-expansion 2.1.4.

Once this merges, dependabot PRs #308, #309 and #311 to #315 are covered and can be closed. #310 (moment) is not.

Approving.

@rohit-sourcefuse
rohit-sourcefuse merged commit 5c17316 into master Nov 20, 2026
@rohit-sourcefuse
rohit-sourcefuse deleted the GH-316 branch November 20, 2026 07:52
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.

Fix open Vantage dependency vulnerabilities

2 participants