---
id: "GHSA-4m76-xfj5-7975"
page: "https://infrastack.ai/live/GHSA-4m76-xfj5-7975"
kind: "vulnerability"
aliases: ["GHSA-4m76-xfj5-7975"]
title: "`mount()` and `app.mount()` can forward a path that bypasses middleware scoped inside the mount prefix"
severity: "medium"
cvss: 5.3
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "hono", "fixed": ["4.13.16"], "affected": "< 4.13.16", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["bun", "cloudflare-workers", "cwe-288", "deno", "hono", "node", "package"]
not_affected_if: ["auth-inside-mounted-app", "no-mount-usage"]
published_at: "2026-11-01T02:33:42+00:00"
first_seen_at: "2026-11-09T22:53:17+00:00"
updated_at: "2026-11-09T22:56:35+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/honojs/hono/security/advisories/GHSA-4m76-xfj5-7975", "first_seen_at": "2026-11-09T22:53:17+00:00"}]
exploit_sources: []
---

# `mount()` and `app.mount()` can forward a path that bypasses middleware scoped inside the mount prefix

Link for people: https://infrastack.ai/live/GHSA-4m76-xfj5-7975 (this .md is for agents)

Hono's mount() and app.mount() strip the mount prefix incorrectly, so a crafted request reaches a route in the mounted app without passing the outer app's middleware. An unauthenticated attacker can reach routes the outer app meant to protect, such as an /app/admin/* check.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:hono affected < 4.13.16 fixed 4.13.16

## How to check

- Look for `mount(` or `app.mount(` calls in your code and check whether auth middleware is registered on a sub-path inside the mount prefix.
- Check the installed hono version with `npm ls hono`; versions below `4.13.16` are affected.

## Fix

- hono: move to `4.13.16`
- Per the advisory's workaround: register the authentication middleware inside the mounted application.

## Timeline

- 2026-11-09T22:53:17+00:00 ghsa-repo https://github.com/honojs/hono/security/advisories/GHSA-4m76-xfj5-7975

## Documents

- [advisory] Maintainer's advisory: github.com https://github.com/honojs/hono/security/advisories/GHSA-4m76-xfj5-7975

## From the sources

### Summary

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

### Details

1. **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`.
2. **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`.

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

### Impact

An unauthenticated client can reach a route of a mounted application that the outer application protects with path-scoped middleware.

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

### Workarounds

Register the authentication middleware inside the mounted application.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
