Skip to content

fix(deps): resolve all Snyk production vulnerabilities - #20

Merged
contentstackMridul merged 1 commit into
stagfrom
vul_fix_04_08_2026
Aug 5, 2026
Merged

fix(deps): resolve all Snyk production vulnerabilities#20
contentstackMridul merged 1 commit into
stagfrom
vul_fix_04_08_2026

Conversation

@contentstackMridul

@contentstackMridul contentstackMridul commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Clears every Snyk vulnerability in the production scope, 23 issues across 50 vulnerable paths down to zero. That is the set the security-sca gate scans, and it is green on this PR. The manifest change is two lines: one dependency major, and the overrides block deleted. It touches no source file.

Type of Change

  • feat: new feature
  • fix: bug fix
  • chore: maintenance / dependency update
  • refactor: code improvement without behavior change
  • test: adding or updating tests
  • docs: documentation only

Changes Made

  • package.json: @fastify/swagger-ui ^5.2.5 to ^6.1.1, which brings @fastify/static 10.1.2. The overrides block is removed, both entries.
  • package-lock.json: regenerated. Nine packages move, each already inside its parent's declared range: fast-uri 3.1.5, find-my-way 9.7.0, brace-expansion 2.1.4, adm-zip 0.5.18, axios 1.19.0, liquidjs 10.28.0, body-parser 1.20.6, form-data 4.0.6, plus dev-only esbuild 0.28.1, js-yaml and @babel/core.

Production goes 23 issues to 0. Dev goes 30 to 2, both dev-only mediums that need an eslint major. Snyk Code reports 0 open.

Why These Changes

security-sca runs snyk test --all-projects --fail-on=all, so it counts the whole tree rather than what a PR adds. It was red on 23 production issues, including a High directory traversal and seven other Highs.

Most of it needed no manifest change. Whatever parent pulled each vulnerable child in already allowed its fixed version, so the lockfile reached all of them with no overrides entry. That covers the 14 issues arriving through @contentstack/shopify-live-preview-sdk@1.1.3 as well, which matters: the SDK declares adm-zip ^0.5.10, axios ^1.15.2 and liquidjs ^10.25.7, and the fixed versions all satisfy those. So this repo goes green on its own lockfile and does not wait on the SDK release in contentstack/shopify-live-preview-sdk#28.

The overrides block was the one real problem. It pinned @fastify/static to an exact 9.1.1, which was the fix back in May, but once 9.1.1 itself got flagged the pin is what held us there. Removing the pin was not enough on its own, because every remaining 9.x carries the same two advisories, and 9.3.0 is the newest. Reaching a fix needs @fastify/static 10, and the supported way there is swagger-ui 6.

I checked the cascade before taking the major. swagger-ui 6.1.1 declares fastify: '5.x' and so does static 10.1.2, and fastify has no 6.x line at all, so nothing propagates past this bump. The only documented consumer break in v6.0.0 drops the deprecated useUnsafeMarkdown option, and we pass exactly one option, routePrefix.

JIRA: N/A. The branch carries no ticket key and there is no open Snyk ticket for this repo, see the note below.

Breaking Changes

No. Nothing in src/ changes, so the service surface is identical: same routes, same plugin order, same swagger config. The swagger-ui major is a dependency major, not an API one, and the option we pass survives it.

Risk Level: MEDIUM

Dependency-only with no source changes, but it takes a major on the plugin serving a live route, and no automated test covers that route. A boot check is the only thing standing behind it.

Notes for Reviewer

All six checks pass, security-sca included. Since that one is the absolute whole-tree gate rather than a PR-delta check, green means the production backlog is empty, not just free of new issues.

Deleting the overrides block is the judgment call worth your attention. The @fastify/static half was forced, but I dropped the minimatch: ^9.0.7 entry too, after confirming it is security-neutral, and that turned out to fix jest --coverage, which that pin has been breaking all along. Worth knowing on the test-coverage branch, where PR #19 added test-exclude: ^7.0.1 to work around it. That override may now be removable. Happy to restore just the minimatch entry if you would rather keep this PR strictly to vulnerabilities.

There are no Jira tickets to close. Four exist for this repo and all are archived against packages we are not touching, fastify@4.29.1 and lodash@4.17.21. Nothing filed tickets for the current backlog because commit 9e16132 deleted .github/workflows/issues-jira.yml. Only sca-scan.yml and policy-scan.yml remain. Might be worth restoring separately.

GitHub shows this branch as behind stag by two commits. Both are merge commits and git diff origin/main origin/stag is empty, so there is no content difference and nothing to resolve. I branched from a freshly pulled main.

Two dev-only mediums stay open, SNYK-JS-ESLINT-15102420 and SNYK-JS-INFLIGHT-6095116. They close together and only via an eslint major, which also drags in @typescript-eslint 8 and a flat config migration. Neither fails the gate, since security-sca does not scan dev dependencies. Note npm run lint is already broken here for want of a config, so fixing that is the prerequisite. Tracked as a follow-up.

Unrelated, spotted on the way past: fastify-plugin is a declared dependency but nothing in src/ imports it.

Production scope goes from 23 issues / 50 vulnerable paths to 0.
Dev scope goes from 30 issues to 2.

- @fastify/swagger-ui ^5.2.5 to ^6.1.1, which brings @fastify/static 10.1.2.
  The entire 9.x line carries a High directory traversal, so no patch, minor
  or in-range bump could reach a fix. swagger-ui 6 still declares fastify 5.x
  and fastify has no 6.x line, so nothing cascades. Our only option to it is
  routePrefix, and the one documented v6 break removes useUnsafeMarkdown,
  which we never passed.

- Drop the overrides block. Pinning @fastify/static at an exact 9.1.1 is what
  held it at a vulnerable version once 9.1.1 itself got flagged. minimatch no
  longer needs a pin either, and dropping it also unbreaks jest --coverage.

- Lockfile only, each already inside its parent's declared range: fast-uri
  3.1.5, find-my-way 9.7.0, brace-expansion 2.1.4, adm-zip 0.5.18, axios
  1.19.0, liquidjs 10.28.0, body-parser 1.20.6, form-data 4.0.6, and dev-only
  esbuild 0.28.1 (clears a Critical), js-yaml and @babel/core.

No source file changes. Verified with 15/15 tests passing, a clean tsc build,
a boot check confirming /documentation and all seven of its static assets
still serve under @fastify/static 10, and a Snyk re-scan reporting no
vulnerable paths in production.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@contentstackMridul
contentstackMridul requested a review from a team as a code owner August 4, 2026 12:59
@snyk-io

snyk-io Bot commented Aug 4, 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

github-actions Bot commented Aug 4, 2026

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 0 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

✅ BUILD PASSED - All security checks passed

@kirtesh-cstk kirtesh-cstk 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

@contentstackMridul
contentstackMridul merged commit e52eb21 into stag Aug 5, 2026
6 checks passed
@contentstackMridul
contentstackMridul deleted the vul_fix_04_08_2026 branch August 5, 2026 05:51
contentstackMridul added a commit that referenced this pull request Aug 5, 2026
Conflict was package.json only, in the overrides block.

stag (PR #20, the Snyk fix) deleted overrides entirely: the exact
@fastify/static 9.1.1 pin was what held it at a vulnerable version, and
swagger-ui ^6.1.1 brings @fastify/static 10 on its own. This branch had
added test-exclude ^7.0.1 to that same block.

Took stag's side. The test-exclude override existed only to work around
the minimatch ^9 pin, which starved test-exclude@6 of a callable
minimatch. With the pin gone, test-exclude@6 resolves its own
minimatch@3 and --coverage works unaided, so the override is dead weight
rather than something to carry forward. Scripts keep this branch's
--experimental-vm-modules form; deps take stag's swagger-ui ^6.1.1.

package-lock.json reset to stag verbatim; npm install reports up to date,
confirming this branch introduced no dependency of its own.

Verified on the merge result: 6 suites / 41 tests pass, --coverage
reports the same per-file numbers as before the merge (controllers/index
96.96%, config 100%, app 90%, routes 83.33%), tsc build clean, and a boot
check of dist/index.js serves /health, /documentation and all seven
swagger assets under @fastify/static 10. Plugin registration order in
app.ts still matches stag's index.ts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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