Skip to content

chore(deps): upgrade @hono/node-server to 2.0.12 - #1832

Merged
cliffhall merged 2 commits into
mainfrom
fix/hono-node-server-path-traversal
Jul 28, 2026
Merged

chore(deps): upgrade @hono/node-server to 2.0.12#1832
cliffhall merged 2 commits into
mainfrom
fix/hono-node-server-path-traversal

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Clears GHSA-frvp-7c67-39w9 (2 Dependabot alerts, medium).

What the flaw actually is

Path traversal in serve-static on Windows via an encoded backslash (%5C), affecting < 2.0.5. The Inspector calls the flagged function directly — clients/web/server/server.ts:95 mounts serveStatic at /* in the prod web server.

But the exposure here is essentially nil, and the summary line reads worse than the flaw is. Being precise, because "path traversal in the thing we ship" invites an overreaction:

  • .. escapes remain blocked. The advisory only allows reaching files inside the configured root.
  • The mechanism is slipping past prefix-mounted middleware (e.g. /admin/*) to reach a protected subdirectory.
  • Here root is config.staticRoot ?? __dirname — the built SPA. Everything in it is public by design.
  • The only prefix middleware is app.use("/api/*", …), a separate route, not a subdirectory of the static root. serveStatic never serves /api.
  • Windows-only regardless.

So there is no auth bypass and no arbitrary file read to fix. This is hygiene — clearing a real alert against a dependency we genuinely use — not an incident, and it did not gate the 2.0.0 release.

Why the major bump is safe

v2.0.0's breaking changes are narrow:

Change Impact here
Node 18 dropped, requires ≥ 20 None — repo already requires >=22.19.0
Vercel adapter removed None — unused
serve() API Unchanged
serveStatic, ServerType Unchanged

That is the entire import surface in this repo — the prod server plus ~15 integration tests, all importing only serve, serveStatic, or the ServerType type.

Verification

  • npm install clean; 2.0.12 resolved
  • tsc -b on clients/web passes — the integration tests typecheck against the new major
  • npm run validate passes — all four clients: format, lint, typecheck, build, tests

Lockfile diff is scoped to this dependency; unrelated libc churn from a newer local npm was reverted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Txmv2qqv3yeKgRzoqXytzD

cliffhall and others added 2 commits July 27, 2026 23:33
CodeQL alert #64 (`actions/missing-workflow-permissions`, medium) on
`.github/workflows/main.yml`: no `permissions` block, so every job inherits the
repository's default GITHUB_TOKEN scope, which is broader than anything here
needs.

It matters more than the severity suggests because this is the workflow that
publishes to npm under OIDC — an over-permissioned token in a job that mints
publish credentials is worth tightening before 2.0.0 ships (#1818).

Adds a workflow-level `permissions: contents: read`. The `publish` and
`publish-github-container-registry` jobs already declare their own blocks
(`id-token: write` and friends) and are unaffected: job-level permissions
override the workflow-level default outright rather than merging with it. The
comment records that, since it means each publish job must keep listing every
scope it needs — including `contents: read` — and a future edit that trims one
"because it's inherited" would break the publish.

Surfaced by the v2 tree swap (#1817): `main` had never scanned this workflow
before. Pre-existing on `v2/main`, not introduced by that merge.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Txmv2qqv3yeKgRzoqXytzD
Clears GHSA-frvp-7c67-39w9 (2 Dependabot alerts): path traversal in
`serve-static` on Windows via an encoded backslash, affecting < 2.0.5. The
Inspector's prod web server calls the flagged function directly
(`clients/web/server/server.ts` mounts `serveStatic` at `/*`).

Worth being precise about the actual exposure, since the summary line reads
worse than the flaw is: `..` escapes remain blocked, so it only reaches files
*inside* the configured root, by slipping past prefix-mounted middleware. Here
`root` is the built SPA — everything in it is public by design — and the only
prefix middleware (`/api/*`) is a separate route, not a subdirectory of that
root. So there was no auth bypass and no arbitrary file read to fix; this is
hygiene, not an incident.

The 1.x → 2.x majors turn out to be a non-event for this codebase: v2 drops
Node 18 (the repo already requires >=22.19.0) and removes the Vercel adapter
(unused). `serve`, `serveStatic`, and `ServerType` — the entire import surface
here, across the prod server and ~15 integration tests — are unchanged.

`npm run validate` passes on all four clients.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Txmv2qqv3yeKgRzoqXytzD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant