{"id":"CVE-2026-27977","aliases":["CVE-2026-27977","GHSA-jcc7-9wpm-mj36"],"related":[],"kind":"vulnerability","state":"published","title":"Next.js: null origin can bypass dev HMR websocket CSRF checks","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Next.js es un framework de React para construir aplicaciones web full-stack. A partir de la versión 16.0.1 y antes de la versión 16.1.7, en 'next dev', la protección entre sitios para los endpoints internos de websocket podría tratar 'Origin: null' como un caso de omisión incluso si allowedDevOrigins está configurado, permitiendo que contextos sensibles a la privacidad/opacos (por ejemplo, documentos en sandbox) se conecten inesperadamente. Si un servidor de desarrollo es accesible desde contenido controlado por el atacante, un atacante podría conectarse al canal de websocket HMR e interactuar con el tráfico de websocket de desarrollo. Esto afecta solo al modo de desarrollo. Las aplicaciones sin un allowedDevOrigins configurado aún permiten conexiones desde cualquier origen. El problema se soluciona en la versión 16.1.7 validando 'Origin: null' a través de las mismas comprobaciones de permiso de origen entre sitios utilizadas para otros orígenes. Si la actualización no es posible de inmediato, no exponga 'next dev' a redes no confiables y/o bloquee las actualizaciones de websocket a /_next/webpack-hmr cuando 'Origin' sea 'null' en el proxy.","source":"nvd"}],"published":"2026-03-17T15:29:48.000Z","modified":"2026-06-17T10:28:00.327Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":2.3,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":2.3,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-1385"],"affected":[{"ranges":[{"version":">= 16.0.1, < 16.1.7","status":"affected"}],"vendor":"vercel","product":"next.js","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"16.0.1","status":"affected","fixed":"16.1.7"}],"ecosystem":"npm","package":"next","purl":"pkg:npm/next","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"16.0.1","fixed":"16.1.7"}],"vendor":"vercel","product":"next.js","cpe":"cpe:2.3:a:vercel:next.js:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/vercel/next.js/security/advisories/GHSA-jcc7-9wpm-mj36","tags":["mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vercel/next.js/commit/862f9b9bb41d235e0d8cf44aa811e7fd118cee2a","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vercel/next.js/releases/tag/v16.1.7","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27977","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vercel/next.js","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-03-18T19:56:08.547Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-27977","url":"https://www.cve.org/CVERecord?id=CVE-2026-27977","licence":"CVE Terms of Use","modified":"2026-03-18T19:56:16.843Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jcc7-9wpm-mj36","url":"https://github.com/advisories/GHSA-jcc7-9wpm-mj36","licence":"CC-BY-4.0","modified":"2026-03-25T19:49:01.129Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-27977","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27977","licence":"Public domain","modified":"2026-06-17T10:28:00.327Z"}],"updatedAt":"2026-11-25T22:59:16.065Z","epss":{"score":0.00199,"percentile":0.10271,"date":"2026-12-01T12:00:22.000Z"}}