{"id":"GHSA-h7mg-cq63-vhpq","kind":"vulnerability","aliases":["GHSA-h7mg-cq63-vhpq"],"related":[],"title":"RegExpRouter skips wildcard middleware for certain route patterns and for paths with an encoded line terminator","description":"### Summary\n\nRegExpRouter, which the default `SmartRouter` selects for most applications, skipped wildcard middleware in three cases, so a route handler ran without the middleware registered for it:\n\n1. Middleware whose parameter is written with the explicit default pattern, such as `/api/:tenant{[^/]+}/admin/*`, was not applied to a route written as `/api/:tenant/admin/:id`. (since 4.13.0)\n2. Middleware on `/admin/*` was not applied to a route registered on `/admin*` for paths under `/admin/`. (since 4.1.4)\n3. For a path with an encoded line terminator (`%0A`, `%0D`, `%E2%80%A8`, `%E2%80%A9`), no wildcard pattern matched, so the request reached the not-found handler without any wildcard middleware. (since 4.4.0)\n\nTrieRouter, LinearRouter and PatternRouter apply the middleware in all three cases.\n\n### Details\n\nRegExpRouter decides at registration time which wildcard middleware covers which route. In cases 1 and 2 it treated patterns that match the same requests as different ones. In case 3 the compiled wildcard did not match line terminators.\n\nThe fix derives the coverage from the structure of the registered paths and lets wildcards match line terminators. It also corrects other differences from the other routers (a wildcard in the middle of a path with parameters, duplicate middleware, middleware on static routes), and rejects custom patterns that can match the empty string, such as `{[0-9]*}`, with `UnsupportedPathError`. `PreparedRegExpRouter` data must be regenerated.\n\n### Impact\n\nAn unauthenticated client can reach a route handler, or the not-found handler, without the authentication or authorization middleware registered on a wildcard path.\n\nThis affects applications that use RegExpRouter, directly or through the default `SmartRouter`, and rely on wildcard middleware for authentication or authorization.\n\n### Workarounds\n\nUse `new Hono({ router: new TrieRouter() })`.","summary":"Hono's RegExpRouter, the default router for most applications, sometimes fails to apply wildcard middleware to matching routes and to paths containing an encoded line terminator. An unauthenticated client can reach a route handler or the not-found handler without the authentication or authorization middleware registered for it.","severity":"medium","cvss":5.3,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"hono","fixed":["4.13.16"],"affected":">= 4.1.4, <= 4.13.15","ecosystem":"npm"}],"ecosystems":["npm"],"tags":["bun","cloudflare-workers","cwe-863","deno","hono","node","package"],"not_affected_if":["default-config-not-used","no-wildcard-auth-middleware","trierouter-in-use"],"how_to_check":"- Check the installed version with `npm ls hono` and confirm whether it is between `4.1.4` and `4.13.15`.\n- Look for wildcard middleware (such as `app.use('/admin/*', ...)`) that handles authentication or authorization, and for routes registered with explicit patterns like `:tenant{[^/]+}`.\n- Confirm whether the app uses the default `SmartRouter` or RegExpRouter directly.","fix":"- `hono` `4.13.16`\n- Workaround named by the advisory: `new Hono({ router: new TrieRouter() })`","status":"open","published_at":"2026-11-01T02:31:34+00:00","first_seen_at":"2026-11-09T22:53:17+00:00","triaged_at":"2026-11-09T22:56:36+00:00","updated_at":"2026-11-09T22:56:36+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-09T22:56:36Z","model":"claude-haiku-5-5","output":{"fix":"- `hono` `4.13.16`\n- Workaround named by the advisory: `new Hono({ router: new TrieRouter() })`","reach":"internet","title":"Hono: RegExpRouter can skip wildcard middleware, letting unauthenticated requests reach handlers","impact":"high","summary":"Hono's RegExpRouter, the default router for most applications, sometimes fails to apply wildcard middleware to matching routes and to paths containing an encoded line terminator. An unauthenticated client can reach a route handler or the not-found handler without the authentication or authorization middleware registered for it.","audience":"developers","category":"package","nicknames":[],"who_cares":["hono","node","cloudflare-workers","deno","bun"],"confidence":0.8,"fix_status":"available","needs_auth":"no","worst_case":"unauthenticated requests reach protected route handlers without middleware","analyst_note":"","how_to_check":"- Check the installed version with `npm ls hono` and confirm whether it is between `4.1.4` and `4.13.15`.\n- Look for wildcard middleware (such as `app.use('/admin/*', ...)`) that handles authentication or authorization, and for routes registered with explicit patterns like `:tenant{[^/]+}`.\n- Confirm whether the app uses the default `SmartRouter` or RegExpRouter directly.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["default-config-not-used","no-wildcard-auth-middleware","trierouter-in-use"],"who_is_affected":"Applications that use Hono's RegExpRouter, directly or through the default SmartRouter, and rely on wildcard middleware for authentication or authorization are exposed. Apps on other routers (TrieRouter, LinearRouter, PatternRouter) are not affected by these cases, and apps that do not depend on wildcard middleware for access control face less risk.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"no","severity_if_unknown":"medium"},"cost_usd":0.000873,"input_tokens":5213,"output_tokens":703,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-863':33B '-9':302C '/admin':127C,144C,153C,157C '/api':125C,136C '0':301C '0a':169C '0d':170C '1':112C,221C '2':141C,223C '3':160C,237C '4.1.4':159C '4.13.0':140C '4.4.0':195C '80':172C,175C 'a8':173C 'a9':176C 'affect':337C 'also':265C 'appli':50B,130C,147C,200C 'applic':46B,94C,338C 'authent':80B,327C,354C 'author':82B,329C,356C 'bun':28B 'case':100C,206C,220C,236C 'certain':6A 'client':66B,313C 'cloudflar':30B 'cloudflare-work':29B 'compil':239C 'contain':59B 'correct':266C 'cover':216C 'coverag':250C 'cq63':20A,25A 'custom':291C 'cwe':32B 'data':306C 'decid':209C 'default':42B,89C,121C,346C 'deno':34B 'deriv':248C 'detail':207C 'differ':233C,268C 'direct':342C 'duplic':283C 'e2':171C,174C 'empti':297C 'encod':14A,61B,166C 'explicit':120C 'fail':48B 'fix':247C 'found':76B,188C,323C 'ghsa':18A,23A 'ghsa-h7mg-cq63-vhpq':17A,22A 'h7mg':19A,24A 'handler':71B,77B,104C,189C,318C,324C 'hono':27A,35B,38B,360C 'id':138C 'impact':310C 'let':259C 'line':15A,62B,167C,244C,262C 'linearrout':197C 'match':54B,180C,228C,243C,261C,295C 'middl':277C 'middlewar':4A,52B,83B,97C,108C,113C,142C,193C,202C,215C,284C,285C,330C,352C 'must':307C 'new':359C,362C 'node':36B 'not-found':74B,186C,321C 'one':234C 'packag':37B 'paramet':115C,282C 'path':11A,58B,155C,163C,257C,280C,335C 'pattern':8A,122C,179C,226C,292C 'patternrout':199C 'preparedregexprout':305C 'ran':105C 'reach':68B,184C,315C 'regener':309C 'regexprout':1A,40B,86C,208C,341C 'regist':84B,109C,151C,256C,331C 'registr':211C 'reject':290C 'reli':349C 'request':183C,231C 'rout':7A,55B,70B,103C,133C,150C,218C,288C,317C 'router':43B,272C,361C 'select':91C 'sinc':139C,158C,194C 'skip':2A,95C 'smartrout':90C,347C 'sometim':47B 'static':287C 'string':298C 'structur':253C 'summari':85C 'tenant':126C 'tenant/admin':137C 'termin':16A,63B,168C,245C,263C 'three':99C,205C 'time':212C 'treat':225C 'trierout':196C,363C 'unauthent':65B,312C 'unsupportedpatherror':304C 'use':340C,358C 'vhpq':21A,26A 'whose':114C 'wildcard':3A,51B,96C,178C,192C,214C,240C,260C,274C,334C,351C 'without':78B,106C,190C,325C 'workaround':357C 'worker':31B 'written':117C,134C","nicknames":[],"mitigations":[],"who_affected":"Applications that use Hono's RegExpRouter, directly or through the default SmartRouter, and rely on wildcard middleware for authentication or authorization are exposed. Apps on other routers (TrieRouter, LinearRouter, PatternRouter) are not affected by these cases, and apps that do not depend on wildcard middleware for access control face less risk.","tier":"C","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["hono"],"ptokens":["hono"],"labels":["bun","cloudflareworkers","cwe863","deno","hono","medium","node","npm","package"],"campaign_type":null,"search_a":"'certain':6A 'cq63':20A,25A 'encod':14A 'ghsa':18A,23A 'ghsa-h7mg-cq63-vhpq':17A,22A 'h7mg':19A,24A 'hono':27A 'line':15A 'middlewar':4A 'path':11A 'pattern':8A 'regexprout':1A 'rout':7A 'skip':2A 'termin':16A 'vhpq':21A,26A 'wildcard':3A","search_b":"'-863':33B 'appli':50B 'applic':46B 'authent':80B 'author':82B 'bun':28B 'client':66B 'cloudflar':30B 'cloudflare-work':29B 'contain':59B 'cwe':32B 'default':42B 'deno':34B 'encod':61B 'fail':48B 'found':76B 'handler':71B,77B 'hono':35B,38B 'line':62B 'match':54B 'middlewar':52B,83B 'node':36B 'not-found':74B 'packag':37B 'path':58B 'reach':68B 'regexprout':40B 'regist':84B 'rout':55B,70B 'router':43B 'sometim':47B 'termin':63B 'unauthent':65B 'wildcard':51B 'without':78B 'worker':31B","search_c":"'-9':302C '/admin':127C,144C,153C,157C '/api':125C,136C '0':301C '0a':169C '0d':170C '1':112C,221C '2':141C,223C '3':160C,237C '4.1.4':159C '4.13.0':140C '4.4.0':195C '80':172C,175C 'a8':173C 'a9':176C 'affect':337C 'also':265C 'appli':130C,147C,200C 'applic':94C,338C 'authent':327C,354C 'author':329C,356C 'case':100C,206C,220C,236C 'client':313C 'compil':239C 'correct':266C 'cover':216C 'coverag':250C 'custom':291C 'data':306C 'decid':209C 'default':89C,121C,346C 'deriv':248C 'detail':207C 'differ':233C,268C 'direct':342C 'duplic':283C 'e2':171C,174C 'empti':297C 'encod':166C 'explicit':120C 'fix':247C 'found':188C,323C 'handler':104C,189C,318C,324C 'hono':360C 'id':138C 'impact':310C 'let':259C 'line':167C,244C,262C 'linearrout':197C 'match':180C,228C,243C,261C,295C 'middl':277C 'middlewar':97C,108C,113C,142C,193C,202C,215C,284C,285C,330C,352C 'must':307C 'new':359C,362C 'not-found':186C,321C 'one':234C 'paramet':115C,282C 'path':155C,163C,257C,280C,335C 'pattern':122C,179C,226C,292C 'patternrout':199C 'preparedregexprout':305C 'ran':105C 'reach':184C,315C 'regener':309C 'regexprout':86C,208C,341C 'regist':109C,151C,256C,331C 'registr':211C 'reject':290C 'reli':349C 'request':183C,231C 'rout':103C,133C,150C,218C,288C,317C 'router':272C,361C 'select':91C 'sinc':139C,158C,194C 'skip':95C 'smartrout':90C,347C 'static':287C 'string':298C 'structur':253C 'summari':85C 'tenant':126C 'tenant/admin':137C 'termin':168C,245C,263C 'three':99C,205C 'time':212C 'treat':225C 'trierout':196C,363C 'unauthent':312C 'unsupportedpatherror':304C 'use':340C,358C 'whose':114C 'wildcard':96C,178C,192C,214C,240C,260C,274C,334C,351C 'without':106C,190C,325C 'workaround':357C 'written':117C,134C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-01T02:31:34+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"ghsa-repo","external_id":"GHSA-h7mg-cq63-vhpq","url":"https://github.com/honojs/hono/security/advisories/GHSA-h7mg-cq63-vhpq","severity":"medium","published_at":"2026-11-01T02:31:34+00:00","modified_at":"2026-11-01T02:33:31+00:00","first_seen_at":"2026-11-09T22:53:17+00:00","fetched_at":"2026-11-09T22:53:17+00:00","note":null}],"documents":[{"id":110466,"url":"https://github.com/honojs/hono/security/advisories/GHSA-h7mg-cq63-vhpq","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa-repo","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}