NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-118663: @hono/node-server: `serveStatic` decodes the request path a second time, leading to bypass of middleware on static paths

mediumCVSS 3.1 5.3GHSA-rmxm-3fg6-px4f

`serveStatic` in `@hono/node-server` decodes the request path a second time after Hono has already decoded it for routing. A request with a malformed percent-encoded sequence can match one route and serve a different file, so middleware on a static prefix, such as an auth check, does not run. Versions 1.19.10 up to 2.1.3 are affected. Upgrade to 2.1.3.

Published Oct 28, 2026 · Analysis Nov 1, 2026

What an attacker can do

Hono decodes the request path once before routing. serveStatic then decoded it again before it resolved the file. With a malformed percent-encoded sequence, the first decode leaves part of the path still encoded. The router matches that encoded form, which does not fall under the protected prefix. The second decode then turns it into the real directory name and the file is served.

The advisory states that the file is still resolved inside the configured root, so this is not a directory traversal out of that folder. The damage is a bypass of middleware attached to part of the static directory. An unauthenticated attacker can fetch files under a prefix that was meant to require a login or other check, with no user interaction.

Only apps that mount middleware on a sub-path of the directory serveStatic serves are exposed. Apps that serve only public files are not affected. The CVSS vector rates a low confidentiality impact, since the attacker only reads files the app already ships in the static root.

Who is affected

Affected: @hono/node-server from 1.19.10 up to but not including 2.1.3. You are exposed if you use serveStatic and put middleware, for example authentication, on a prefix inside the served directory.

Check your version:

npm ls @hono/node-server

@hono/node-server

Ecosystem
npm
Affected
>= 1.19.10, < 2.1.3
Fixed in
2.1.3
Check
npm ls @hono/node-server

How to fix it

Upgrade to @hono/node-server 2.1.3:

npm install @hono/[email protected]

The fix is in commit 9821792 and the v2.1.3 release. The advisory lists no workaround. If you cannot upgrade, do not keep private files in a directory served by serveStatic; move them out of the static root or serve them through a normal route that checks access in the handler.

How to tell if you were hit

Search access logs for requests to your static prefixes that contain malformed percent sequences, for example a % not followed by two hex digits, or double-encoded segments. Compare them with the authentication logs: a 200 on a protected static file with no matching auth check indicates a bypass. You can also test your own app with a request that adds a broken percent sequence in the protected prefix.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

serveStatic decodes the request path a second time after Hono has already decoded it for routing. A crafted request can be routed as one path and served as another, so middleware mounted on a static prefix does not run for a file under that prefix.

Details

Hono decodes the request path once before routing. serveStatic decoded it again before resolving the file. With a malformed percent-encoded sequence, the first decode leaves part of the path encoded, the router matches the encoded form, and the second decode resolves the real directory. The file is still resolved inside the configured root; this is not a traversal outside it.

Impact

An unauthenticated attacker may reach static files without the middleware on their prefix running, for example an authentication check. This affects applications that mount middleware on part of the directory served by serveStatic. Applications that serve only public files are not affected.

Credited to manop55555.

Questions

Does this allow reading files outside the static root?

No. The advisory says the file is still resolved inside the configured root and that this is not a traversal outside it. Only middleware on a sub-path is bypassed.

Is my Hono app affected if I only serve public files?

No. The advisory says applications that serve only public files are not affected.

Which version fixes the serveStatic double decoding?

@hono/node-server 2.1.3. The vulnerable range starts at 1.19.10.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More npm vulnerabilities

All npm entries