Medium

Hono: RegExpRouter skips wildcard middleware for some route sets and for paths with an encoded line terminator

  • Disclosed: 12.11.2026
  • Updated: 13.11.2026 01:17

Summary

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:

  1. Middleware whose parameter is written with the explicit default pattern, such as /api/:tenant{[^/]+}/admin/*, was not applied to a route written as /api/:tenant/admin/:id. (since 4.13.0)
  2. Middleware on /admin/* was not applied to a route registered on /admin* for paths under /admin/. (since 4.1.4)
  3. For a path with an encoded line terminator (%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.

Details

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.

Impact

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.

Workarounds

Use new Hono({ router: new TrieRouter() }).

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package hono >= 4.1.4, < 4.13.16 4.13.16

References

CVSS score 5.3/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Weakness (CWE)
CWE-863
Platform
npm
Package
hono
Disclosed
12.11.2026
Updated
13.11.2026 01:17

Sources and licenses

OSV / GitHub Advisory Database - GHSA-h7mg-cq63-vhpq - CC BY 4.0

Vulnerability history: hono

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (57) in the archive
Total entries
57
First → latest
12.2023 11.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 7
  • Medium 45
  • Low 5

Disclosures per year

  1. 2023: 1
  2. 2024: 3
  3. 2025: 4
  4. 2026: 49
Severity:
  1. Hono: RegExpRouter skips wildcard middleware for some route sets and for paths with an encoded line terminator this entry
    Medium · 5.3 CVE-2026-126358 >= 4.1.4, < 4.13.16 4.13.16
  2. High · 8.1 CVE-2025-62610 >= 1.1.0, < 4.10.2 4.10.2
  3. High · 7.5 CVE-2025-58362 >= 4.8.0, < 4.9.6 4.9.6

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.