Skip to content

fix(security): bump next 16.4.2, storybook 10.6.2 - #163

Merged
catinspace-au merged 2 commits into
mainfrom
fix/sec-next-storybook
Oct 23, 2026
Merged

catinspace-au merged 2 commits into
mainfrom
fix/sec-next-storybook

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

Summary

Clears Dependabot alerts 360 to 366 for the 2.2.1 GA candidate: three against next, two against storybook, one each against ip-address and @vitest/mocker. Three of them are critical.

next (alerts 363, 366, 362)

  • 363, GHSA-2464-fhr4-w9xw, critical. The sink IS in the image. The root image is trixie-slim (glibc), images.unoptimized sits only in the static-export branch of packages/app/next.config.mjs:180, so /_next/image loads sharp. It was already mitigated: the lockfile has resolved sharp 0.35.5, the advisory's fix, since 2026-10-09. 16.4.1 raises next's own floor to sharp ^0.35.5, so the fix stops resting on one lockfile entry.
  • 366, GHSA-673q-mjm6-r5xr, critical. Needs an App Router use cache function returning typed arrays. packages/app is Pages Router, no app/ directory, no use cache.
  • 362, GHSA-p3m5-59mp-jv5r, high. Needs an App Router Server Action. None.
  • Pinned, next ^16.4.1 in security/overrides.yaml, rather than yarn up -R, because the sync merge driver takes upstream's lockfile. That is how the 2.40.0 sync took next 16.3.6 back to 16.3.4. Upstream has the same bump open as chore(deps): bump next from 16.3.8 to 16.4.1 ClickHouse/ClickStack#3460, and --check nags to drop the pin once upstream's lockfile passes it.
  • --apply wrote one resolutions key. yarn install took 16.4.2 (2026-10-15), because npmMinimalAgeGate holds 16.4.3 (2026-10-23). The lockfile moves next, @next/env, the nine @next/swc-* binaries and next's sharp descriptor, nothing else.

storybook (alerts 360, 365) and @vitest/mocker (alert 361)

  • Dev only. storybook is an app devDependency (packages/app/package.json:151). @vitest/mocker 3.2.4 came only from @storybook/builder-webpack5 10.1.4's exact pin. None of the family is in Next's standalone trace or the api's production closure.
  • Fixed anyway, because 360 and 365 go after the developer running yarn storybook, and every declared range admits 10.6.2. No package.json change: yarn up -R storybook @storybook/nextjs @storybook/addon-docs @storybook/addon-links @storybook/addon-themes.
  • The family moves together because @storybook/nextjs pins its builder exactly, and builder-webpack5 10.6.2 drops @vitest/mocker altogether, which clears 361.
  • The lockfile diff is big, about 2,900 lines, because @storybook/nextjs 10.6.2 brings a newer babel preset and swaps image-size for probe-image-size. The age gate holds storybook 10.6.3 (2026-10-20).
  • osv-scanner.toml drops GHSA-82fw-gwwq-j7x9, the earlier @vitest/mocker advisory, because the scanner no longer reports it.

ip-address (alert 364, GHSA-rxp7-6hxx-x8q5, moderate)

  • It ships: @hyperdx/api declares it, and express-rate-limit 8.7.1 and socks 2.8.10 pull it too.
  • It does not bite. Both of our callers, validateWebhookUrl (utils/validators.ts:161) and POST /clickhouse-proxy/test (routers/api/clickhouseProxy.ts:105), hand isPrivateIp a new URL() hostname. Node's URL parser refuses a host holding % or a line feed, and the quadratic path needs both.
  • Below THE BAR, so no pin. yarn up -R ip-address takes 10.7.4 inside every declared range, five lockfile lines.
  • The ip-address verdict in scripts/dismiss-triaged-alerts.py named ^10.3.1 and 10.3.1, two syncs stale. It now names ^10.7.1 and 10.7.4.

Measured on this branch

  • osv-scanner 2.5.1 on yarn.lock with osv-scanner.toml: main 11 (3 critical, 6 high, 2 medium), here 4 high, all GHSA-mrhx-c7xc-m3w5 against zod, which this change does not touch.
  • yarn npm audit --severity moderate (the CI gate): no suggestions. With --recursive: smol-toml 1.6.1, the existing nx verdict.
  • scripts/security-override.py --verify: matches, 16 entries (+3 fork pins), both patches applied. --check: all three pins holding, upstream ships next 16.3.6.
  • nx run-many --target=build for common-utils, api and app with NEXT_OUTPUT_STANDALONE=true, as the Dockerfile runs it: built on Next 16.4.2. The standalone trace carries next 16.4.2 and sharp 0.35.5.
  • yarn workspaces focus @hyperdx/api --production: of the 199 versions the lockfile adds, only ip-address 10.7.4 lands in the api's production closure.
  • API unit suite 79 suites, 1472 tests passed, validators.test.ts included. App unit suite 303 suites, 4692 tests passed.
  • storybook build completes on 10.6.2.
  • yarn install --immutable clean. Fork tooling tests 61 OK. Fork-surface guard passes on origin/main...HEAD. hyperi-ci check --quick passes (eslint, prettier, tsc, audit, semgrep, gitleaks), osv-scanner non-blocking on zod.

Not measured: no image built or deployed, no e2e, no storybook dev session.

Still to land on this branch before merge: the resolutions line in docs/fork/what-we-changed.md (two generated pins become three) and the dated section in docs/fork/security-sync.md.

Done when this merges and Dependabot closes 360 to 366 as fixed. Nothing needs dismissing.

next is pinned at ^16.4.1 in security/overrides.yaml and resolves 16.4.2, which clears GHSA-2464-fhr4-w9xw (critical), GHSA-673q-mjm6-r5xr (critical) and GHSA-p3m5-59mp-jv5r (high). Only the first has a sink in the image, the sharp the image optimiser loads, and the lockfile already resolved sharp 0.35.5, its fix. The pin raises next's own sharp floor to match, and it survives the sync merge driver, which takes upstream's lockfile.

storybook and its @storybook/* family move to 10.6.2 by yarn up -R inside their declared ranges, clearing GHSA-f2ph-cmg5-wxc8 (critical) and GHSA-px85-f4q5-jh77 (high). builder-webpack5 10.6.2 no longer depends on @vitest/mocker, which clears GHSA-qxg6-89mg-rqv8 (moderate). All three are dev only: storybook is an app devDependency and none of the family reaches the image.

ip-address moves to 10.7.4 the same way for GHSA-rxp7-6hxx-x8q5 (moderate). It ships in the api, but both callers hand it a URL-parsed hostname, which cannot hold the % and line terminator the advisory needs.

osv-scanner.toml drops the GHSA-82fw-gwwq-j7x9 ignore the scanner no longer reports, and the ip-address triage verdict names the versions the lockfile now resolves.
@catinspace-au
catinspace-au merged commit 06c3796 into main Oct 23, 2026
32 checks passed
@catinspace-au
catinspace-au deleted the fix/sec-next-storybook branch October 23, 2026 21:11
@github-actions

Copy link
Copy Markdown
Contributor

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.

1 participant