Hono: RegExpRouter skips wildcard middleware for some route sets and for paths with an encoded line terminator
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:
- 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.
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() }).
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de npm | hono | >= 4.1.4, < 4.13.16 | 4.13.16 |
Referencias
- Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N- Debilidad (CWE)
CWE-863- Plataforma
- npm
- Paquete
hono- Publicada
- 12.11.2026
- Actualizado
- 13.11.2026 01:17
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-h7mg-cq63-vhpq - CC BY 4.0
Historial de vulnerabilidades: hono
Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 57
- Primera → última
- 12.2023 11.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Alta 7
- Media 45
- Baja 5
Divulgaciones por año
- 2023: 1
- 2024: 3
- 2025: 4
- 2026: 49
-
Hono: RegExpRouter skips wildcard middleware for some route sets and for paths with an encoded line terminator esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.