Skip to content

fix(deps): resolve 14 Snyk vulnerabilities via upgrades and overrides - #76

Merged
cs-raj merged 1 commit into
mainfrom
fix/snyk-vulnerability-resolution
Sep 10, 2026
Merged

fix(deps): resolve 14 Snyk vulnerabilities via upgrades and overrides#76
cs-raj merged 1 commit into
mainfrom
fix/snyk-vulnerability-resolution

Conversation

@cs-raj

@cs-raj cs-raj commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Snyk reported 14 security vulnerabilities on main (2 critical, 7 high, 5 moderate), and npm audit reported 6 (3 high, 3 moderate). Every one was transitive.

The dominant source was a single package: undici@8.10.0, reached via isomorphic-dompurify > jsdom, accounted for 11 of the 14 findings including both criticals (Improper Certificate Validation, Origin Validation Error).

Two entries in the existing overrides block had also gone stale and were themselves pinning vulnerable versions:

  • qs pinned at 6.15.3 — inside the affected range >=6.14.2 <=6.15.3
  • sharp pinned at 0.35.0 — inside the affected range <0.35.4 (libheif CVEs)

Fix

before after
Snyk security 14 (C:2 H:7 M:5) 0
npm audit 6 (high:3 moderate:3) 0

Direct dependency upgrades (patch/minor only, no majors):

  • next ^16.2.12^16.3.4
  • react ^19.2.8^19.3.0
  • react-dom ^19.2.8^19.3.0

Transitive fixes via overrides:

  • undici8.10.2 (new) — clears 11 findings incl. both criticals
  • js-yaml4.3.2 (new) — clears 1 high (CPU DoS via @eslint/eslintrc)
  • qs 6.15.36.16.0 — clears 2 moderate
  • sharp 0.35.00.35.4 — clears 1 high

Version bumped 1.2.21.2.3.

Deliberately not taken: Snyk's suggested remedy for the undici cluster was a major bump of isomorphic-dompurify 3.23.0 → 4.0.0, and npm audit fix proposed downgrading @contentstack/delivery-sdk 5.6.0 → 5.1.1 (flagged isSemVerMajor). Both rejected in favour of same-major overrides that fix the identical issues.

Build verification — please read

npm run build fails on this branch, and it fails identically on unmodified main. This was verified A/B: a git worktree at pristine HEAD with npm ci against the original lockfile produces the same error and the same digest as the modified tree — APIError 412, error_code 109: "We can't find that Stack.", digest 3319440507.

The cause is environmental, not a dependency regression: app/page.tsx fetches live Contentstack content at build time, so next build requires valid Stack credentials, which are not available in the environment this ran in. This repo has no build job in CI (only policy-scan.yml and sca-scan.yml), so this build has never been gated.

Everything a dependency upgrade could plausibly break did pass on the upgraded tree: Turbopack compile, full TypeScript typecheck, and page-data collection, on next@16.3.4 / react@19.3.0.

Please run npm run build with valid Contentstack credentials before merging.

Remaining findings (not addressable here)

  • 20 findings / 10 unique — LGPL-3.0 license notices (medium) on @img/sharp-libvips-* platform binaries via next > sharp. License metadata only; no non-LGPL alternative exists and sharp@0.35.4 ships the same binaries. Note the SCA workflow uses --fail-on=all, so these will still trip it.
  • isomorphic-dompurify@3.23.0 emits EBADENGINE (wants Node ^22.22.2) and is deprecated upstream for raising its Node floor without a major bump. Pre-existing; the fix is a 4.x major, out of scope for this PR.
  • snyk code test (SAST) returned findings for files that do not exist in this repo (src/main.ts, a knex service spec, a DB migration) under org 11012d4f-…, whereas snyk test resolves to contentstack-developer-ecosystem. Reproduced twice. This looks like a server-side project-mapping collision and was not actioned — worth raising with whoever owns the Snyk org config.

🤖 Generated with Claude Code

Clears all 14 Snyk security findings (2 critical, 7 high, 5 moderate) and
all 6 npm audit findings. Every vulnerability was transitive.

Upgrades next, react and react-dom within their existing majors, and adds
undici and js-yaml overrides. Raises the stale qs and sharp overrides,
which were pinning versions that had themselves become vulnerable.

No major version bumps. Snyk's suggested major (isomorphic-dompurify 4.0.0)
and npm audit's suggested downgrade (delivery-sdk 5.1.1) were both rejected
in favour of same-major overrides.

The build failure on this branch is pre-existing and environmental: it
reproduces identically on unmodified main with the same error digest, and
is caused by build-time Contentstack fetches requiring real credentials.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cs-raj
cs-raj requested a review from a team as a code owner September 10, 2026 13:03
@cs-raj cs-raj self-assigned this Sep 10, 2026
@snyk-io

snyk-io Bot commented Sep 10, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 20 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 20
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@rahul-contentstack rahul-contentstack 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.

LGTM!

@cs-raj
cs-raj merged commit d265000 into main Sep 10, 2026
7 checks passed
@cs-raj
cs-raj deleted the fix/snyk-vulnerability-resolution branch September 10, 2026 13:26
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.

4 participants