Hono Web Framework Route-Based Authorization Bypass Vulnerability

Vulnerability

A vulnerability in the Hono web application framework, prior to version 4.12.4, allowed for unauthorized access to protected static resources. This issue arose when using the 'serveStatic' middleware alongside route-based protections, such as 'app.use('/admin/*', ...)'. The problem stemmed from inconsistent URL decoding: the router utilized 'decodeURI', while 'serveStatic' employed 'decodeURIComponent'. This discrepancy enabled paths with encoded slashes (%2F) to bypass middleware protections, all while directing to the intended filesystem location. Consequently, static files could be served without triggering the necessary route-based authorizations, potentially exposing sensitive resources.

Impact

Exploitation of this vulnerability could lead to unauthorized access of protected static files within the application's static root, bypassing route-based middleware protections.

Reproduction

To reproduce this vulnerability, first set up an application using the Hono framework version prior to 4.12.4. Implement route-based middleware protections for specific subpaths, such as '/admin/*'. Then, use the 'serveStatic' middleware to serve files from the same static root. When a request is made to a protected resource using an encoded path that includes '%2F', the middleware protection will be bypassed, and the static file will be served without authorization.

Remediation

Users can upgrade to Hono version 4.12.4 or later to address this vulnerability.

Added: Mar 4, 2026, 11:20 PM
Updated: Mar 4, 2026, 11:20 PM

Vulnerability Rating

Custom Algorithm
spread
2.2
impact
0.6
exploitability
9.3
remediation
7.7
relevance
3.5
threat
4.8
urgency
2.9
incentive
8.3

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.