{"id":"CVE-2026-64645","aliases":["CVE-2026-64645","GHSA-p9j2-gv94-2wf4"],"related":[],"kind":"vulnerability","state":"published","title":"Next.js: Server-Side Request Forgery in rewrites via attacker-controlled destination hostname","summary":"Next.js is a React framework for building full-stack web applications. In versions 12.0.0 through 15.5.20 and 16.0.0 through 16.2.10, a\n rewrites() or redirects() rule that builds its external destination hostname from request-controlled input can be pointed at an arbitrary hostname, regardless of the rule's hostname suffix. For a rewrite, Next.js proxies the request to that arbitrary host and serves the response from the application's origin, leading to Server-Side Request forgery. A redirects() rule configured this way is vulnerable to an Open Redirect. This issue has been fixed in versions 15.5.21 and 16.2.11.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Next.js is a React framework for building full-stack web applications. In versions 12.0.0 through 15.5.20 and 16.0.0 through 16.2.10, a\n rewrites() or redirects() rule that builds its external destination hostname from request-controlled input can be pointed at an arbitrary hostname, regardless of the rule's hostname suffix. For a rewrite, Next.js proxies the request to that arbitrary host and serves the response from the application's origin, leading to Server-Side Request forgery. A redirects() rule configured this way is vulnerable to an Open Redirect. This issue has been fixed in versions 15.5.21 and 16.2.11.","source":"cvelist"},{"lang":"en","text":"## Impact\n\nA `rewrites()` or `redirects()` rule that builds its external destination hostname from request-controlled input can be pointed at an arbitrary hostname, regardless of the rule's hostname suffix. For a rewrite, Next.js proxies the request to that arbitrary host and serves the response from the application's origin, leading to Server-Side Request forgery. A `redirects()` rule configured this way is vulnerable to an Open Redirect.\n\nThis affects any destination that puts a dynamic segment in the hostname, whether from the path:\n\n```javascript\n// next.config.js\nmodule.exports = {\n  async rewrites() {\n    return [\n      {\n        source: '/:tenant',\n        destination: 'https://:tenant.api.example.com',\n      },\n    ]\n  },\n}\n```\n\nor from a `has` capture:\n\n```javascript\n// next.config.js\nmodule.exports = {\n  async rewrites() {\n    return [\n      {\n        source: '/',\n        has: [{ type: 'query', key: 'region', value: '(?<region>.+)' }],\n        destination: 'https://:region.api.example.com',\n      },\n    ]\n  },\n}\n```\n\n## Workarounds\n\nIf you cannot upgrade immediately, do not build the hostname of an external `rewrites()` or `redirects()` destination from user-controlled input. If a dynamic subdomain is required, constrain the value to hostname-safe characters:  `value: '(?<region>[a-z0-9-]+)'`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Next.js es un framework de React para construir aplicaciones web full-stack. En las versiones 12.0.0 a 15.5.20 y 16.0.0 a 16.2.10, una regla de rewrites() o redirects() que construye su nombre de host de destino externo a partir de una entrada controlada por la petición puede ser apuntada a un nombre de host arbitrario, independientemente del sufijo del nombre de host de la regla. Para una reescritura, Next.js proxy la petición a ese host arbitrario y sirve la respuesta desde el origen de la aplicación, lo que lleva a una falsificación de petición del lado del servidor. Una regla de redirects() configurada de esta manera es vulnerable a una redirección abierta. Este problema ha sido solucionado en las versiones 15.5.21 y 16.2.11.","source":"nvd"}],"published":"2026-07-22T23:02:23.000Z","modified":"2026-10-24T13:10:00.147Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:L/SI:L/SA:N","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:L/SI:L/SA:N","score":8.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:L/SI:L/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-601","CWE-918"],"affected":[{"ranges":[{"version":">= 12.0.0 < 15.5.21","status":"affected"},{"version":">= 16.0.0, < 16.2.11","status":"affected"}],"vendor":"vercel","product":"next.js","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"12.0.0","status":"affected","fixed":"15.5.21"}],"ecosystem":"npm","package":"next","purl":"pkg:npm/next","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"16.0.0","status":"affected","fixed":"16.2.11"}],"ecosystem":"npm","package":"next","purl":"pkg:npm/next","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"12.0.0","fixed":"15.5.21"},{"status":"affected","introduced":"16.0.0","fixed":"16.2.11"}],"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-p9j2-gv94-2wf4","tags":["mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vercel/next.js/commit/35f501357e9b0fe7c950b0d6aa8fcf5343f707e9","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vercel/next.js/commit/d3033266c6dff23f7be71e19341fe3a8c6e2c599","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vercel/next.js/releases/tag/v15.5.21","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vercel/next.js/releases/tag/v16.2.11","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"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-07-28T14:01:56.498Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-64645","url":"https://www.cve.org/CVERecord?id=CVE-2026-64645","licence":"CVE Terms of Use","modified":"2026-07-28T14:02:21.877Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p9j2-gv94-2wf4","url":"https://github.com/advisories/GHSA-p9j2-gv94-2wf4","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:11.554Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-64645","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64645","licence":"Public domain","modified":"2026-10-24T13:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:30.225Z","epss":{"score":0.00925,"percentile":0.6148,"date":"2026-12-01T12:00:22.000Z"}}