HONO · GHSA-h7mg-cq63-vhpq · Package
FIX → 4.13.16
Hono's RegExpRouter, the default router for most applications, sometimes fails to apply wildcard middleware to matching routes and to paths containing an encoded line terminator. An unauthenticated client can reach a route handler or the not-found handler without the authentication or authorization middleware registered for it.
first public Nov 1, 2026 · 1 source
Could this affect your app?
Free first check from your website. Connect your repo for the full answer.
Applications that use Hono's RegExpRouter, directly or through the default SmartRouter, and rely on wildcard middleware for authentication or authorization are exposed. Apps on other routers (TrieRouter, LinearRouter, PatternRouter) are not affected by these cases, and apps that do not depend on wildcard middleware for access control face less risk.
Not affected if default-config-not-used, no-wildcard-auth-middleware, trierouter-in-use
Who cares bun, cloudflare-workers, deno, hono, node
npm ls hono and confirm whether it is between 4.1.4 and 4.13.15.app.use('/admin/*', ...)) that handles authentication or authorization, and for routes registered with explicit patterns like :tenant{[^/]+}.SmartRouter or RegExpRouter directly.RegExpRouter, which the default SmartRouter selects for most applications, skipped wildcard middleware in three cases, so a route handler ran without the middleware registered for it:
/api/:tenant{[^/]+}/admin/*, was not applied to a route written as /api/:tenant/admin/:id. (since 4.13.0)/admin/* was not applied to a route registered on /admin* for paths under /admin/. (since 4.1.4)%0A, %0D, %E2%80%A8, %E2%80%A9), no wildcard pattern matched, so the request reached the not-found handler without any wildcard middleware. (since 4.4.0)TrieRouter, LinearRouter and PatternRouter apply the middleware in all three cases.
Check it with your coding agent
It reads this page and tells you if your code is affected.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
Upgrade to 4.13.16
hono 4.13.16new Hono({ router: new TrieRouter() })RegExpRouter decides at registration time which wildcard middleware covers which route. In cases 1 and 2 it treated patterns that match the same requests as different ones. In case 3 the compiled wildcard did not match line terminators.
The fix derives the coverage from the structure of the registered paths and lets wildcards match line terminators. It also corrects other differences from the other routers (a wildcard in the middle of a path with parameters, duplicate middleware, middleware on static routes), and rejects custom patterns that can match the empty string, such as {[0-9]*}, with UnsupportedPathError. PreparedRegExpRouter data must be regenerated.
An unauthenticated client can reach a route handler, or the not-found handler, without the authentication or authorization middleware registered on a wildcard path.
This affects applications that use RegExpRouter, directly or through the default SmartRouter, and rely on wildcard middleware for authentication or authorization.
Use new Hono({ router: new TrieRouter() }).