Packages / @hono/node-server / Security
@hono/node-server: Middleware bypass via repeated slashes in serveStatic
Affected releases · @hono/node-server
- 1.x1.0.0 – 1.19.12Fixed in 1.19.13
- 0.6.x and older0.2.0 – 0.6.0No fix, no longer updated
On 1.x, the newest line:
npm install @hono/node-server@1.19.13Not affected
2.0.0 – 2.1.5
18 releases, latest
Affected
1.0.0 – 1.19.12
70 releases
Fixed
1.19.13 – 1.19.17
4 releases
Affected
0.2.0 – 0.6.0
10 releases
Is your project affected?
Paste your package.json, or type the range you declare for @hono/node-server. It is read in your browser and sent nowhere.
What happens
Summary
A path handling inconsistency in serveStatic allows protected static files to be accessed by using repeated slashes (//) in the request path.
When route-based middleware (e.g., /admin/*) is used for authorization, the router may not match paths containing repeated slashes, while serveStatic resolves them as normalized paths. This can lead to a middleware bypass.
Details
The routing layer and serveStatic handle repeated slashes differently.
For example:
/admin/secret.txt=> matches/admin/*//admin/secret.txt=> may not match/admin/*
This inconsistency allows a request such as:
GET //admin/secret.txt
to bypass middleware registered on /admin/* and access protected files.
Impact
An attacker can access static files that are intended to be protected by route-based middleware by using repeated slashes in the request path.
This can lead to unauthorized access to sensitive files under the static root.
This issue affects applications that rely on serveStatic together with route-based middleware for access control.