{"id":"CVE-2026-126357","aliases":["CVE-2026-126357","GHSA-4m76-xfj5-7975"],"related":[],"kind":"vulnerability","state":"published","title":"Hono: `mount()` and `app.mount()` can forward a path that bypasses middleware scoped inside the mount prefix","summary":"Hono is a Web application framework that provides support for any JavaScript runtime. Prior to 4.13.16, mount() and app.mount() can remove a dynamic mount prefix using the route-pattern length rather than the matched-prefix length, allowing a crafted path to be forwarded as a protected inner route while the outer application routes the original path. Since 4.12.21, rebuilding the forwarded URL from the decoded pathname can also convert a decoded backslash to a slash and collapse parent-directory segments, again causing the mounted application to receive a protected path. An unauthenticated client can use either applicable path transformation to reach a mounted route without authentication or authorization middleware scoped to a subpath inside the mount prefix. This issue is fixed in version 4.13.16.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Hono is a Web application framework that provides support for any JavaScript runtime. Prior to 4.13.16, mount() and app.mount() can remove a dynamic mount prefix using the route-pattern length rather than the matched-prefix length, allowing a crafted path to be forwarded as a protected inner route while the outer application routes the original path. Since 4.12.21, rebuilding the forwarded URL from the decoded pathname can also convert a decoded backslash to a slash and collapse parent-directory segments, again causing the mounted application to receive a protected path. An unauthenticated client can use either applicable path transformation to reach a mounted route without authentication or authorization middleware scoped to a subpath inside the mount prefix. This issue is fixed in version 4.13.16.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`mount()` and `app.mount()` remove the mount prefix from the request path and forward the rest to the mounted application. Two mistakes in that step let a crafted request reach a route of the mounted application that the outer application protects with path-scoped middleware, such as an authentication check on `/app/admin/*`. The outer application routes on the original path, so the middleware does not run.\n\n### Details\n\n1. **Dynamic prefix** (all affected versions): for a mount such as `/api/:tenant/*`, the prefix was removed by the length of the route pattern, not of the matched prefix. A request with a longer or shorter first segment is cut in the middle, so `/api/a/xxxxx/admin/secret` reaches the mounted application as `/admin/secret`.\n2. **Re-normalization** (since 4.12.21): the forwarded path was built from the decoded request path and assigned to `url.pathname`, which turns a decoded backslash into `/` and collapses `..`. `/app/public%5C..%5Cadmin/secret` reaches the mounted application as `/admin/secret`.\n\nThe fix removes the prefix segment by segment from the raw pathname, using the matched parameter values for its length. Route patterns that cannot be handled safely now throw: duplicate parameter names and a wildcard inside the last segment such as `/assets*`. A trailing slash in an `app.mount()` prefix no longer removes an extra segment.\n\n### Impact\n\nAn unauthenticated client can reach a route of a mounted application that the outer application protects with path-scoped middleware.\n\nThis affects applications that use `mount()` or `app.mount()` and rely on middleware registered on a sub-path inside the mount prefix for authentication or authorization.\n\n### Workarounds\n\nRegister the authentication middleware inside the mounted application.","format":"markdown","source":"ghsa"}],"published":"2026-11-12T22:18:46.437Z","modified":"2026-11-17T19:17:50.800Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-288"],"affected":[{"ranges":[{"version":"< 4.13.16","status":"affected"}],"vendor":"honojs","product":"hono","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.13.16"}],"ecosystem":"npm","package":"hono","purl":"pkg:npm/hono","source":"ghsa"}],"references":[{"url":"https://github.com/honojs/hono/security/advisories/GHSA-4m76-xfj5-7975","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/honojs/hono/commit/34f90432a1794b28e52802670efcd01963f716d6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/honojs/hono/releases/tag/v4.13.16","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/honojs/hono","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-11-17T19:11:38.610Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-126357","url":"https://www.cve.org/CVERecord?id=CVE-2026-126357","licence":"CVE Terms of Use","modified":"2026-11-17T19:11:59.020Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4m76-xfj5-7975","url":"https://github.com/advisories/GHSA-4m76-xfj5-7975","licence":"CC-BY-4.0","modified":"2026-11-12T23:30:03.867Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-126357","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126357","licence":"Public domain","modified":"2026-11-17T19:17:50.800Z"}],"updatedAt":"2026-11-25T22:59:50.577Z","epss":{"score":0.004,"percentile":0.36369,"date":"2026-12-01T12:00:22.000Z"}}