hono
4.13.19 · 16 Nov 2026MIT113.6M / weekRepositoryHomepagenpmAtom feed
3.12.12 is the newest release of 3.x.
In short
2 deprecated13 new2 faster12 fixed10 changed6 internal
- Deprecated
And
c.req.cookie()andc.cookie()are deprecated and will be removed in the next major version, v4. - Deprecated
Cookie Middleware and deprecate
c.req.cookie()/c.cookie()
Security
44 advisories affect 3.2.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
New routers, presets,
app.mount(), Node server v1. Let's go!
Hono v3.2 is now available! It introduces many features while maintaining simplicity.
Two new routers: LinearRouter and PatternRouter.
Presets:
hono/tiny,hono/quick.app.mount()Release of Node adapter server v1.0.0!
Support for AWS Lambda function URLs.
Cookie Middleware.
Renaming
hono/nextjstohono/vercel.
Let's take a look!
New Routers
We introduce two new routers: LinearRouter and PatternRouter.
LinearRouter
LinearRouter is "quick". While RegExpRouter is one of the fastest routers in the JavaScript world, it's a bit slow when registering routing paths.
app.get('/', handler) // <=== Registering routing paths - a little slow
//...
app.fetch(request) // <=== Handle request - ultra-fastSo, in environments that are initialized with every request, such as Fastly Compute@Edge, RegExpRouter may not be the best choice.
LinearRouter registers routes very quickly, even compared to other fast JavaScript routers. The following is one of the benchmark results, which includes the route registration phase.
• GET /user/lookup/username/hey ----------------------------------------------------- ----------------------------- LinearRouter 1.82 µs/iter (1.7 µs … 2.04 µs) 1.84 µs 2.04 µs 2.04 µs MedleyRouter 4.44 µs/iter (4.34 µs … 4.54 µs) 4.48 µs 4.54 µs 4.54 µs FindMyWay 60.36 µs/iter (45.5 µs … 1.9 ms) 59.88 µs 78.13 µs 82.92 µs KoaTreeRouter 3.81 µs/iter (3.73 µs … 3.87 µs) 3.84 µs 3.87 µs 3.87 µs TrekRouter 5.84 µs/iter (5.75 µs … 6.04 µs) 5.86 µs 6.04 µs 6.04 µs summary for GET /user/lookup/username/hey LinearRouter 2.1x faster than KoaTreeRouter 2.45x faster than MedleyRouter 3.21x faster than TrekRouter 33.24x faster than FindMyWay
And according to this comment, it will be 40% faster on Fastly Compute@Edge.
PatternRouter
PatternRouter is "tiny". By default, Hono uses SmartRouter with RegExpRouter and TrieRouter. Although not the fastest, we made it even smaller.
If you need to reduce size for resource-limited environments, you can use PatternRouter.
An application using only PatternRouter is about 12KB in size.
yusuke $ esbuild --outdir=dist --bundle --minify ./src/index.ts dist/index.js 11.9kb ⚡ Done in 9ms
Presets: hono/tiny, hono/quick
Hono has several routers, each designed for a specific purpose. You can specify the router you want to use in the Hono constructor.
Presets are provided for common use cases, so you don't have to specify the router each time. The Hono class imported from all presets is the same, the only difference being the router. Therefore, you can use them interchangeably.
We introduce hono/tiny and hono/quick today.
hono/tiny
Preset hono/tiny means using only PatternRouter.
this.router = new PatternRouter()
To use hono/tiny, you only have to import hono/tiny and use Hono as usual.
import { Hono } from 'hono/tiny'
const app = new Hono()
//...hono/quick
Preset hono/quick means using only LinearRouter.
this.router = new LinearRouter()
You can also use hono/quick like other presets.
import { Hono } from 'hono/quick'Which preset should I use?
We now offer three presets: hono, hono/tiny, and hono/quick. You might be wondering, "Which preset should I use?" Please refer to the followings.
| Preset | Suitable platforms |
|---|---|
hono | This is highly recommended for most use cases. Although the registration phase may be slower than hono/quick, it exhibits high performance once booted. It's ideal for long-life servers built with Deno, Bun, or Node.js. For environments such as Cloudflare Workers, Deno Deploy, Lagon, where v8 isolates are utilized, this preset is suitable too. Because the isolates persist for a certain amount of time after booting. |
hono/quick | This preset is designed for environments where the application is initialized for every request. Fastly Compute@Edge operates in this manner, thus this preset is recommended for use it. |
hono/tiny | This is the smallest router package and is suitable for environments where resources are limited. |
app.mount()
By using new feature app.mount(), you can integrate applications using other frameworks, such as itty-router, with Hono.
// Create itty-router application
const ittyRouter = IttyRouter()
// Handle `GET /itty-router/hello`
ittyRouter.get('/hello', () => new Response('Hello from itty-router!'))
// Hono application
const app = new Hono()
// Hono application
app.mount('/itty-router', ittyRouter.handle)Also Remix:
import { Hono } from 'hono'
import { env } from 'hono/adapter'
import { serveStatic } from 'hono/cloudflare-workers'
import { createRequestHandler } from '@remix-run/cloudflare'
import * as build from './build'
// Remix application
// @ts-ignore
const handleRemixRequest = createRequestHandler(build, process.env.NODE_ENV)
// Hono application
const app = new Hono()
// Static files for Remix
app.get(
'/remix/build/*',
serveStatic({
root: './',
})
)
// Mount Remix app
app.mount('/remix', handleRemixRequest, (c) => {
return { env: env(c) }
})This implies that we can mount applications built with any framework, such as itty-router, Remix, Qwik, or SolidJS, into our Hono application.
Ecosystem
With this implementation, we introduce two concepts: adapt and mount. Adapt refers to Hono's ability to adapt to any runtime, while mount implies that Hono can integrate with any framework. Along with middleware, these capabilities allow us to create a comprehensive ecosystem, as depicted below:
SS
With these special features, Hono will not just be a web framework, it will be like a "Glue".
One of the greatest aspects of this concept is that the framework does not have to create individual adapters for various platforms such as Cloudflare Worker, Cloudflare Pages, Vercel, Deno, and Bun.
SS
If your framework is based on the Web Standard API, there is no additional work required. Hono can mount it and enable your framework to run on any runtime.
SS
Furthermore, we can use Hono's middleware for other frameworks. For example, to add Basic authentication to an application built with ittry-router, there's no need to implement it from scratch. Just add Hono's middleware.
app.use('/another-app/admin/*', basicAuth({ username, password }))This is the ecosystem we wanted creating.
Node.js adapter server v1.0.0 has been released
The first major release of the Node.js adapter server, "v1.0.0", is now available! This version uses only the native Web Standard APIs available in Node.js v18 or higher. The size has been significantly reduced and this means we are really following to Web Standard APIs.
SS
You can start using it right away by installing it from npm.
npm install @hono/node-server
Then, simply import the serve function and adapt it to your Hono application.
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hono meets Node.js'))
serve(app, (info) => {
console.log(`Listening on http://localhost:${info.port}`)
})Support for routing includes a hostname
The new getPath() function now supports routing that includes a hostname.
const app = new Hono({
getPath: (req) => req.url.replace(/^https?:\/\//, ''),
})
app.get('www1.example.com/hello', (c) => c.text('hello www1'))
app.get('www2.example.com/hello', (c) => c.text('hello www2'))With getPath(), you can also handle the host header value for routing.
const app = new Hono({
getPath: (req) => req.headers.get('host') + req.url.replace(/^https?:\/\/[^\/]+/, ''),
})
app.get('www1.example.com/hello', (c) => c.text('hello www1'))
// The following request will match the route:
// new Request('http://www1.example.com/hello', {
// headers: { host: 'www1.example.com' },
// })Support for AWS Lambda functions URLs
The AWS Lambda adapter now supports Lambda functions URLs.
Cookie Middleware
We're introducing a new Cookie Middleware.
import { getCookie, setCookie } from 'hono/cookie'
// ...
app.get('/cookie', (c) => {
const yummyCookie = getCookie(c, 'yummy_cookie')
// ...
setCookie(c, 'delicious_cookie', 'macha')
//
}And c.req.cookie() and c.cookie() are deprecated and will be removed in the next major version, v4.
hono/nextjs to hono/vercel
We've created hono/vercel and deprecated hono/nextjs. hono/nextjs will be removed in v4.
Other updates
rewriteRequestPathoption for the serve-staticapp.routerNameSupport for clearing response headers
Remove HTTP status messages from
http-status.tsPerformance improvements
Bug fixes
All changes
Shorten code
Use
===instead ofstartsWithandendsWithdeno: Export
HTTPExceptionfrommod.tsadapter: Added aws-handler support for APIGatewayProxyEventV2
Allow getPath to be replaced.
serve-static:
rewriteRequestPathoption for Workers/Deno/Bunjsx: Fix a
jsx-runtimebugcontext: Clear the header with
c.header(key, undefined)- Deprecated
Cookie Middleware and deprecate
c.req.cookie()/c.cookie() adapter: Add
hono/vercel/ deprecatehono/nextjsEnable specifying router from args
context: Enable extending
ContextVarableMappreset: Add
hono/quickRemove
type.tsgetQueryParam: Fixed a bug in getQueryParam when a partial matching key was found.
adapter: AWS Lambda Adapter supports requests via Lambda Function URLs.
lambda: Don't encode text
cloudflare-workers: serveStatic
rewriteRequestPathoptionapp:
onError()supports asynctypes: Set
/for genericsbasePathdeno: Export cookie middleware
app: Export
fire()correctlyapp:
app.routerName()app.mount()preset: Fix constructor args
router:
PatternRoutersupports a hostname, added testsv3.2
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.