Skip to content

[FSSDK-13476] Update dev dependencies to fix Dependabot alerts - #360

Open
Esra Kartal (esrakartalOpt) wants to merge 1 commit into
masterfrom
esra/fssdk-13476-fix-dependabot-alerts
Open

Esra Kartal (esrakartalOpt) wants to merge 1 commit into
masterfrom
esra/fssdk-13476-fix-dependabot-alerts

Conversation

@esrakartalOpt

Copy link
Copy Markdown

Summary

Fixes 41 of the 44 open Dependabot alerts (FSSDK-13476, which listed 43). All of them are in dev and test tooling in the root package-lock.json. The published package's own dependencies are unchanged.

  • Ran npm audit fix with Node 22 and npm 12: vitest and @vitest/*, rollup, postcss, js-yaml, brace-expansion, minimatch, picomatch, nanoid, ws, flatted, source-map-js, terser, and the @typescript-eslint chain. This also fixes the critical vitest alert.
  • happy-dom ^20.4.0 to ^21.0.4, because the fixes are in 21.x.
  • Added vite ^7.3.8 as a dev dependency. Without it vitest would move to vite 8, a major version that replaces esbuild with native rolldown packages. This keeps vite on the patched 7.x line.

Not fixed: 3 serialize-javascript alerts (61, 87, 132). They need @rollup/plugin-terser 1.x, which needs serialize-javascript 7.x. That reads the global crypto when it loads, so the build fails on Node 18 (ReferenceError: crypto is not defined). CI tests on Node 18, and npm ci runs the build. The package is only used at build time to pass our own terser options to a worker, never with untrusted input. I suggest dismissing the 3 alerts in Dependabot with that reason. If Node 18 is dropped from CI later, upgrading the plugin fixes them.

Test plan

  • Unit tests on Node 18, 20, 22.23.4 and 24: 267 passed on each. tsc --noEmit passes. ESLint has 0 errors (9 warnings, the same as on master).
  • Built master and this branch: the published react-sdk.es.min.mjs and server.es.min.mjs are byte-for-byte identical (Node 20, 22.23.4 and 24), and the .d.ts files are the same. The source maps' mappings differ slightly, which only affects debugging.
  • npm ci with Node 18's own npm (as CI does, including the prepare build) works and gives the same bundles.
  • npm audit now lists only serialize-javascript and the terser plugin that uses it.
  • Not tested: the CI run itself.

Issues

  • FSSDK-13476

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@alexjoeyyong Alex Yong (alexjoeyyong) 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.

Verdict: approve. I rebuilt it twice, on Node 18 and 22, against both master and this branch and compared the results; the shipped bundle is byte-identical and every claim in the description checks out. The only open item is not code: three serialize-javascript alerts need dismissing by someone with Dependabot rights.

TL;DR

  • The published package is unchanged. I compared the lockfile at the merge-base and at this head: 0 non-dev packages changed, none added or removed, and package.json's dependencies are untouched. npm audit --omit=dev reports 0 vulnerabilities before and after.
  • The shipped output is byte-identical. npm ci (which runs the prepare build) on Node 18.20.8 and 22.23.5, on master and on this head: dist/react-sdk.es.min.mjs (c966709b...), dist/server.es.min.mjs (f7f73d74...) and the whole .d.ts set hash the same in all four runs.
  • Tests and checks pass: vitest 267 of 267 on Node 18 and on Node 22 (same as master), tsc --noEmit clean, ESLint 0 errors and the same 9 warnings as master.
  • The alert numbers are exactly right. I matched all 44 open Dependabot alerts (all development scope, read live from the repo) against the installed versions: on master all 44 are in their vulnerable range; on this head only 3 are: serialize-javascript #61, #87, #132. So 41 of 44, as described.
  • The reason for leaving those 3 is real. I installed @rollup/plugin-terser 1.0.2 (which brings serialize-javascript 7.1.4) on this branch: the build fails on Node 18 with ReferenceError: crypto is not defined and succeeds on Node 20. CI tests on Node 18, so upgrading would break the build today.
  • Lockfile hygiene is clean: every changed or added entry resolves to registry.npmjs.org with a sha512 integrity hash, and no new install scripts appear. npm ci works with Node 18's own npm 10.8.2 even though the lockfile was written with npm 12.

CI: 10 pass, 1 skipped, none failing.

Proof

Results
                                master                 this head
published deps changed          -                      0 (non-dev lockfile entries: 0 changed / 0 added / 0 removed)
npm audit --omit=dev            found 0 vulnerabilities  found 0 vulnerabilities
npm audit (all)                 21 (5 moderate, 13 high, 3 critical)   2 (1 moderate, 1 high): serialize-javascript + the terser plugin that uses it
Node 18.20.8  tests / tsc / eslint     267 pass / ok / 0 errors, 9 warnings   267 pass / ok / 0 errors, 9 warnings
Node 22.23.5  tests / tsc / eslint     267 pass / ok / 0 errors, 9 warnings   267 pass / ok / 0 errors, 9 warnings
dist/react-sdk.es.min.mjs sha256   c966709ba2cf...  (both versions)      c966709ba2cf...   identical
dist/server.es.min.mjs   sha256    f7f73d74b66f...                       f7f73d74b66f...   identical
all .d.ts concatenated sha256      caf280217239...                       caf280217239...   identical
versions: vitest 4.0.18 -> 4.1.12   happy-dom 20.4.0 -> 21.0.4   vite 7.3.1 -> 7.3.8   rollup 4.55.1 -> 4.69.3
          postcss 8.5.6 -> 8.5.34   nanoid 3.3.11 -> 3.3.20   ws 8.18.3 -> 8.23.1   js-yaml 4.1.1 -> 4.3.2

Open Dependabot alerts (44, all development scope) whose installed version is still in the vulnerable range:
  master:     44 of 44
  this head:   3 of 44  -> #132 serialize-javascript (low), #87 (medium), #61 (high); all "installed 6.0.2"
Terser plugin experiment on this branch (npm i --no-save @rollup/plugin-terser@latest -> 1.0.2, serialize-javascript 7.1.4):
  Node 18.20.8: [!] ReferenceError: crypto is not defined    (build fails)
  Node 20.20.2: created dist/react-sdk.es.min.mjs ... created dist/server.es.min.mjs   (build ok)
Added packages: @isaacs/nonrecursive-glob-match 1.1.0, @rollup/rollup-android-x64 4.69.3, balanced-match 4.0.4,
                buffer-image-size 0.6.4, convert-source-map 2.0.0, entities 7.0.1 (replaces 4.5.0); all dev, registry-hosted, sha512.

Findings

Blockers: none. Should-fix: none.

To do outside the PR: dismiss Dependabot alerts #61, #87 and #132 with the reason given in the description (build-time only, fed our own terser options, never untrusted input). That needs someone with rights on the repo; the PR can't do it. If Node 18 leaves the CI matrix, upgrading @rollup/plugin-terser fixes them for real.

Nit (no change asked): vite is now a direct dev dependency only to keep it on 7.x. That is the simplest way to do it, but nothing imports vite directly, so a short note in the PR body (already there) is the only record. Fine as is.

Ponytail

Lean already: one dependency added to hold a version line, one bumped. Nothing to cut.
net: 0 lines possible.

Principles (installed principles plugin v0.5.0, org layer; no repo-level checks)

Applied by hand, not the full recorded run. SEC-6.S1 / SEC-6.S2: dependency scanning reports on the repo and this PR takes the open alerts from 44 to 3, with the remaining 3 explained. FUN-2.S1 pass (267/267 on two Node versions, byte-identical output). CODE-1.S1 pass.

This branch has not been deployed

No deployments
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