fix(deps): clear all production dependency vulnerabilities - #642
Merged
Conversation
npm audit on `next` reported 68 advisories (3 critical / 34 high / 27 moderate / 4 low). Splitting dev from production showed the published surface accounted for only 10 of them, and every one had a patch available inside its existing major version. Several entries in the root `overrides` block had gone stale: the pinned version was correct when it was added, but later advisories widened the vulnerable range past it. Most notably velocityjs was pinned at 2.1.6 while the critical RCE advisory covers <=2.1.6, so the override was holding the tree on a vulnerable version. Stale pins bumped: fast-uri 3.1.2 -> 3.1.5 (<=3.1.4) ip-address 10.2.0 -> 10.5.0 (<=10.3.0) velocityjs 2.1.6 -> 2.1.7 (<=2.1.6, critical RCE) js-yaml 4.2.0 -> 4.3.1 (4.0.0-4.3.0, scoped overrides) New pins: nanoid 3.3.18 (<=3.3.17) postcss 8.5.26 (<=8.5.22) body-parser 1.20.6 (<1.20.6) js-yaml@4 4.3.1 js-yaml@3 3.15.1 (<=3.15.0) brace-expansion@1 1.1.18 (<=1.1.17) brace-expansion@2 2.1.4 (2.0.0-2.1.3) undici@6 6.28.0 (<=6.27.0) undici@7 7.29.0 (7.0.0-7.28.0) js-yaml and brace-expansion are pinned per major line rather than globally: both have multiple majors in the tree, and collapsing them would force js-yaml 3.x consumers onto v4 (which dropped safeLoad) and downgrade brace-expansion 5.x consumers. ajv, socks and @istanbuljs/load-nyc-config were flagged only for depending on vulnerable fast-uri / ip-address / js-yaml, so they clear without a direct change. Result: `npm audit --omit=dev` goes from 10 to 0. Full tree drops 68 -> 59; everything remaining is build/release tooling behind a major upgrade (lerna 8->10, nx 20->23, serverless-offline, prisma, vite) and is tracked separately. website/ has its own lockfile and already audits clean. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdchVmNyYEzYD9rBfRugko
✅ Deploy Preview for friggframework-org canceled.
|
|
Contributor
|
🚀 PR was released in |
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
npm auditonnextreported 68 advisories (3 critical / 34 high / 27 moderate / 4 low). Splitting dev from production showed the published surface accounted for only 10 of them, and every one had a patch available inside its existing major version — so no breaking changes were needed to clear it.npm audit --omit=dev)Root cause
Several entries in the root
overridesblock had gone stale. Each pin was correct when it was added, but later advisories widened the vulnerable range past it, and the pins were never revisited.The sharpest case:
velocityjswas pinned at exactly2.1.6while the critical RCE advisory (GHSA-7gfh-x38p-prh3) covers<=2.1.6. The override was holding the tree on a vulnerable version rather than off it.Stale pins bumped
fast-uri<=3.1.4ip-address<=10.3.0velocityjs<=2.1.6(critical RCE)js-yaml(scoped)4.0.0 - 4.3.0New pins
nanoid<=3.3.17postcss<=8.5.22body-parser<1.20.6js-yaml@3<=3.15.0js-yaml@44.0.0 - 4.3.0brace-expansion@1<=1.1.17brace-expansion@22.0.0 - 2.1.3undici@6<=6.27.0undici@77.0.0 - 7.28.0Notes on approach
js-yamlandbrace-expansionare pinned per major line, not globally. Both have multiple majors live in the tree. A blanket pin would have forced js-yaml 3.x consumers onto v4 (which droppedsafeLoad) and downgraded brace-expansion 5.x consumers to 2.x. Thename@majoroverride key form keeps each line on its own patched release.ajv,socksand@istanbuljs/load-nyc-configwere flagged only for depending on vulnerablefast-uri/ip-address/js-yaml. They clear without a direct change.website/has its own lockfile outside the workspaces, so the root audit never covered it. Checked separately — already audits clean, no change needed.Test plan
npm ciexits 0 from the regenerated lockfile (2425 packages) — confirmspackage.jsonandpackage-lock.jsonare in syncfast-uri3.1.5,nanoid3.3.18,postcss8.5.26,body-parser1.20.6,js-yaml3.15.1 + 4.3.1,brace-expansion1.1.18 + 2.1.4,ip-address10.5.0,undici6.28.0 + 7.29.0)npm audit --omit=dev→found 0 vulnerabilitiesagainst the real installed treeadmin-scripts278/278,schemas98/98,serverless-plugin43/43 passingdevtoolsresults byte-identical to a baseline run on unmodifiednext(32 failed suites / 138 failed tests both before and after) — those failures are pre-existing and unrelated to dependenciesOut of scope
The remaining 59 advisories are all in build/release tooling and sit behind five major upgrades, each of which is breaking and needs its own testing:
lerna8.1.9 → 10.0.1serverless-offline→ 14.8.0prisma→ 6.12.0nx20.3.2 → 23.1.1vite→ 8.2.2One of these is not a version bump:
decompresshas no fixed version at any release, so it needs replacing or dropping rather than upgrading. It reaches the tree through the serverless deploy tooling.Suggested follow-up
Production-only audit is now at zero, which makes it a cheap and achievable CI gate. Failing a build on
npm audit --omit=devwould catch override drift like this automatically, instead of it surfacing months later.Generated by Claude Code