GHSA-7v5p-43qr-wch5: @hono/node-server: WebSocket upgrade request-target starting with `//` replaces the host in `c.req.url`, bypassing `Origin` checks

Published Nov 12, 2026
·
Updated

@hono/node-server allows running the Hono application on Node.js. From 2.0.0 until 2.1.6, the WebSocket upgrade path resolves a raw request-target beginning with // against a base URL built from the Host header, causing the WHATWG URL parser to treat the request-target as a network-path reference and replace the host in c.req.url. Routing still uses the local WebSocket path, so an application that compares the Origin header with the origin of c.req.url, including checks implemented with csrf(), compares an attacker's origin with itself and accepts the connection. A page on another site can consequently open a WebSocket with the victim's cookies and read and send messages when the application uses upgradeWebSocket and trusts the host in c.req.url. Ordinary HTTP requests are not affected. This issue is fixed in version 2.1.6.

Affected Software

1 affected component
npm/@hono/node-server>=2.0.0<2.1.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade @hono/node-server to a version that resolves this vulnerability.

    Fixed in 2.1.6

Event History

Nov 12, 2026
CVE Published
via OSV·09:28 PM
Data Sourced
via OSV·09:28 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using @hono/node-server versions 2.0.0 through 2.1.5 are affected if they expose WebSocket endpoints through upgradeWebSocket and use c.req.url as the trusted origin when validating the Origin header. Ordinary HTTP request handling is not affected.

2

What must an attacker do to exploit the issue?

An attacker must induce a victim to visit an attacker-controlled page that opens a WebSocket to the vulnerable application using a request-target beginning with //. The vulnerable origin validation must compare Origin against the origin derived from c.req.url, allowing the attacker-controlled host to replace that origin.

3

Are applications using csrf() affected?

They can be affected when csrf() is used to validate WebSocket upgrade requests through an origin comparison based on c.req.url. In that case, the malformed WebSocket request-target can cause the check to compare the attacker's origin with itself.

4

What should be done to remediate the issue?

Upgrade @hono/node-server to version 2.1.6, which fixes the issue. Until upgrading, avoid trusting the host-derived origin in c.req.url for WebSocket Origin validation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203