VYPR
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.

PackageAffected versionsPatched versions
hononpm
< 4.12.124.12.12

Affected products

1
  • cpe:2.3:a:hono:hono:*:*:*:*:*:node.js:*:*
    Range: <=4.12.11

Patches

1
9aff14bd727f

Merge commit from fork

https://github.com/honojs/honoTaku AmanoApr 7, 2026via ghsa
2 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

News mentions

0

No linked articles in our index yet.