TrieRouter matches a path that only starts or ends with an alternative of a constrained parameter, leading to middleware bypass in `except()`.

MediumGHSA-586x-c76g-h52826 Nov · 4 days ago
Source

Does it affect you?

0/2All must holdTicks stay in this browser
Conditions read by Gemini. The sources remain the reference.Maintainer advisory

Timeline

26 Nov
3 daysahead of the GitHub database so far
  1. Published by the maintainer in honojs/hono26 Nov, 21:24 UTC
  2. Seen by Patchwire +5 h27 Nov, 02:52 UTC
  3. Not in the GitHub database 3 days later30 Nov, 01:25 UTC
honoafter 5.0.0-rc.14.13.23

Versions of hono

4.x
safe 4.13.23
AffectedSafe

Packages

Stacks

Related alerts(8)

Same packages
Medium
Exploitable only if · read by Gemini, the source remains the reference
  • The application runs on Bun.
  • A reverse proxy that restricts access by path passes a request without a usable Host header to the application.
Affected
hono <4.13.23 · hono >=5.0.0-rc.0 <=5.0.0-rc.1
Fixed in
after 5.0.0-rc.1 · 4.13.23
ID
GHSA-mhwf-w6q6-q58w
Open the alert
Medium
Exploitable only if · read by Gemini, the source remains the reference
  • TrieRouter is in use.
  • The application accepts arbitrary method names, for example with HTTP/2 on Node.js or with hono/method-override.
Affected
hono >=4.8.0 <4.13.23 · hono >=3.11.7 <4.1.2 · hono >=5.0.0-rc.0 <=5.0.0-rc.1
Fixed in
after 5.0.0-rc.1 · 4.13.23 · 4.1.2
ID
GHSA-656w-x92q-369m
Open the alert
Medium
Exploitable only if · read by Gemini, the source remains the reference
  • Hono version is 4.13.16 or 4.13.17.
  • Application uses mount() or app.mount().
  • Application uses a custom getPath that prepends a prefix to the routed path (e.g., host name for host-based routing).
  • Application relies on middleware registered on a sub-path inside the mount prefix for authentication or authorization.
Affected
hono >=4.13.16 <=4.13.17
Fixed in
4.13.18
ID
GHSA-h25j-2p75-qj33
Open the alert
Medium
Exploitable only if · read by Gemini, the source remains the reference
  • Application uses Hono's validator('json') or validator('form') middleware.
  • The application relies on that validator to reject or restrict request fields (allow-list or required-field checks).
  • The validation callback does not fail when given an empty object.
  • The route handler reads the request body directly via c.req.json() or c.req.parseBody().
Affected
hono >=4.5.1 <=4.13.17
Fixed in
4.13.18
ID
GHSA-92p4-j3wq-jmqx
Open the alert
Medium
Conditions could not be extracted

Source summary

Since 4.12.16, bodyLimit() reads the whole request body before the handler runs so that the limit also applies to chunked requests. It kept every chunk delivered by the runtime as a separate array and later replayed them. A client that sends the body in very small transfer chunks makes the middleware retain millions of small arrays for a body that is within the configured limit. The memory used is many times the body size, and the process can be terminated before the handler runs. The size check counted the payload bytes correctly, so the configured maxSize was respected. The problem is the…

Affected
hono >=4.12.16 <=4.13.17
Fixed in
4.13.18
ID
GHSA-39q9-qp46-w8xg
Open the alert
Medium
Exploitable only if · read by Gemini, the source remains the reference
  • Uses Hono's serveStatic to serve a directory.
  • serveStatic is configured with allowPercentInPath: true.
  • Middleware (e.g., an authentication check) is mounted on a prefix that covers part of the directory served by serveStatic.
Affected
hono >=4.13.11 <=4.13.17
Fixed in
4.13.18
ID
GHSA-74fm-fwc7-3fwp
Open the alert
Medium
Exploitable only if · read by Gemini, the source remains the reference
  • Application relies on the csrf() middleware as its CSRF protection.
  • Application exposes state-changing POST endpoints whose effect does not depend on the request body (selected by path or query string).
  • Session cookie is sent cross-site: set with SameSite=None, or the attacker controls a same-site origin (cookie not SameSite=Strict).
  • Victim uses Chrome or Edge (hyperlink auditing enabled) while logged in.
Affected
hono <4.13.16
Fixed in
4.13.16
ID
GHSA-46wx-v44x-9hh2
Open the alert
Medium
Exploitable only if · read by Gemini, the source remains the reference
  • Application uses Hono's validator('form') middleware.
  • Application accepts multipart/form-data requests on routes guarded by validator('form').
  • The validator('form') callback does not fail when given an empty object.
  • Application relies on validator('form') to reject, restrict, or require form fields.
  • The handler reads submitted fields via c.req.parseBody() or c.req.formData().
Affected
hono >=4.5.1 <=4.13.15
Fixed in
4.13.16
ID
GHSA-4h7h-rv7c-7m2v
Open the alert