{"id":"CVE-2026-39407","aliases":["GHSA-wmmm-f939-6g9c"],"url":"https://o3.security/vulnerability/CVE-2026-39407","summary":"Hono has a middleware bypass via repeated slashes in serveStatic","details":"## Summary\n\nA path handling inconsistency in `serveStatic` allows protected static files to be accessed by using repeated slashes (`//`) in the request path.\n\nWhen 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.\n\n## Details\n\nThe routing layer and `serveStatic` handle repeated slashes differently.\n\nFor example:\n\n```\n/admin/secret.txt => matches /admin/*\n/admin//secret.txt => may not match /admin/*\n```\n\nHowever, `serveStatic` may interpret both paths as the same file location (e.g., `admin/secret.txt`) and return the file.\n\nThis inconsistency allows a request such as:\n\n```\nGET //admin/secret.txt\n```\n\nto bypass middleware registered on `/admin/*` and access protected files.\n\nThe issue has been fixed by rejecting paths that contain repeated slashes, ensuring consistent behavior between route matching and static file resolution.\n\n## Impact\n\nAn attacker can access static files that are intended to be protected by route-based middleware by using repeated slashes in the request path.\n\nThis can lead to unauthorized access to sensitive files under the static root.\n\nThis issue affects applications that rely on serveStatic together with route-based middleware for access control.","published":"2026-04-08T14:41:20.301Z","modified":"2026-08-12T03:51:08.490001240Z","cvss":{"score":5.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"hono","fixedVersion":"4.12.12"}],"fix":{"url":"https://github.com/honojs/hono/commit/9aff14bd727f8b0435c963363fd803260e7b8e3c","label":"honojs/hono@9aff14b"},"references":[{"type":"WEB","url":"https://github.com/honojs/hono/releases/tag/v4.12.12"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/39xxx/CVE-2026-39407.json"},{"type":"ADVISORY","url":"https://github.com/honojs/hono/security/advisories/GHSA-wmmm-f939-6g9c"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-39407"},{"type":"FIX","url":"https://github.com/honojs/hono/commit/9aff14bd727f8b0435c963363fd803260e7b8e3c"},{"type":"PACKAGE","url":"https://github.com/honojs/hono"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:08.490001240Z"}}