Hono: `serveStatic` decodes the request path a second time, leading to bypass of middleware on static paths
What fixes it
- 4.13.11hono, npmGitHub
npm install hono@4.13.11
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
Summary
serveStatic decodes the request path a second time after Hono has already decoded it for routing. A crafted request can be routed as one path and served as another, so middleware mounted on a static prefix does not run for a file under that prefix.
Details
Hono decodes the request path once before routing. serveStatic decoded it again before resolving the file. With a malformed percent-encoded sequence, the first decode leaves part of the path encoded, the router matches the encoded form, and the second decode resolves the real directory. The file is still resolved inside the configured root; this is not a traversal outside it.
Impact
An unauthenticated attacker may reach static files without the middleware on their prefix running, for example an authentication check. This affects applications that mount middleware on part of the directory served by serveStatic. Applications that serve only public files are not affected.
Text from GitHub Advisory Database
Affected versions 3
- hono, npm>= 4.12.4, < 4.13.11GitHub
- honoaffected: >= 4.12.4, < 4.13.11CVE List
- hono, npmfrom 4.12.4, fixed in 4.13.11OSV
References 5
- github.com/honojs/hono/commit/8b05c774ef1555c70f5ba5e2991b7e77cc3635ccFixvia CVE List
- github.com/honojs/hono/releases/tag/v4.13.11Fixvia GitHub
- github.com/honojs/hono/security/advisories/GHSA-5r4p-p66f-jhc7Advisoryvia CVE List
- github.com/advisories/GHSA-5r4p-p66f-jhc7Advisoryvia GitHub
- nvd.nist.gov/vuln/detail/CVE-2026-111757Referencevia GitHub