CVE-2026-27977: Next.js: null origin can bypass dev HMR websocket CSRF checks

Published Mar 17, 2026
·
Updated

Summary In next dev, cross-site protection for internal websocket endpoints could treat Origin: null as a bypass case even if allowedDevOrigins is configured, allowing privacy-sensitive/opaque contexts (for example sandboxed documents) to connect unexpectedly.

Impact If a dev server is reachable from attacker-controlled content, an attacker may be able to connect to the HMR websocket channel and interact with dev websocket traffic. This affects development mode only. Apps without a configured allowedDevOrigins still allow connections from any origin.

Patches Fixed by validating Origin: null through the same cross-site origin-allowance checks used for other origins.

Workarounds If upgrade is not immediately possible: - Do not expose next dev to untrusted networks. - Block websocket upgrades to /next/webpack-hmr when Origin is null at your proxy.

Other sources

Next.js is a React framework for building full-stack web applications. Starting in version 16.0.1 and prior to version 16.1.7, in next dev, cross-site protection for internal websocket endpoints could treat Origin: null as a bypass case even if allowedDevOrigins is configured, allowing privacy-sensitive/opaque contexts (for example sandboxed documents) to connect unexpectedly. If a dev server is reachable from attacker-controlled content, an attacker may be able to connect to the HMR websocket channel and interact with dev websocket traffic. This affects development mode only. Apps without a configured allowedDevOrigins still allow connections from any origin. The issue is fixed in version 16.1.7 by validating Origin: null through the same cross-site origin-allowance checks used for other origins. If upgrading is not immediately possible, do not expose next dev to untrusted networks and/or block websocket upgrades to /next/webpack-hmr when Origin is null at the proxy.

NVD

Affected Software

2 affected componentsFixes available
npm/next>=16.0.1<16.1.7
16.1.7
Vercel Next.js Node.js>=16.0.1<16.1.7

Event History

Mar 17, 2026
Advisory Published
via GitHub·03:29 PM
Data Sourced
via GitHub·03:29 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·11:56 PM
Data Sourced
via MITRE·11:56 PM
DescriptionWeakness
Mar 18, 2026
Data Sourced
via NVD·12:16 AM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-27977?

CVE-2026-27977 has been assessed to have a moderate severity level due to potential privacy-sensitive implications.

2

How do I fix CVE-2026-27977?

To mitigate CVE-2026-27977, upgrade to Next.js version 16.1.7 or higher as this version includes a fix for the vulnerability.

3

What type of vulnerability is CVE-2026-27977?

CVE-2026-27977 is a cross-site protection vulnerability affecting internal websocket endpoints in Next.js.

4

What versions of Next.js are affected by CVE-2026-27977?

CVE-2026-27977 affects Next.js versions between 16.0.1 and 16.1.6 inclusive.

5

What are the potential consequences of CVE-2026-27977?

Exploitation of CVE-2026-27977 could lead to insecure handling of cross-origin requests, compromising the privacy and security of applications.

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