Repository navigation
fix(deps): resolve the Dependabot alerts in the vendored tuistory helper - #1230
Conversation
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.
b4c1e72 to
7b80f6b
Compare
|
No actionable comments were generated in the recent review. WalkthroughThe 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. ChangesHelper Override Packaging
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Merge Risk:
|
Zero automated PR reviewVerdict: No blockers found Blockers
Validation
ScopeHead: This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality. |
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.
What and why
Addresses the 8 open Dependabot alerts on
main(1 high, 6 moderate, 1 low). All of them come frompackage-lock.json, throughtuistory, which release packaging installs into every artifact as the local-control terminal helper (zero-release packagerunsnpm cifrom this lockfile). So these versions ship to users. The Go side is clean (make vulncheck).There is one commit per package:
fix(deps): refresh the lockfile to hono 4.13.19^4.11.7fix(deps): refresh the lockfile to @hono/node-server 1.19.19^1.19.9and@hono/node-ws's^1.19.11peer rangefix(deps): override tuistory's zod pin to 4.6.7overrides, plus a release staging fixNotes
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.zodto exactly4.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.stageLocalControlHelperswrites its own helperspackage.jsonfrom the dependency pins, copies the repo lockfile beside it, and runsnpm ci. Without the overrides in that manifest, real npm refuses the pair:localControlHelperPins(renamed fromlocalControlHelperDependencies) now reads the repooverridestoo, and the staged manifest carries them verbatim when present.build-platform-packages.mjsstripsoverridesfrom the published wrapper along withdependencies.docs/NPM_PACKAGING.mdrecords both changes and adds the override step to the helper-bump runbook.serveStaticfix to 1.19.19 (see the v1.19.19 release notes;dist/serve-static.jsgains theallowPercentInPathcheck). The advisory still lists2.1.3as the first patched version, so Dependabot andnpm auditkeep flagging 1.19.19. tuistory never callsserveStaticeither 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
TestStageLocalControlHelpersCarriesPackageOverrides. Without therelease.gochange it fails withhelper package.json overrides = <nil>, want map[string]interface {}{"tuistory":map[string]interface {}{"zod":"^4.6.6"}, "ws":"8.18.0"}.TestStageLocalControlHelpersOmitsAbsentOverrides(absent andnullcases).TestBuildPlatformPackagesAssemblesPublishPayloadsnow asserts the published wrapper has nooverrides. Without the strip it fails withpublished wrapper has overrides: map[tuistory:map[zod:^4.6.6]].go run ./cmd/zero-release package(macOS arm64) stages zod 4.6.7, hono 4.13.19 and @hono/node-server 1.19.19 inhelpers/.--colsvalue as before.npm audit --package-lock-onlynow reports only GHSA-rmxm, for the advisory-range reason above.make fmt-check,go vet ./...,go test ./...,go test -raceoninternal/releaseandinternal/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 onmainin files this PR does not touch (internal/tools/web_fetch.go,internal/proxydial/proxydial.go,internal/installtest/workflow_permissions_test.go).maincompleted with 0 findings.Summary by CodeRabbit