hono
cpe:2.3:a:hono:hono:*:*:*:*:node.js:*:*
- < 4.12.4
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.
Exploitation of this vulnerability could lead to unauthorized access of protected static files within the application's static root, bypassing route-based middleware protections.
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.
Users can upgrade to Hono version 4.12.4 or later to address this vulnerability.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.