Hono v4.13.16

v4.13.16
Changed 3
Fixed 1
  • Rejected JWT signature segments outside the base64url alphabet and headers containing crit.
Security 5
  • Fixed mount() and app.mount() forwarding a path that could bypass middleware scoped inside a dynamic mount prefix, caused by length-based prefix removal and re-normalization of the forwarded path.
  • Fixed RegExpRouter skipping wildcard middleware for a parameter written as {[^/]+} in the middleware path, for a /prefix* route next to /prefix/* middleware, and for paths containing an encoded line terminator.
  • Fixed validator('form') skipping validation for multipart/form-data requests containing extra parameters such as charset.
  • Fixed the css helper not escaping a closing </style> tag assembled from template parts and values; closing tags are now escaped after minification.
  • Fixed csrf() not checking requests sent by hyperlink auditing with the text/ping content type against Origin and Sec-Fetch-Site.

2 changes to check, marked in the notes below

From Hono

Security fixes

This release includes fixes for the following security issues:

mount() and app.mount() can forward a path that bypasses middleware scoped inside the mount prefix

Affects: mount() in hono/mount and app.mount(). A dynamic prefix such as /api/:tenant/* was removed by the length of the route pattern. The forwarded path was also re-normalized by the URL parser, so a decoded \ became / and .. collapsed. Both let a crafted request skip middleware scoped inside the mount prefix. Routes such as /assets* and duplicate parameter names now throw. GHSA-4m76-xfj5-7975 behavior changed · vendor-flagged

RegExpRouter skips wildcard middleware for certain route patterns and for paths with an encoded line terminator

Affects: RegExpRouter, including the default SmartRouter. Wildcard middleware was not applied in three cases: a parameter written as {[^/]+} in the middleware path only, a /prefix* route next to /prefix/* middleware, and a path with an encoded line terminator. RegExpRouter now covers the same routes as the other routers. Custom patterns that can match the empty string, such as {[0-9]*}, throw UnsupportedPathError. Regenerate PreparedRegExpRouter data. GHSA-h7mg-cq63-vhpq behavior changed · vendor-flagged

validator('form') skips validation for multipart/form-data requests with extra parameters

Affects: validator('form') in hono/validator. A multipart/form-data request with an extra parameter such as charset was not recognized as a form. The validator then saw an empty object while the handler could read all fields. GHSA-4h7h-rv7c-7m2v

css helper does not escape a closing tag assembled from template parts and values, allowing HTML injection

Affects: css in hono/css. A </style> split between the template and a value, or between two values, was not escaped. Closing tags are now escaped after minification. GHSA-3gg2-335m-rxc6

csrf() does not check requests sent by hyperlink auditing (text/ping)

Affects: csrf() in hono/csrf. A POST sent by Chromium's <a ping> has the content type text/ping and was not checked against Origin and Sec-Fetch-Site. GHSA-46wx-v44x-9hh2


Users who rely on path-scoped middleware with mount(), wildcard middleware with the default router, validator('form'), the css helper with untrusted values, or csrf() are strongly encouraged to upgrade to this version.

What's Changed

Full Changelog: https://github.com/honojs/hono/compare/v4.13.15...v4.13.16

View original

Upgraded? How did it go?

Discussion