All vulnerabilities

npm

CVE-2026-126358

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

Severity
Medium 5.3
Published
12 Nov 2026
Last changed
12 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
4.13.16
Exploit chance
0.4% in the next 30 daysHigher than 30% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Incorrect authorization (CWE-863)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read some data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Also known as
GHSA-h7mg-cq63-vhpq
Sources
OSV.dev and GitHub

Description

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:

  • 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)
  • Middleware on /admin/ was not applied to a route registered on /admin for paths under /admin/. (since 4.1.4)
  • 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.

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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

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

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
hononpm · osv:npm:hono
  • From 4.1.4 before 4.13.16

About hono

Weekly downloads (npm)
113,589,642npm, 23 Nov 2026

References