Skip to content

fix(deps): resolve the Dependabot alerts in the vendored tuistory helper - #1230

Merged
kevincodex1 merged 3 commits into
mainfrom
fix/deps-dependabot-alerts
Nov 17, 2026
Merged

kevincodex1 merged 3 commits into
mainfrom
fix/deps-dependabot-alerts

Conversation

@kevincodex1

@kevincodex1 kevincodex1 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What and why

Addresses the 8 open Dependabot alerts on main (1 high, 6 moderate, 1 low). All of them come from package-lock.json, through tuistory, which release packaging installs into every artifact as the local-control terminal helper (zero-release package runs npm ci from this lockfile). So these versions ship to users. The Go side is clean (make vulncheck).

There is one commit per package:

Commit Package Advisories Change
fix(deps): refresh the lockfile to hono 4.13.19 hono 4.13.13 GHSA-4m76-xfj5-7975, GHSA-h7mg-cq63-vhpq, GHSA-46wx-v44x-9hh2, GHSA-4h7h-rv7c-7m2v (moderate), GHSA-3gg2-335m-rxc6 (low) Lockfile only, inside tuistory's ^4.11.7
fix(deps): refresh the lockfile to @hono/node-server 1.19.19 @hono/node-server 1.19.17 GHSA-jpvv-r467-5p4w, GHSA-rmxm-3fg6-px4f (moderate) Lockfile only, inside tuistory's ^1.19.9 and @hono/node-ws's ^1.19.11 peer range
fix(deps): override tuistory's zod pin to 4.6.7 zod 4.3.6 GHSA-mrhx-c7xc-m3w5 (high) Scoped overrides, plus a release staging fix

Notes

  • GHSA-h7mg is the one in reach. tuistory's relay runs every request through an app.use('*') guard that rejects non-local Host and Origin headers. That guard is wildcard middleware, which is what this advisory says RegExpRouter can skip.
  • zod needs an override. tuistory pins zod to exactly 4.3.6, and so does its latest release (1.0.0). No bump of tuistory and no in-range refresh reaches the fix. The override is scoped to tuistory.
  • The override alone breaks releases. stageLocalControlHelpers writes its own helpers package.json from the dependency pins, copies the repo lockfile beside it, and runs npm ci. Without the overrides in that manifest, real npm refuses the pair:
    npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync.
    npm error Missing: zod@4.3.6 from lock file
    
    localControlHelperPins (renamed from localControlHelperDependencies) now reads the repo overrides too, and the staged manifest carries them verbatim when present. build-platform-packages.mjs strips overrides from the published wrapper along with dependencies. docs/NPM_PACKAGING.md records both changes and adds the override step to the helper-bump runbook.
  • GHSA-rmxm will stay flagged after merge. Upstream backported the serveStatic fix to 1.19.19 (see the v1.19.19 release notes; dist/serve-static.js gains the allowPercentInPath check). The advisory still lists 2.1.3 as the first patched version, so Dependabot and npm audit keep flagging 1.19.19. tuistory never calls serveStatic either way. Moving to 2.x would break tuistory's and @hono/node-ws's declared ranges and raise the Node floor to 20, so this alert should be dismissed with that reason after merge.

Tests and verification

  • New TestStageLocalControlHelpersCarriesPackageOverrides. Without the release.go change it fails with helper package.json overrides = <nil>, want map[string]interface {}{"tuistory":map[string]interface {}{"zod":"^4.6.6"}, "ws":"8.18.0"}.
  • New TestStageLocalControlHelpersOmitsAbsentOverrides (absent and null cases).
  • TestBuildPlatformPackagesAssemblesPublishPayloads now asserts the published wrapper has no overrides. Without the strip it fails with published wrapper has overrides: map[tuistory:map[zod:^4.6.6]].
  • A real go run ./cmd/zero-release package (macOS arm64) stages zod 4.6.7, hono 4.13.19 and @hono/node-server 1.19.19 in helpers/.
  • Ran the vendored tuistory from that staging on a spare port:
    • launch, type, wait, snapshot and close all work through the relay;
    • the local-only guard still returns 403 for a foreign Host header and for a cross-origin Origin;
    • a raw backslash path now gets 400 (the GHSA-jpvv fix);
    • zod rejects a bad --cols value as before.
  • npm audit --package-lock-only now reports only GHSA-rmxm, for the advisory-range reason above.
  • Required checks all pass: make fmt-check, go vet ./..., go test ./..., go test -race on internal/release and internal/npmwrapper, go run ./cmd/zero-release build, go run ./cmd/zero-release smoke, make vulncheck, git diff HEAD --check.
  • make lint-static (advisory) reports 4 staticcheck findings, all already on main in files this PR does not touch (internal/tools/web_fetch.go, internal/proxydial/proxydial.go, internal/installtest/workflow_permissions_test.go).
  • CodeRabbit CLI review of the three commits against main completed with 0 findings.

Summary by CodeRabbit

  • Bug Fixes
    • Local helper installations now honor package overrides, allowing transitive dependency fixes to be applied when needed.
    • Overrides are excluded from published wrapper packages.

Five advisories affect hono 4.13.13, which main pins through tuistory,
which release packaging installs as a local-control helper:

- GHSA-4m76-xfj5-7975 (moderate): mount() can forward a path that
  bypasses middleware scoped inside the mount prefix.
- GHSA-h7mg-cq63-vhpq (moderate): RegExpRouter skips wildcard middleware
  for some route sets and for paths with an encoded line terminator.
  tuistory's relay guards every request with app.use('*') middleware
  that rejects non-local Host and Origin headers, so this one is in
  reach.
- GHSA-46wx-v44x-9hh2 (moderate): csrf() does not check hyperlink
  auditing (text/ping) requests.
- GHSA-4h7h-rv7c-7m2v (moderate): validator('form') skips validation
  for multipart/form-data with extra parameters.
- GHSA-3gg2-335m-rxc6 (low): the css helper does not escape a closing
  tag split between template and interpolated value.

All are fixed in 4.13.16. npm update takes hono to 4.13.19, inside
every range that asks for it. package.json is unchanged and nothing
else in the lock moves.
Two advisories affect @hono/node-server 1.19.17, which main pins through
tuistory's local-control relay:

- GHSA-jpvv-r467-5p4w (moderate): a raw backslash in the request path
  is parsed as a path separator, so a request can reach a route that a
  path-based rule at a reverse proxy meant to block. Fixed in 1.19.18,
  which answers such requests with 400.
- GHSA-rmxm-3fg6-px4f (moderate): serveStatic decodes the request path
  a second time, so middleware on a static prefix can be bypassed.
  Upstream backported the fix to 1.19.19 (the v1.19.19 release notes;
  dist/serve-static.js gains the allowPercentInPath check). The
  advisory still lists 2.1.3 as the first patched version, so scanners
  keep flagging 1.19.19 until it is corrected. tuistory never calls
  serveStatic either way.

1.19.19 stays inside tuistory's ^1.19.9 and @hono/node-ws's ^1.19.11
peer range, so no override is needed; moving to 2.x would break both
ranges and raise the Node floor to 20. npm update takes the package to
1.19.19; package.json is unchanged and nothing else in the lock moves.
GHSA-mrhx-c7xc-m3w5 (high): zod before 4.6.6 can exhaust memory while
validating oversized constrained collections. tuistory pins zod to
exactly 4.3.6, and so does its latest release (1.0.0), so no tuistory
bump or in-range refresh reaches the fix. package.json now overrides
zod under tuistory to ^4.6.6, and the lock resolves 4.6.7. The
override is scoped to tuistory so it cannot pull zod for any other
dependency.

The override alone would break release packaging. stageLocalControlHelpers
writes its own helpers package.json from the repo dependency pins and
copies the repo lockfile beside it, then runs npm ci. Without the
overrides in that manifest, npm ci refuses the pair:

    npm error `npm ci` can only install packages when your package.json
    and package-lock.json or npm-shrinkwrap.json are in sync.
    npm error Missing: zod@4.3.6 from lock file

So localControlHelperPins (was localControlHelperDependencies) also
reads the repo overrides, and the staged manifest carries them verbatim
when present. build-platform-packages.mjs strips overrides from the
published wrapper along with dependencies, since they only steer that
helpers install. docs/NPM_PACKAGING.md records both and adds the
override step to the helper-bump runbook.

Tests:
- TestStageLocalControlHelpersCarriesPackageOverrides fails without the
  release.go change: "helper package.json overrides = <nil>, want
  map[...]".
- TestStageLocalControlHelpersOmitsAbsentOverrides keeps absent and
  null overrides out of the staged manifest.
- TestBuildPlatformPackagesAssemblesPublishPayloads now asserts the
  wrapper has no overrides; without the strip it fails with "published
  wrapper has overrides: map[tuistory:map[zod:^4.6.6]]".

A real `zero-release package` run stages zod 4.6.7, hono 4.13.19 and
@hono/node-server 1.19.19, and the vendored tuistory launches, types,
snapshots and closes a session through its relay with zod validating
its flags.
@kevincodex1
kevincodex1 force-pushed the fix/deps-dependabot-alerts branch from b4c1e72 to 7b80f6b Compare November 17, 2026 04:45
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The release staging flow now reads repository npm overrides and includes them in the staged helper manifest when present. The wrapper package builder removes overrides from the published manifest. Tests cover both behaviors, and the packaging runbook describes override use.

Changes

Helper Override Packaging

Layer / File(s) Summary
Stage helper overrides
package.json, internal/release/release.go, internal/release/release_test.go, docs/NPM_PACKAGING.md
Helper staging reads dependency pins and optional overrides, then writes present overrides to the staged manifest. Tests cover nested and top-level overrides, absent overrides, and null overrides. The package manifest pins tuistory’s zod dependency, and the runbook documents override use and removal.
Remove overrides from published wrapper
scripts/npm/build-platform-packages.mjs, internal/npmwrapper/buildpackages_test.go
The wrapper builder removes overrides from the published manifest. The publish-payload test checks that the field is absent.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: anandh8x, pierrunoyt

Merge Risk: Minimal · up to 7b80f

This change resolves the dependency alerts in the bundled terminal helper and carries the needed overrides into release packaging. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: resolving Dependabot alerts in the vendored tuistory helper. The changeset updates the helper lockfile, adds a tuistory-scoped zod override, and carries overrides thro…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: resolving Dependabot alerts in the vendored tuistory helper. The changeset updates the helper lockfile, adds a tuistory-scoped zod override, and carries overrides through staging and packaging. The title is specific and accurate, and the conventional-commit prefix fits. The title is 72 characters, which is within a typical length limit.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between dbfd2ea and 7b80f6b.

Files ignored due to path filters: 1

  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing: 6

  • docs/NPM_PACKAGING.md
  • internal/npmwrapper/buildpackages_test.go
  • internal/release/release.go
  • internal/release/release_test.go
  • package.json
  • scripts/npm/build-platform-packages.mjs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 3 remain after this review.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Zero automated PR review

Verdict: No blockers found

Blockers

  • None found.

Validation

  • [pass] Diff hygiene: git diff --check
  • [pass] Tests: go test ./...
  • [pass] Build: go run ./cmd/zero-release build
  • [pass] Smoke build: go run ./cmd/zero-release smoke

Scope

Head: 7b80f6bdb66d
Changed files (7): docs/NPM_PACKAGING.md, internal/npmwrapper/buildpackages_test.go, internal/release/release.go, internal/release/release_test.go, package-lock.json, package.json, scripts/npm/build-platform-packages.mjs

This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality.

@kevincodex1
kevincodex1 merged commit c4e99cd into main Nov 17, 2026
16 checks passed
kevincodex1 added a commit that referenced this pull request Nov 17, 2026
Dependabot still flags GHSA-rmxm-3fg6-px4f (moderate) on
@hono/node-server 1.19.19 after #1230: serveStatic decodes the request
path a second time, so middleware on a static prefix can be bypassed.
Upstream backported the fix to 1.19.19, but the advisory lists 2.1.3
as the first patched version, so the alert stays open on every 1.x
release.

tuistory asks for ^1.19.9 and @hono/node-ws 1.3.1 (the latest) declares
a ^1.19.11 peer, so no in-range version clears the alert. package.json
now overrides @hono/node-server under tuistory to ^2.1.6, next to the
existing zod override, and the lock resolves 2.1.8. 2.1.6 is the floor
because 2.x before it is still affected by GHSA-jpvv-r467-5p4w.
zero-release package already carries the overrides into the helpers
manifest (#1230).

v2 keeps the public API. tuistory uses createAdaptorServer and attaches
@hono/node-ws to the server's upgrade event; node-ws imports nothing
from @hono/node-server at runtime. The one new requirement is
engines.node >=20 for the helper (Node 18 is end of life, and the
vendored agent-browser already needs 24).

Verified on a real `zero-release package` staging (macOS arm64, Node 24):
npm ci installs @hono/node-server 2.1.8 for both tuistory and
@hono/node-ws with no peer error, and `npm audit` reports 0
vulnerabilities. The vendored tuistory launches, types, waits on and
closes a session through the relay. Its local-only guard still answers
403 to a foreign Host and a cross-origin Origin, on plain requests and
on the /attach WebSocket upgrade. A raw backslash path still gets 400.
/attach upgrades, streams the session buffer, and input sent over the
socket reaches the shell.
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