Skip to content

Resolve npm audit critical & high vulnerabilities#6229

Open
pawelangelow wants to merge 9 commits into
migrate-to-npmfrom
review-deps
Open

Resolve npm audit critical & high vulnerabilities#6229
pawelangelow wants to merge 9 commits into
migrate-to-npmfrom
review-deps

Conversation

@pawelangelow

@pawelangelow pawelangelow commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What

Clears every critical and high-severity npm audit finding across both the
production and full dependency trees. All remaining findings are moderate.

Critical High Moderate
Production before → after 1 → 0 6 → 0 7 → 6
Full tree before → after 2 → 0 8 → 0 12 → 11

Approach, most→least common:

  • Refreshed stale lockfile pins via npm update where the parent already
    allowed a patched version - no overrides added (ws/engine.io-client,
    picomatch, shell-quote, dev ws, minimatch).
  • Refreshed stale overrides already in the repo (protobufjs → 7.6.5,
    form-data → 4.0.6).
  • Removed an unused dependencyjsonpath (dead since ~2022), which also
    dropped underscore.
  • Pruned redundant overrides that no longer changed resolution
    (cross-spawn, vite>esbuild, msw>path-to-regexp, wba>ws).
  • Bumped a dev lint plugineslint-plugin-sonarjs 2 → 4 (major).

Not addressed (all moderate, left for follow-up): the Sentry/OpenTelemetry
chain and the @elastic/eui / uuid pair (the latter resolves with the
in-progress EUI → Redis UI migration).

Testing

  • npm audit / npm audit --omit=dev verified after each change (0 critical, 0 high).
  • valueFormatters suite (81 tests, incl. protobuf decoding) passes on protobufjs 7.6.5.
  • API type-check reports no new errors (jsonpath removal).
  • Full no-cache eslint . passes with sonarjs 4 (zero new violations).

Note

Medium Risk
Removing jsonpath and major-bumping eslint-plugin-sonarjs change lint behavior and dependency surface; protobuf/form-data overrides affect runtime decoding and HTTP clients but were validated by existing tests.

Overview
Clears critical and high npm audit findings by updating the lockfile and trimming package.json dependencies and overrides.

Dependency changes: Removes unused jsonpath and @types/jsonpath (no remaining imports). Bumps eslint-plugin-sonarjs from 2.x to 4.2.0, which drops the old bundled Babel/TypeScript-eslint stack and uses a slimmer rule set (e.g. jsx-ast-utils-x).

Overrides: Tightens rawprotoprotobufjs to ^7.6.5 and form-data to ^4.0.6. Removes overrides that no longer affect resolution (cross-spawn, viteesbuild, mswpath-to-regexp, webpack-bundle-analyzerws).

Lockfile: Refreshes transitive pins (e.g. engine.io-client, ws, protobufjs, minimatch, picomatch) so patched versions resolve without extra overrides.

Reviewed by Cursor Bugbot for commit 50bf8f7. Bugbot is set up for automated code reviews on this repo. Configure here.

pawelangelow and others added 9 commits July 17, 2026 12:20
Remove four overrides whose parent packages already resolve to safe,
non-vulnerable versions on their own, so the pins were dead weight:

- webpack-bundle-analyzer > ws
- msw > path-to-regexp
- cross-spawn
- vite > esbuild

Verified via an isolated fresh-install comparison: removing these
produces zero change in `npm audit` (25 total / 14 production, all
resolved versions patched). semver and form-data overrides are kept
as they still act as de-duplication pins.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The existing `rawproto > protobufjs: ^7.2.5` override resolved to
protobufjs 7.3.0, which is still within the vulnerable range (<=7.6.2)
for a set of advisories including a critical arbitrary-code-execution
issue (GHSA-xq3m-2v4x-88gg).

Bump the override to `^7.6.5` (latest patched 7.x) rather than
protobufjs 8.x or rawproto@1.0.3, staying in the major the override
already validated as compatible with rawproto's usage. Clears the
protobufjs critical and the dependent rawproto high; production audit
now reports 0 critical.

Verified rawproto's decoding still works: valueFormatters.spec.ts
(81 tests, incl. protobuf vector decoding) passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`jsonpath` was a direct root dependency (added 2022) with no references
anywhere in first-party source (ui, api, desktop, or workbench plugins)
and no other package depending on it. Its only transitive dependency,
`underscore`, was carried solely for it.

Removing `jsonpath` and `@types/jsonpath` clears two high-severity
production advisories at once:
- jsonpath: arbitrary code injection via unsafe JSON path evaluation
- underscore: unbounded recursion DoS in _.flatten / _.isEqual

Production audit: 12 -> 10 (highs 5 -> 3). API type-check reports no
new errors; jsonpath is not imported in any first-party code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The socket.io-client -> engine.io-client -> ws chain resolved ws to
8.17.1, vulnerable to an uninitialized-memory disclosure (<8.20.1) and
a memory-exhaustion DoS (<8.21.0).

engine.io-client 6.6.6 declares `ws: ~8.21.0` (6.6.1 pinned ~8.17.1),
and socket.io-client@4.8.3 already allows it (~6.6.1). So a plain
`npm update engine.io-client` bumps the transitive to 6.6.6 and ws to
8.21.1 - no override needed. Clears the production ws high and the
engine.io-client moderate.

Production audit: 10 -> 8 (highs 3 -> 2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The GHSA-hmw2-7cc7-3qxx CRLF-injection advisory was extended to cover
form-data 4.0.5 (now affects <4.0.6), so the existing `form-data:
^4.0.4` override was pinning a floor below the fix and the tree
resolved to the still-vulnerable 4.0.5.

Bump the override to ^4.0.6, keeping its de-duplication role while
forcing the patched version across the tree. Clears the form-data high
in both production and dev.

Production audit: 8 -> 7 (highs 2 -> 1).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
picomatch resolved to 2.3.1 via styled-components ->
babel-plugin-styled-components, vulnerable to a method-injection glob
bug (GHSA-3v7f-55p6-f55p) and a ReDoS (GHSA-c2c7-rcm5-vvqj), both fixed
in 2.3.2.

babel-plugin-styled-components already allows it (picomatch: ^2.3.1),
so `npm update picomatch` bumps the locked 2.3.1 to 2.3.2 with no
override and no styled-components v6 upgrade. Clears the last
production high.

Production audit: 7 -> 6 (now 0 critical, 0 high; 6 moderate remain).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two dev-only transitive advisories, both stale lockfile pins with
in-range patched versions available (no overrides needed):

- shell-quote (critical, GHSA newline-escape): concurrently allows
  ^1.8.1; bump 1.8.1 -> 1.10.0.
- ws (high, memory-exhaustion DoS <7.5.11): webpack-bundle-analyzer
  allows ^7.3.1; bump the dev copy 7.5.10 -> 7.5.12.

Clears the last dev-only critical. Full audit: 18 -> 16 (0 critical).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Upgrade the dev-only lint plugin from 2.0.4 to 4.2.0 to clear its
high-severity advisory (and drop the stale eslint-plugin-import /
@babel/core / ajv sub-tree it bundled).

Verified non-breaking: eslint 8.57 satisfies the v4 peer range, all
six sonarjs rules configured in .eslintrc.js still exist in v4, and a
full no-cache `eslint .` run reports zero problems (the config enables
only those six rules, not the recommended preset).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The dev build tool copyfiles -> glob@7 pulled minimatch@3.1.2,
vulnerable to several ReDoS advisories (<3.1.4). glob declares
minimatch ^3.1.1, so `npm update minimatch` bumps the locked 3.1.2 to
3.1.5 with no override.

Clears the last high-severity advisory. No critical or high findings
remain in either the production or full dependency tree.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pawelangelow pawelangelow self-assigned this Jul 17, 2026
@pawelangelow
pawelangelow requested a review from a team as a code owner July 17, 2026 12:13
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 93.14% 16498/17714
🟡 Branches 75.38% 5275/6998
🟢 Functions 87.47% 2533/2896
🟢 Lines 92.99% 15774/16963

Test suite run success

3684 tests passing in 321 suites.

Report generated by 🧪jest coverage report action from 50bf8f7

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.23% 27742/33332
🟡 Branches 69.25% 11903/17189
🟡 Functions 78.18% 7386/9448
🟢 Lines 83.68% 27013/32280

Test suite run success

7829 tests passing in 865 suites.

Report generated by 🧪jest coverage report action from 50bf8f7

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 72.25% 16596/22970
🟡 Branches 53.77% 7372/13708
🟡 Functions 55.95% 2059/3680
🟡 Lines 71.61% 15565/21733

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.

2 participants