hono
4.13.19 · 16 Nov 2026MIT113.6M / weekRepositoryHomepagenpmAtom feed
3.12.12 is the newest release of 3.x.
In short
4 breaking1 deprecated17 new3 faster11 fixed17 changed14 internal
- Breaking
There are some breaking changes.
- Breaking
breaking: Obsolete no args
c.req.valid() - Breaking
feat(router) StaticRouter obsolete
- Breaking
adapter: Simplify HandleInterface and reduce bundle size
- Deprecated
@honojsnamespace in the Npm registry is deprecated, but we can use@hono!
Security
44 advisories affect 3.0.0; 4.13.16 fixes them
- Highhono: CORS Middleware reflects any Origin with credentials when `origin` defaults to the wildcardGHSA-88fw-hqm2-52qc · 16 Jun 2026Fixed in 4.12.25
- HighHono vulnerable to arbitrary file access via serveStatic vulnerability GHSA-q5qw-h33p-qvwr · 4 Mar 2026Fixed in 4.12.4
- HighHono JWK Auth Middleware has JWT algorithm confusion when JWK lacks "alg" (untrusted header.alg fallback)GHSA-3vhc-576x-3qv4 · 13 Jan 2026Fixed in 4.11.4
- HighHono JWT Middleware's JWT Algorithm Confusion via Unsafe Default (HS256) Allows Token Forgery and Auth BypassGHSA-f67f-6cw9-8mq4 · 13 Jan 2026Fixed in 4.11.4
- HighHono Improper Authorization vulnerabilityGHSA-m732-5p4w-x69g · 22 Oct 2025Fixed in 4.10.2
39 more
- ModerateHono: `csrf()` does not check requests sent by hyperlink auditing (`text/ping`)GHSA-46wx-v44x-9hh2 · 12 Nov 2026Fixed in 4.13.16
- ModerateHono: `mount()` and `app.mount()` can forward a path that bypasses middleware scoped inside the mount prefixGHSA-4m76-xfj5-7975 · 12 Nov 2026Fixed in 4.13.16
- Moderatehono/jsx renders plain strings unescaped in boundary components, leading to XSSGHSA-hxh3-vqpv-xpqv · 30 Sep 2026Fixed in 4.13.7
- ModerateHono: Incomplete fix for CVE-2026-39408: `toSSG()` still writes files outside the output directoryGHSA-gqvv-2mrq-wpjv · 8 Sep 2026Fixed in 4.13.5
- ModerateHono: Unbounded dot-notation nesting in `parseBody()` can cause memory exhaustionGHSA-g6gw-c38x-mqfc · 8 Sep 2026Fixed in 4.13.5
- ModerateHono: Query parser reads parameters after the URL fragment, causing cache-key and proxy interpretation differentialsGHSA-crvj-82cr-hjcx · 8 Sep 2026Fixed in 4.13.5
- ModerateHono: ReDoS in CORS middleware via Access-Control-Request-HeadersGHSA-8j4g-w8fx-2239 · 3 Aug 2026Fixed in 4.12.34
- Moderatehono: Body Limit Middleware can be bypassed on AWS Lambda by understating `Content-Length`GHSA-rv63-4mwf-qqc2 · 16 Jun 2026Fixed in 4.12.25
- Moderatehono: Lambda@Edge adapter keeps only the last value of a repeated request header, dropping the restGHSA-wgpf-jwqj-8h8p · 16 Jun 2026Fixed in 4.12.25
- Moderatehono: Path traversal in `serve-static` on Windows via encoded backslash (`%5C`)GHSA-wwfh-h76j-fc44 · 16 Jun 2026Fixed in 4.12.25
- Moderatehono: AWS Lambda adapter merges multiple `Set-Cookie` headers into one value, dropping cookies on ALB single-header and LatticeGHSA-j6c9-x7qj-28xf · 16 Jun 2026Fixed in 4.12.25
- ModerateHono: app.mount() strips mount prefix using undecoded path, causing incorrect routing for percent-encoded pathsGHSA-2gcr-mfcq-wcc3 · 4 Jun 2026Fixed in 4.12.21
- ModerateHono: IP Restriction bypasses static deny rules for non-canonical IPv6 GHSA-xrhx-7g5j-rcj5 · 4 Jun 2026Fixed in 4.12.21
- ModerateHono: Cookie helper does not sanitize sameSite and priority, allowing Set-Cookie injectionGHSA-3hrh-pfw6-9m5x · 4 Jun 2026Fixed in 4.12.21
- ModerateHono: JWT middleware accepts any Authorization scheme, not only BearerGHSA-f577-qrjj-4474 · 4 Jun 2026Fixed in 4.12.21
- ModerateHono has CSS Declaration Injection via Style Object Values in JSX SSRGHSA-qp7p-654g-cw7p · 9 May 2026Fixed in 4.12.18
- ModerateHono's Cache Middleware ignores Vary: Authorization / Vary: Cookie leading to cross-user cache leakageGHSA-p77w-8qqv-26rm · 9 May 2026Fixed in 4.12.18
- ModerateHono: bodyLimit() can be bypassed for chunked / unknown-length requestsGHSA-9vqf-7f2p-gf9v · 6 May 2026Fixed in 4.12.16
- Moderatehono/jsx has Unvalidated JSX Tag Names that May Allow HTML InjectionGHSA-69xw-7hcm-h432 · 6 May 2026Fixed in 4.12.16
- Moderatehono Improperly Handles JSX Attribute Names Allows HTML Injection in hono/jsx SSRGHSA-458j-xx4x-4375 · 16 Apr 2026Fixed in 4.12.14
- ModerateHono: Non-breaking space prefix bypass in cookie name handling in getCookie()GHSA-r5rp-j6wh-rvv4 · 8 Apr 2026Fixed in 4.12.12
- ModerateHono has incorrect IP matching in ipRestriction() for IPv4-mapped IPv6 addressesGHSA-xpcf-pg52-r92g · 8 Apr 2026Fixed in 4.12.12
- ModerateHono missing validation of cookie name on write path in setCookie()GHSA-26pp-8wgv-hjvm · 8 Apr 2026Fixed in 4.12.12
- ModerateHono: Middleware bypass via repeated slashes in serveStaticGHSA-wmmm-f939-6g9c · 8 Apr 2026Fixed in 4.12.12
- ModerateHono vulnerable to Prototype Pollution possible through __proto__ key allowed in parseBody({ dot: true })GHSA-v8w9-8mx6-g223 · 11 Mar 2026Fixed in 4.12.7
- ModerateHono Vulnerable to Cookie Attribute Injection via Unsanitized domain and path in setCookie()GHSA-5pq2-9x2x-5p6w · 4 Mar 2026Fixed in 4.12.4
- ModerateHono Vulnerable to SSE Control Field Injection via CR/LF in writeSSE()GHSA-p6xx-57qc-3wxr · 4 Mar 2026Fixed in 4.12.4
- ModerateHono vulnerable to XSS through ErrorBoundary component GHSA-9r54-q6cx-xmh5 · 28 Jan 2026Fixed in 4.11.7
- ModerateHono has an Arbitrary Key Read in Serve static Middleware (Cloudflare Workers Adapter)GHSA-w332-q679-j88p · 27 Jan 2026Fixed in 4.11.7
- ModerateHono cache middleware ignores "Cache-Control: private" leading to Web Cache DeceptionGHSA-6wqw-2p9w-4vw4 · 27 Jan 2026Fixed in 4.11.7
- ModerateHono IPv4 address validation bypass in IP Restriction Middleware allows IP spoofingGHSA-r354-f388-2fhh · 27 Jan 2026Fixed in 4.11.7
- ModerateHono vulnerable to Vary Header Injection leading to potential CORS BypassGHSA-q7jf-gf43-6x6p · 24 Oct 2025Fixed in 4.10.3
- ModerateHono has Body Limit Middleware BypassGHSA-92vj-g62v-jqhh · 12 Sep 2025Fixed in 4.9.7
- ModerateHono allows bypass of CSRF Middleware by a request without Content-Type header.GHSA-2234-fmw7-43wr · 15 Oct 2024Fixed in 4.6.5
- ModerateHono vulnerable to Restricted Directory Traversal in serveStatic with denoGHSA-3mpf-rcc7-5347 · 23 Apr 2024Fixed in 4.2.7
- ModerateNamed path parameters can be overridden in TrieRouterGHSA-f6gv-hh8j-q8vq · 15 Dec 2023Fixed in 3.11.7
- LowHono has improper validation of NumericDate claims (exp, nbf, iat) in JWT verify()GHSA-hm8q-7f3q-5f36 · 9 May 2026Fixed in 4.12.18
- LowHono added timing comparison hardening in basicAuth and bearerAuthGHSA-gq3j-xvxp-8hrf · 19 Feb 2026Fixed in 4.11.10
- LowHono CSRF middleware can be bypassed using crafted Content-Type headerGHSA-rpfr-3m35-5vx5 · 22 Aug 2024Fixed in 4.5.8
Release note
Do Everything, Run Anywhere, But Small, And Faster.
Hono v3.0.0 has been released now! Introduce the new features.
Note
There are some breaking changes. See the migration guide.
HonoRequest
Previously, c.req was an extended Request object. But, the functions and types vary by runtime. So it was causing inconvenience.
Hence, HonoRequest is born.
HonoRequest has Hono-specific functions such as req.param() and req.query, then will wrap the Request object. You can access the original Response object via req.raw. Most functions and properties are bypassed, so you can still use c.req as before.
// c.req is HonoRequest
const id = c.req.param('id')
const query = c.req.query('q')
const data = await c.req.json()
// originalRequest is Request
const originalRequest = c.req.rawPerformance improvement
It is getting 2% - 11% faster. So, Hono is fast.
RegExpRouter becomes the fastest router
RegExpRouter become the fastest router in the JavaScript world which includes such "find-my-way" used in Fastify.
You can find the benchmark scripts.
Good-bye StaticRouter
Thanks to the faster RegExpRouter, StaticRouter is no longer needed. Obsolete. Good-bye StaticRouter!
New Validator
The previous Validator Middleware is obsolete and you can use the new validator. Its validator is very thin and we recommend using it with a third-party validator.
If you want to use Zod, now, we have "Zod Validator Middleware".
import { zValidator } from '@hono/zod-validator'
import { Hono } from 'hono'
import { z } from 'zod'
const app = new Hono()
app.post(
'/posts',
zValidator(
'json',
z.object({
id: z.number(),
title: z.string(),
})
),
(c) => {
const { id, title } = c.req.valid('json')
return c.text(`${id} is ${title}!`)
}
)RPC
Then, we'll show you the magic.
user-images.githubusercontent.com/10682/2194106…
We've made the HTTP client which is called hc. API specs can be shared as types between the API server and the client. It is like tRPC, but easier to handle due to its being integrated.
To enable RPC mode, simply change json() to jsonT() and share the endpoint type.
// server.ts
const route = app.post(
'/posts',
zValidator(
'json',
z.object({
id: z.number(),
title: z.string(),
})
),
(c) => {
const { id, title } = c.req.valid('json')
// ...
return c.jsonT(
{
success: true,
message: 'created!',
},
201
)
}
)
export type AppType = typeof routeOn the client side, import the type and pass it to hc() as a generics.
import { hc } from 'hono/client'
import type { AppType } from './index'
const client = hc<AppType>('/api')Now it is ready for use. See it.
SC
Adapter
Hono is also suitable for running in functions of Cloudflare Pages or in Edge Functions of Next.js. To make them easier, you can use the "Adapter".
// pages/api/[...route].ts
import { Hono } from 'hono'
import { handle } from 'hono/nextjs'
export const config = {
runtime: 'edge',
}
const app = new Hono()
app.get('/hello', (c) => {
return c.json({
message: 'Hello from Hono!',
})
})
export default handle(app, '/api')The combination of this adapter and RPC is powerful. You can write the REST API on the Edge Functions and write the React applications with hc.
Also, ServeStatic Middleware has been obsolete and the feature of serving static files is now provided via an Adapter.
import { Hono } from 'hono'
import { serveStatic } from 'hono/cloudflare-workers'
const app = new Hono()
app.get('/static/*', serveStatic({ root: './' }))
app.get('/favicon.ico', serveStatic({ path: './favicon.ico' }))HTTPException
The new HTTPException makes your application safer.
Multi-runtime CI support
Hono works on most JavaScript runtimes. It becomes to be tested on the CI for the following five runtimes.
Support WinterCG Runtime Keys
Hono is following WinterCG and will be "de fact standard for Web Standard". Now, c.runtime() supports WinterCG's Runtime Keys.
app.get('/', (c) => {
if (c.runtime === 'workerd') {
return c.text('You are on Cloduflare')
} else if (c.runtime === 'bun') {
return c.text('You are on Bun')
}
...
})Available runtime keys are below.
nodedenobunworkerd- Cloudflare Workersfastlyedge-light- Vercel Edge Functionslagonother
create-hono
You can create the Hono application with one command and launch the application in 30 seconds!
npm create hono@latest my-app
SS
@honojs to @hono
@honojs namespace in the Npm registry is deprecated, but we can use @hono! So each Middleware is now renamed as follows.
And Node.js adapter becomes @hono/node-server.
New middleware
Adding them, we can use these new middleware.
@hono/trpc-server- tRPC Server Middleware@hono/qwik-city- Qwik City Middleware@hono/zod-validator- Zod Validator Middleware
New website
Finally, we have to tell you about it. We have the new website with an ultra cool domain name.
hono.dev!!
Not only the domain but has been changed from Hugo-based to VitePress-based, making it easier to contribute.
Wrap-up
Many new features. Enjoy and share!
All Changes
request: Make optional param type correct
Use
substringand//.test...bun: Fixed throwing the error in
HTTPExceptionvalidator: Support multiple handlers w/ complex patterns.
req: Support
c.req.valid('query')context: Set the header values of already set
context: Fixed bug raw
Responsecontent-type is overwrittenMissing mime types
cloudflare-pages: Fix type incompatibility
reg-exp-router: Lookup static path by using Object
Rename runtime keys
Rewnew output types
- Breaking
breaking: Obsolete no args
c.req.valid() req:
neverifc.req.valid()context: Improve handling response
Fix 404 error on Serve Static Middleware
serve-static: Decode url pathname
reg-exp-router: Cache Result<T> instead of T if there is no parameter.
hc- Hono ClientUse added app's errorHandler
Revert "feat: use added app's errorHandler (#871)"
Remove the StaticRouter from default candidates.
- Breaking
feat(router) StaticRouter obsolete
Use added app's errorHandler with comose()
Merge main into next
adapter:
handle(path, app)for CF Pages & Next.jsvalidator: Moved validator outside of middleware
- Breaking
adapter: Simplify HandleInterface and reduce bundle size
app: Support multiple methods withapp.on()Move http-exception out of utils
deno: Allow
{}forapp.fetchfo compatibilityHeader may return undefined
req: Query return type as
string | undefinedChange the arg
InferResponseTypereceivesclient: Introduce
Fetchtypejsx: Declare types for JSX correctly
v3
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.