deps: clear all production CVEs via prod bumps + transitive overrides#3
Merged
Conversation
Production direct deps: - @google-cloud/storage 6 -> 7 (CVE-cleared transitive chain) - @sentry/node 7.7 -> 7.120.4 - aws-sdk 2.1109 -> 2.1693 (latest v2; v3 migration noted below) - body-parser 1.20.0 -> 1.20.3 - convict 6.2.4 -> 6.2.5 - express 4.17.3 -> 4.21.2 (path-to-regexp, qs CVE fixes) - node-fetch 2.6.7 -> 2.7.0 (stays on v2; v3 is ESM-only) - redis 3.1.1 -> 3.1.2 (stays on v3 to avoid v4 API break) - redis-mock 0.47 -> 0.56.3 - ua-parser-js 0.7.31 -> 0.7.41 (ReDoS fix) Overrides to force-bump CVE-affected transitive deps without churning the build chain: - braces, micromatch, picomatch (ReDoS) - cross-spawn (ReDoS) - fast-uri (path traversal / host confusion) - fast-xml-parser 5.7+ (XMLBuilder injection) - flatted (prototype pollution, recursion DoS) - json5 (prototype pollution) - lodash (prototype pollution, code injection) - minimatch 9 (ReDoS) - node-forge (multiple sig forgery and ASN.1 issues) - qs (DoS) - semver (ReDoS) - serialize-javascript (RCE) - tough-cookie (prototype pollution) - tar (path traversal, symlink poisoning) - uuid 11 (buffer bounds check) - validator (URL bypass) - ws (multiple) Result: production npm audit drops from 5 moderate to 1 low (the standing aws-sdk v2 EOL advisory, requires v3 migration to fully clear). Total npm audit: 108 -> 55 vulnerabilities. Remaining 55 are entirely in the dev-build chain (webpack 4, babel 6 via extract-loader, html-loader, etc.) and require a webpack 5 migration to fully clear -- not in scope for this PR. Backend tests (48) still pass.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audits the entire dep tree, bumps direct production deps to clear known CVEs, and adds
overridesfor transitive deps that the build chain can't otherwise reach.Production audit
aws-sdk,fast-xml-parser,@google-cloud/storage,teeny-request,uuid)Total audit
extract-loader,html-loader,webpack-dev-server, etc.). Zero of these reach the production runtime.Direct production bumps
@google-cloud/storage^6.2.3^7.16.0fast-xml-parser/teeny-request@sentry/node^7.7.0^7.120.4aws-sdk^2.1109.0^2.1693.0body-parser^1.20.0^1.20.3convict^6.2.4^6.2.5express^4.17.3^4.21.2path-to-regexp,qsReDoS / DoS fixesnode-fetch^2.6.7^2.7.0redis^3.1.1^3.1.2redis-mock^0.47.0^0.56.3ua-parser-js^0.7.31^0.7.41Overrides
Twenty force-bumps for transitive CVE-affected packages — each one a known advisory:
braces,micromatch,picomatch,cross-spawn,fast-uri,fast-xml-parser,flatted,json5,lodash,minimatch,node-forge,qs,semver,serialize-javascript,tough-cookie,tar,uuid,validator,ws,dns-packet.Out of scope (deliberately deferred)
aws-sdkv2 reached end-of-support. The remaining moderate advisory is the EOL umbrella; clearing it requires replacingaws-sdkwith@aws-sdk/client-s3and rewritingserver/storage/s3.js. Larger PR.extract-loaderchain). Bumping webpack alone needs new versions of every loader (css-loader,file-loader,html-loader,extract-loader,copy-webpack-plugin,webpack-dev-server,webpack-cli,terser-webpack-plugin) plus config rewrite. Independent project.helmet3 → 7+ — newer helmet has API changes for dynamic CSP directives (function(req)style is gone). Code change required inserver/routes/index.js. Not a CVE; deferred.redis3 → 4 — v4 has a different command/promise API. Would require server/storage/redis.js rewrite. Not a CVE.Test plan
npm installsucceeds (1782 packages, 0 errors)npm audit --omit=devshows only the aws-sdk EOL advisorymocha test/backend)require('./server/storage/s3.js'), gcs, auth, routes)