Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Five Hono vulnerabilities: code patterns that bypass authentication and the fixed versions

Table of contents · 6 items

If you build APIs with Hono that run on Cloudflare Workers or Node.js and apply authentication middleware by specifying a path such as app.use('/admin/*', 認証), then depending on how routes were written, handlers could run without passing through that middleware. Of the five Hono advisories registered in the GitHub Advisory Database on November 12 (UTC), two are this kind of authentication bypass.

The fixed version, 4.13.16, was published to npm on November 1, and the release notes and advisories were published in the Hono repository the same day. However, they were not registered in the GitHub Advisory Database, which npm audit references, until November 12. Until then npm audit showed no warning, so projects that skipped dependency updates in the first half of November may still be on 4.13.15 or earlier. In addition, 4.13.18 on November 11 fixed four more issues, including a gap in the 4.13.16 fix. This article covers when the five issues apply, the results of sending the same requests to 4.13.15, 4.13.16 and 4.13.18, and what to check before and after updating.

When the five issues apply

These are the conditions and affected versions stated in the advisories. The fixed version for all of them is 4.13.16.

ID (severity)Conditions for being affectedAffected versions
GHSA-h7mg-cq63-vhpq(Moderate)Using the default router (RegExpRouter) and relying on wildcard middleware for authentication4.1.4〜4.13.15
GHSA-4m76-xfj5-7975(Moderate)Using mount() or app.mount() and applying authentication on the outside to paths inside the mounted appAll versions up to 4.13.15
GHSA-4h7h-rv7c-7m2v(Moderate)Validating multipart forms with validator('form') and accepting an empty object4.5.1〜4.13.15
GHSA-46wx-v44x-9hh2(Moderate)Relying on csrf() for CSRF protection, with state-changing URLs that do not depend on the request bodyAll versions up to 4.13.15
GHSA-3gg2-335m-rxc6(Low)Embedding user input immediately after < in a hono/css template3.12.0〜4.13.15

The first is a problem in RegExpRouter, which the default SmartRouter selects for most apps. The advisory lists three cases.

  • When the middleware parameter is written with an explicit pattern such as /api/:tenant{[^/]+}/admin/* and the route is written as /api/:tenant/admin/:id
  • When the middleware is registered with /admin/* and the route with /admin*
  • When the path contains a newline character such as %0A

It does not occur with other routers such as TrieRouter, and new Hono({ router: new TrieRouter() }) is given as a workaround.

The second, mount(), is a problem in the processing that strips the mount prefix. For dynamic prefixes such as /api/:tenant, the length to strip was determined by the length of the route pattern rather than the actual value. Also, from 4.12.21 onward, paths containing %5C (backslash) and .. were normalized into a different path partway through forwarding.

The third and fourth are gaps in validation and CSRF protection. validator('form') did not recognize a request as a form if the Content-Type carried a legitimate parameter other than boundary (such as charset), and passed an empty object to the validation function. Meanwhile, c.req.parseBody() in the handler could still read the body, so unvalidated values reached it as is. csrf() did not inspect Content-Type: text/ping POST requests that Chrome and Edge send via the ping attribute on links.

Sending the same requests to three versions

On November 16, 2026, we installed hono 4.13.15, 4.13.16 and 4.13.18 from npm and called small apps reproducing the advisory conditions with app.request() (Node.js 22.23.4). The authentication middleware simply returns 401 if there is no token. We did not deploy to actual Workers or servers.

Input (no token)4.13.154.13.164.13.18
Authentication on /admin/*, route /admin*. Request to /admin/secret200 (handler ran)401401
Authentication on /api/:tenant{[^/]+}/admin/*. Request to /api/acme/admin/1200401401
Mounted at /app, authentication on /app/admin/*. Request to /app/public%5C..%5Cadmin/secret200 (reached the mounted app)404404
Mounted at /api/:tenant. Request to /api/a/xxxxx/admin/secret200404404
text/ping POST to csrf() from a different origin200 (state changed)403403

Results of sending the same requests to three Hono versions. In 4.13.15, requests reached handlers and mounted apps without passing authentication with both the wildcard middleware and mount patterns, and csrf let text/ping through. In 4.13.16, all were stopped with 401, 404 or 403. validator('form') was bypassed in 4.13.15 when charset was added to the Content-Type and stopped in 4.13.16, but with a space before the semicolon or a trailing semicolon it was still bypassed in 4.13.16 and stopped in 4.13.18

In 4.13.15, as the advisories describe, requests reached handlers and mounted apps without passing through the authentication middleware. In 4.13.16, all of them stop with 401, 404 or 403. We also sent a path (/foo%0Abar) containing %0A, which represents a newline. 4.13.15 returned 404 without running the middleware registered on *, while 4.13.16 ran the middleware and then returned 404.

The gap left in 4.13.16 and the fix in 4.13.18

We tested validator('form') with a validation function that returns 400 if a field called role is present. We sent multipart forms with name and role=admin, changing only how the Content-Type was written.

Content-Type の書き方                        4.13.15  4.13.16  4.13.18
multipart/form-data; boundary=…               400      400      400
multipart/form-data; boundary=…; charset=utf-8 200      400      400
multipart/form-data ; boundary=…(;の前に空白) 200      200      400
multipart/form-data; boundary=…;(末尾に;)     200      200      400

In the rows with 200, the validation function received an empty object, and parseBody() in the handler read role=admin. The charset example given in the advisory is stopped in 4.13.16, but a space before ; or a trailing ; still got through in 4.13.16.

This gap was fixed in 4.13.18, released November 11. Advisory GHSA-92p4-j3wq-jmqx in the Hono repository, as a follow-up to the GHSA-4h7h-rv7c-7m2v fix, lists a space before ;, a trailing ;, and parameter names containing underscores. In addition to validator('form'), validator('json') is also affected, and the affected versions are 4.5.1 to 4.13.17. From 4.13.18, the check uses only the media type before the first ; in the Content-Type.

Three other advisories were also published with 4.13.18 (all Moderate, fixed in 4.13.18).

IDConditions for being affectedAffected versions
GHSA-h25j-2p75-qj33Combining mount() or app.mount() with a custom getPath that adds a prefix (such as a hostname), and applying authentication on the outside to paths inside the mounted app4.13.16〜4.13.17
GHSA-39q9-qp46-w8xgUsing bodyLimit() on Node.js or Bun (even within the limit, a body sent in very small chunks could exhaust memory)4.12.16〜4.13.17
GHSA-74fm-fwc7-3fwpSpecifying allowPercentInPath: true in serveStatic and applying middleware to part of the served directory4.13.11〜4.13.17

GHSA-h25j-2p75-qj33 is a new problem introduced by the mount() fix in 4.13.16. In setups using a custom getPath, simply upgrading to 4.13.16 leaves a path by which requests reach the mounted app without passing authentication.

As of November 20, these four were not registered in the GitHub Advisory Database and had no CVEs assigned. Querying npm's audit API for 4.13.17 also returned no matching vulnerabilities. For this reason, npm audit is unlikely to warn even if you stay on 4.13.16 or 4.13.17.

What to check before and after updating

From here on are the editorial team's suggestions.

  1. Upgrade to 4.13.18 or later. 4.13.16 is the fixed version for the five advisories, but given the four advisories in 4.13.18, aim for 4.13.18 or later. As of November 20, latest is 4.13.19 (released November 16; its release notes mention no security fixes). Do not treat the absence of warnings from npm audit as a reason to postpone updating. Use npm ls hono to check whether an older version is pulled in through a framework or library.
  2. List where authentication is applied. List the places where app.use('…/*', …) handles authentication or permission checks, and the places combined with mount() or app.route(). As the advisory's workaround suggests, applying authentication inside the mounted app makes you independent of how the outer path is handled.
  3. Reject empty objects in validation functions. If your validator('form') or validator('json') functions check required fields, empty objects will not get through. Even after upgrading, it is safer to avoid reading the body separately in the validator and the handler.
  4. Hit the endpoints without a token after updating. In a test environment, send paths like those in the table above (including ones with %5C..%5C or %0A) without a token and confirm they stop with 401 or 404.

The hono/css issue (Low) applies only if you have templates that embed user input immediately after <. We did not reproduce it ourselves. Search for css calls to check whether you have such code.

We introduced how to build Workers APIs with Hono in our article on edge APIs with Hono and Cloudflare Workers. Protection being bypassed because of how paths are written is also covered in our article on Nuxt route rules.

Scope of verification

On November 16, 2026, we reviewed the JSON for the five advisories in github/advisory-database (GHSA-h7mg-cq63-vhpq, GHSA-4m76-xfj5-7975, GHSA-4h7h-rv7c-7m2v, GHSA-46wx-v44x-9hh2, GHSA-3gg2-335m-rxc6), the commits from v4.13.15 to v4.13.18 in the honojs/hono repository, and the npm publication dates (document research). We also sent the same requests with app.request() to hono 4.13.15, 4.13.16 and 4.13.18 installed from npm and compared the results (Node.js 22.23.4). On November 20, we rechecked the five advisories and the advisories in the honojs/hono repository (including the four in 4.13.18) via the GitHub API, the release notes for v4.13.16, v4.13.18 and v4.13.19, and the latest version on npm. We did not verify actual requests on Cloudflare Workers or Node.js servers, submissions via Chrome's ping attribute, the hono/css issue, or the effect of the fixes for the three of the four 4.13.18 issues other than validator.

GleamHub offers development, AI and automation consultations on updating APIs and web apps built with Hono and reviewing how authentication is applied. What needs checking depends on your setup, so please reach out through our contact form.

References

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Starting from what you want to achieve with your website.

We organize user goals, required features, and ongoing maintenance structures to determine the first steps in development and improvement.

  • Website objectives
  • Features and usability
  • Post-launch operations
Consult on web development and improvements

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles via email · Read the web production guide
Free download

Complete Guide to Web Production: Costs, Vendor Selection & Traffic Acquisition [2026 Edition]

We have compiled cost benchmarks, vendor selection criteria, and traffic acquisition strategies into a PDF.

The PDF and newsletter emails are currently in Japanese.

You will also be subscribed to our newsletter. You can unsubscribe at any time.