{"id":"GHSA-2gcr-mfcq-wcc3","revision":"592e7bcb64e6445f858275dc8c654433","records":[{"revision":"592e7bcb64e6445f858275dc8c654433","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-2gcr-mfcq-wcc3","aliases":["CVE-2026-47676"],"title":"Hono: app.mount() strips mount prefix using undecoded path, causing incorrect routing for percent-encoded paths","description":"### Summary\n\n`app.mount()` strips the mount prefix from the incoming request path using the raw URL pathname, while route matching is performed against the percent-decoded path. This inconsistency causes the prefix to be stripped at the wrong position when the path contains percent-encoded multi-byte characters, resulting in the mounted sub-application receiving an incorrect path.\n\n### Details\n\nWhen `app.mount(prefix, subApp)` is called, Hono calculates the number of characters to strip based on the decoded mount prefix length, but then applies that slice to the raw URL pathname. When the URL contains percent-encoded characters that expand to fewer characters when decoded (such as encoded non-ASCII characters), the two representations have different lengths, so the prefix is stripped at the wrong byte offset.\n\nAs a result, the sub-application receives a path that does not correspond to the intended sub-path — it may receive a partial or garbled path instead of the expected value after the mount prefix is removed.\n\nThis issue arises when an application uses `app.mount()` with paths that contain percent-encoded characters, particularly when the mount prefix itself or the request path contains encoded non-ASCII characters.\n\n### Impact\n\nA mounted sub-application may receive an incorrectly stripped path, causing requests to be routed to unintended handlers within the sub-application.\n\nThis may lead to:\n\n- Middleware or route handlers in the sub-application being bypassed or incorrectly matched due to the malformed path\n- Requests reaching sub-application routes that the developer did not intend to be accessible via the mounted path\n\nThis issue affects applications that use `app.mount()` where the request URL may contain percent-encoded characters in the mount prefix or subsequent path segments.","state":0,"publishedAt":"2026-06-04T18:01:00+00:00","modifiedAt":"2026-09-10T03:51:07.5547532+00:00","affected":[{"ecosystem":"npm","name":"hono","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"4.12.21"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/honojs/hono/security/advisories/GHSA-2gcr-mfcq-wcc3","https://nvd.nist.gov/vuln/detail/CVE-2026-47676","https://github.com/honojs/hono/commit/6cbb025ff87fca1a3d00d0ccca0eaf3a6385c3f1","https://github.com/honojs/hono","https://github.com/honojs/hono/releases/tag/v4.12.21"],"sourceUrl":"https://github.com/advisories/GHSA-2gcr-mfcq-wcc3","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-2gcr-mfcq-wcc3","identifiers":["GHSA-2gcr-mfcq-wcc3","CVE-2026-47676"]},"retained":false,"historicalAffected":[]}],"coverage":[]}