Medium severity5.3NVD Advisory· Published Apr 8, 2026· Updated Apr 21, 2026
CVE-2026-39407
CVE-2026-39407
Description
Hono is a Web application framework that provides support for any JavaScript runtime. Prior to 4.12.12, a path handling inconsistency in serveStatic allows protected static files to be accessed by using repeated slashes (//) in the request path. When route-based middleware (e.g., /admin/*) is used for authorization, the router may not match paths containing repeated slashes, while serveStatic resolves them as normalized paths. This can lead to a middleware bypass. This vulnerability is fixed in 4.12.12.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
hononpm | < 4.12.12 | 4.12.12 |
Affected products
1Patches
12 files changed · +5 −2
src/middleware/serve-static/index.test.ts+4 −1 modified@@ -264,7 +264,7 @@ describe('Serve Static Middleware', () => { }) app.get('*', serveStatic) - const res = await app.request('///etc/passwd') + const res = await app.request('/etc/passwd') expect(await res.text()).toBe('Hello in etc/passwd') }) @@ -289,6 +289,9 @@ describe('Serve Static Middleware', () => { const res2 = await app.request('/admin%2Fsecret.txt') expect(res2.headers.get('X-Authorized')).toBeNull() expect(await res2.text()).toBe('Hello in admin%2Fsecret.txt') + + const res3 = await app.request('//admin/secret.txt') + expect(res3.status).toBe(404) }) }) })
src/middleware/serve-static/index.ts+1 −1 modified@@ -64,7 +64,7 @@ export const serveStatic = <E extends Env = Env>( } else { try { filename = tryDecodeURI(c.req.path) - if (/(?:^|[\/\\])\.\.(?:$|[\/\\])/.test(filename)) { + if (/(?:^|[\/\\])\.{1,2}(?:$|[\/\\])|[\/\\]{2,}/.test(filename)) { throw new Error() } } catch {
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/honojs/hono/commit/9aff14bd727f8b0435c963363fd803260e7b8e3cnvdPatchWEB
- github.com/advisories/GHSA-wmmm-f939-6g9cghsaADVISORY
- github.com/honojs/hono/security/advisories/GHSA-wmmm-f939-6g9cnvdVendor AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2026-39407ghsaADVISORY
- github.com/honojs/hono/releases/tag/v4.12.12nvdRelease NotesWEB
News mentions
0No linked articles in our index yet.