Your Dev Server’s WebSocket Is Public Now: Cross-Site WebSocket Hijacking Behind a Tunnel
You ran npm run dev , started a tunnel so a teammate could review your work, and shared the link. The page loads and hot reload works. But the page is not the only thing you published. The hot module replacement (HMR) WebSocket your framework opens in the background is now reachable from the internet too. That socket was designed for a world where only your own browser could talk to it. Several vulnerabilities from 2025 and 2026 show what happens when that assumption breaks. Next.js, Vite, webpack-dev-server, Mailpit and nginx-ui have all shipped fixes for WebSocket origin-validation problems, and webpack-dev-server’s most recent one landed in October 2026. This guide explains the attack class, what an Origin check really protects against, why a missing or null Origin deserves special attention, and what to do per framework. What is cross-site WebSocket hijacking (CSWSH)? Cross-site WebSocket hijacking is the WebSocket version of cross-site request forgery. Browsers do not apply ...