Skip to content

[FIX] Fix Security Vulnerabilities via Dependency Overrides#407

Open
sapiderman wants to merge 1 commit into
hyperjumptech:mainfrom
sapiderman:remove-vulnerabilities
Open

[FIX] Fix Security Vulnerabilities via Dependency Overrides#407
sapiderman wants to merge 1 commit into
hyperjumptech:mainfrom
sapiderman:remove-vulnerabilities

Conversation

@sapiderman
Copy link
Copy Markdown
Collaborator

PR

Branch: remove-vulnerabilitiesmain

Summary

This PR adds targeted pnpm.overrides in the root package.json to force secure versions of vulnerable transitive dependencies, and updates the lockfile and workspace catalog accordingly.

Vulnerability Count

Before (main) After (remove-vulnerabilities) Delta
Critical 2 0 −2
High 57 7 −50
Moderate 59 2 −57
Low 5 0 −5
Total 123 9 −114 (92.7%)

Remaining 9 Vulnerabilities (out of scope — deeper transitive deps of netlify-cli and postcss)

Package Severity Issue Affected Path
tar High Hardlink/symlink path traversal (3 CVEs) netlify-cli > @netlify/edge-bundler > tar
minimatch High ReDoS (3 CVEs, v10 range) netlify-cli > @netlify/build > minimatch
picomatch High / Moderate ReDoS / method injection (2 CVEs) netlify-cli > @netlify/images > ipx > unstorage > anymatch > picomatch
postcss Moderate XSS via unescaped </style> packages/hermes/env > postcss

These 9 are pinned within netlify-cli's deep dependency tree or in a workspace package that requires a source-level upgrade rather than an override, and should be addressed in a follow-up PR.

Changes

package.json — Added 72 pnpm.overrides entries forcing secure versions of:

Package From To Vulnerabilities Fixed
hono ≤4.11.x ≥4.12.16 XSS, prototype pollution, cookie injection, auth bypass, path traversal, SSE injection (14 CVEs)
lodash ≤4.17.23 ≥4.18.0 Prototype pollution, code injection via _.template
handlebars ≤4.7.8 ≥4.7.9 JavaScript injection, prototype pollution (5 CVEs)
minimatch <10.2.3 ≥10.2.3 ReDoS (9 CVEs across v3, v5, v9, v10 ranges)
brace-expansion <2.0.3 ≥5.0.5 Zero-step sequence DoS
tar <7.5.7 ≥7.5.11 Path traversal, hardlink/symlink attacks (5 CVEs)
picomatch <2.3.2 / <4.0.4 ≥4.0.4 ReDoS, method injection
node-forge ≤1.3.3 ≥1.4.0 Certificate bypass, signature forgery, DoS (4 CVEs)
basic-ftp <5.2.0 ≥5.3.1 Path traversal, CRLF injection, DoS
fast-xml-parser <4.5.5 ≥5.7.0 XML entity expansion
file-type <21.3.1 ≥21.3.1 Infinite loop in ASF parser
follow-redirects ≤1.15.11 ≥1.16.0 Auth header leakage
vite ≤7.3.1 ≥8.0.11 Path traversal, server.fs.deny bypass
rollup <4.59.0 ≥4.59.0 Arbitrary file write via path traversal
h3 <1.15.9 ≥1.15.11 SSE injection, path traversal
fastify ≤5.8.4 ≥5.8.5 Schema validation bypass, header spoofing
@fastify/static ≤9.1.0 ≥9.1.1 Route guard bypass, path traversal
@hono/node-server <1.19.13 ≥1.19.13 Auth bypass via encoded slashes
defu ≤6.1.4 ≥6.1.7 Prototype pollution
flatted ≤3.4.1 ≥3.4.2 Unbounded recursion DoS, prototype pollution
svgo =4.0.0 ≥4.0.1 Billion laughs DoS
effect <3.20.0 ≥3.20.0 AsyncLocalStorage context loss/contamination
qs ≤6.14.1 ≥6.15.1 Array limit bypass
path-to-regexp <8.4.0 ≥8.4.2 DoS via sequential optional groups
ip-address ≤10.1.0 ≥10.2.0 XSS in Address6 HTML methods
uuid <11.1.1 / <13.0.1 ≥14.0.0 Buffer bounds check
tmp ≤0.2.3 ≥0.2.4 Arbitrary temp file write
yaml <2.8.3 ≥2.8.4 Stack overflow via deep nesting
postcss <8.5.10 ≥8.5.14 XSS via unescaped </style>
cookie-es ≤1.2.2 ≥1.2.3 (cascade)
semver ≤7.7.2 ≥7.7.4 (cascade)
ajv ≤8.17.1 ≥8.20.0 ReDoS via $data option

pnpm-workspace.yaml — Sorted catalog alphabetically; bumped hono to ^4.12.18.

pnpm-lock.yaml — Full lockfile regeneration reflecting all overrides.

Verification

# On main:
pnpm audit  # 123 vulnerabilities (5 low, 59 moderate, 57 high, 2 critical)

# On this branch:
pnpm audit  # 9 vulnerabilities (2 moderate, 7 high) — all in netlify-cli deep deps or postcss

Risk Assessment

  • All changes are limited to pnpm.overrides (no source code changes).
  • The overrides force minimum patched versions while preserving semver-compatible ranges.
  • The 9 remaining vulnerabilities are in deep transitive deps of netlify-cli (a dev/build tool only) and packages/hermes/env > postcss, none of which affect production runtime.
  • Recommended: follow-up PR to address the remaining 9 once netlify-cli publishes an update with patched deps.

Copy link
Copy Markdown
Contributor

@kevinhermawan kevinhermawan left a comment

Choose a reason for hiding this comment

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

Review

High Concern

1. file-type forced across 8 major versions (>=13.x>=21.3.1 <22.0.0)

file-type dropped CommonJS support at v17. Any package requiring file-type@^13 or ^16 will break at runtime in a CJS context. Please verify no consumer in the monorepo uses require('file-type').

2. vite forced from v7 → v8 (major version jump)

The lockfile shows @vitejs/plugin-react and vitest now resolve against vite@8.0.11 instead of 7.3.1. Vite 8 has breaking changes (new default configs, plugin API changes, dropped Node.js 18 support). Please confirm this is intentional and that all apps using Vite have been tested against v8.

3. fast-xml-parser — redundant v4 entry is dead code

"fast-xml-parser@>=4.0.0-beta.3 <4.5.5": ">=4.5.5",  // never applied
"fast-xml-parser@<5.7.0": ">=5.7.0"                   // subsumes the above

The first entry is fully covered by the second (any <4.5.5 also satisfies <5.7.0), so v4 consumers still get forced to v5.7.0. Remove the first entry to make the intent explicit.


Medium Concern

4. Massive redundancy — ~36 of 72 entries are covered by later, more restrictive ones

Examples (only the last entry is actually applied):

Package Redundant entries Effective entry
hono 8 entries hono@<4.12.16: >=4.12.16
tar 6 entries tar@<=7.5.10: >=7.5.11
basic-ftp 4 entries basic-ftp@<=5.3.0: >=5.3.1
fastify 3 entries fastify@>=5.3.2 <=5.8.4: >=5.8.5
lodash 3 entries lodash@>=4.0.0 <=4.17.23: >=4.18.0
handlebars 3 entries handlebars@>=4.0.0 <4.7.9: >=4.7.9
minimatch 6 entries 4 entries (one per major)
flatted 2 entries flatted@<=3.4.1: >=3.4.2
h3 3 entries h3@<1.15.9: >=1.15.9
node-forge 2 entries node-forge@<1.4.0: >=1.4.0

This appears to be intermediate CVE advisories appended in order rather than consolidated into a final range. Please collapse to one entry per package.

5. UUID description mismatch

PR description states forced to >=14.0.0, but the actual overrides are >=11.1.1 and >=13.0.1. Please clarify which is correct.

6. postcss appears in both the "fixed" and "remaining" lists

The overrides include postcss@<8.5.10: >=8.5.10, yet postcss also appears in the "remaining 9 vulnerabilities" table. Please clarify whether the override is effective for packages/hermes/env.


Low Concern

7. No mention of CI smoke-test or manual testing

Given that vite, effect, hono, ajv, and fast-xml-parser all jumped major versions, it would increase confidence to note which apps were smoke-tested or confirmed passing in CI.

8. Missing trailing newline in package.json

Line 134 of the diff shows \ No newline at end of file.

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