CVE-2026-27977: Next Null Origin Can Bypass Dev Vulnerability

LOW
Advisory Identifier: GHSA-jcc7-9wpm-mj36
CWE-1385
Published
Advisory Summary

CVE-2026-27977 is a LOW null origin can bypass dev vulnerability (CWE-1385: Missing Origin Validation in WebSockets) affecting Next libraries in the npm ecosystem. The issue involves null origin can bypass dev hmr websocket csrf checks. Remediation is available by upgrading affected packages to version 16.1.7.

CVE-2026-27977 at a Glance

CVE Identifier CVE-2026-27977
GHSA Identifier GHSA-jcc7-9wpm-mj36
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-1385: Missing Origin Validation in WebSockets
Affected Product Next
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-27977

To remediate this vulnerability, upgrade all affected Next dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

next fixed: 16.1.7
npm install next@16.1.7
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls next

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-27977, inspect your project dependencies using npm:

npm ls next

Analyze the terminal output to locate any version of Next in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 16.1.7), your application is affected.

Note: The npm ls next command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1385: Missing Origin Validation in WebSockets, where the product uses a websocket, but it does not properly verify that the source of data or communication is valid. In Next, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary In `next dev`, cross-site protections for internal development endpoints could treat `Origin: null` as a bypass case even when [`allowedDevOrigins`](https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins) is configured. This could allow privacy-sensitive or opaque browser contexts, such as sandboxed documents, to access privileged internal dev-server functionality unexpectedly. ## Impact If a developer visits attacker-controlled content while running an affected `next dev` server with [`allowedDevOrigins`](https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins) configured, attacker-controlled browser code may be able to connect to internal development endpoints and interact with sensitive dev-server functionality that should have remained blocked. This issue affects development mode only. It does not affect `next start`, and it does not expose internal debugging functionality to the network by default. ## Patches Fixed by validating `Origin: null` through the same cross-site origin-allowance checks used for other origins on internal development endpoints. ## Workarounds If upgrade is not immediately possible: - Do not expose `next dev` to untrusted networks. - If you use [`allowedDevOrigins`](https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins), reject requests and websocket upgrades with `Origin: null` for internal dev endpoints at your proxy.

CVE-2026-27977 Affected Next Versions

1 component(s)
Fixed Versions:
16.1.7
Product / Package Ecosystem Affected Versions Fixed Version
next
npm
≥ 16.0.1
< 16.1.7
16.1.7

References

Frequently Asked Questions

What is CVE-2026-27977?
CVE-2026-27977 is a security vulnerability in Next involving null origin can bypass dev HMR websocket CSRF checks under CWE-1385: Missing Origin Validation in WebSockets.
Which Next versions are affected?
Affected versions include releases prior to 16.1.7 across affected packages: next.
What version fixes CVE-2026-27977?
Upgrading to 16.1.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next affected?
Yes, next is affected in releases prior to 16.1.7. Upgrade your dependency to 16.1.7 or later.
What CWE is associated with CVE-2026-27977?
CVE-2026-27977 is classified under CWE-1385: Missing Origin Validation in WebSockets (The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.).
How can I check npm dependencies for CVE-2026-27977?
Run the dependency tree command: 'npm ls next'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jcc7-9wpm-mj36",
  "modified" : "2026-03-25T18:51:19Z",
  "published" : "2026-03-17T15:29:48Z",
  "aliases" : [ "CVE-2026-27977" ],
  "summary" : "Next.js: null origin can bypass dev HMR websocket CSRF checks",
  "details" : "## Summary\nIn `next dev`, cross-site protections for internal development endpoints could treat `Origin: null` as a bypass case even when [`allowedDevOrigins`](https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins) is configured. This could allow privacy-sensitive or opaque browser contexts, such as sandboxed documents, to access privileged internal dev-server functionality unexpectedly.\n\n## Impact\nIf a developer visits attacker-controlled content while running an affected `next dev` server with [`allowedDevOrigins`](https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins) configured, attacker-controlled browser code may be able to connect to internal development endpoints and interact with sensitive dev-server functionality that should have remained blocked.\n\nThis issue affects development mode only. It does not affect `next start`, and it does not expose internal debugging functionality to the network by default.\n\n## Patches\nFixed by validating `Origin: null` through the same cross-site origin-allowance checks used for other origins on internal development endpoints.\n\n## Workarounds\nIf upgrade is not immediately possible:\n- Do not expose `next dev` to untrusted networks.\n- If you use [`allowedDevOrigins`](https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins), reject requests and websocket upgrades with `Origin: null` for internal dev endpoints at your proxy.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "16.0.1"
      }, {
        "fixed" : "16.1.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/security/advisories/GHSA-jcc7-9wpm-mj36"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27977"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/commit/862f9b9bb41d235e0d8cf44aa811e7fd118cee2a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vercel/next.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/releases/tag/v16.1.7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1385" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-17T15:29:48Z",
    "nvd_published_at" : "2026-03-18T00:16:19Z"
  }
}