CVE-2026-126357: Hono: `mount()` and `app.mount()` can forward a path that bypasses middleware scoped inside the mount prefix
Summary mount() and app.mount() remove the mount prefix from the request path and forward the rest to the mounted application. Two mistakes in that step let a crafted request reach a route of the mounted application that the outer application protects with path-scoped middleware, such as an authentication check on /app/admin/. The outer application routes on the original path, so the middleware does not run.
Published Nov 12, 2026
Affected packages
hono
- Ecosystem
- npm
- Affected
- < 4.13.16
- Fixed in
- 4.13.16
- Check
npm ls hono
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
mount() and app.mount() remove the mount prefix from the request path and forward the rest to the mounted application. Two mistakes in that step let a crafted request reach a route of the mounted application that the outer application protects with path-scoped middleware, such as an authentication check on /app/admin/*. The outer application routes on the original path, so the middleware does not run.
Details
- Dynamic prefix (all affected versions): for a mount such as
/api/:tenant/*, the prefix was removed by the length of the route pattern, not of the matched prefix. A request with a longer or shorter first segment is cut in the middle, so/api/a/xxxxx/admin/secretreaches the mounted application as/admin/secret. - Re-normalization (since 4.12.21): the forwarded path was built from the decoded request path and assigned to
url.pathname, which turns a decoded backslash into/and collapses.../app/public%5C..%5Cadmin/secretreaches the mounted application as/admin/secret.
The fix removes the prefix segment by segment from the raw pathname, using the matched parameter values for its length. Route patterns that cannot be handled safely now throw: duplicate parameter names and a wildcard inside the last segment such as /assets*. A trailing slash in an app.mount() prefix no longer removes an extra segment.
Impact
An unauthenticated client can reach a route of a mounted application that the outer application protects with path-scoped middleware.
This affects applications that use mount() or app.mount() and rely on middleware registered on a sub-path inside the mount prefix for authentication or authorization.
Workarounds
Register the authentication middleware inside the mounted application.
Credited to KunalShukla-Al, seslo82, kian0417, zachary-satterly.
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. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-126355
Hono: `csrf()` does not check requests sent by hyperlink auditing (`text/ping`)
medium5.3Nov 12, 2026CVE-2026-126356
Hono: `validator('form')` skips validation for `multipart/form-data` requests with extra parameters
medium5.3Nov 12, 2026CVE-2026-126358
Hono: RegExpRouter skips wildcard middleware for some route sets and for paths with an encoded line terminator
medium5.3Nov 12, 2026CVE-2026-126359
Hono: `css` helper does not escape a closing tag split between the template and an interpolated value, allowing HTML injection
low3.4Nov 12, 2026CVE-2026-111757
Hono: `serveStatic` decodes the request path a second time, leading to bypass of middleware on static paths
medium5.3Oct 20, 2026CVE-2026-93981
hono/jsx renders plain strings unescaped in boundary components, leading to XSS
medium4.7Sep 30, 2026
