{"id":"CVE-2021-39178","aliases":["CVE-2021-39178","GHSA-9gr3-7897-pp7m"],"related":[],"kind":"vulnerability","state":"published","title":"XSS in Image Optimization API for Next.js versions between 10.0.0 and 11.1.0","summary":"Next.js is a React framework. Versions of Next.js between 10.0.0 and 11.0.0 contain a cross-site scripting vulnerability. In order for an instance to be affected by the vulnerability, the `next.config.js` file must have `images.domains` array assigned and the image host assigned in `images.domains` must allow user-provided SVG. If the `next.config.js` file has `images.loader` assigned to something other than default or the instance is deployed on Vercel, the instance is not affected by the vulnerability. The vulnerability is patched in Next.js version 11.1.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Next.js is a React framework. Versions of Next.js between 10.0.0 and 11.0.0 contain a cross-site scripting vulnerability. In order for an instance to be affected by the vulnerability, the `next.config.js` file must have `images.domains` array assigned and the image host assigned in `images.domains` must allow user-provided SVG. If the `next.config.js` file has `images.loader` assigned to something other than default or the instance is deployed on Vercel, the instance is not affected by the vulnerability. The vulnerability is patched in Next.js version 11.1.1.","source":"cvelist"},{"lang":"en","text":"### Impact\n- **Affected:** All of the following must be true to be affected\n    - Next.js between version 10.0.0 and 11.1.0\n    - The `next.config.js` file has [`images.domains`](https://nextjs.org/docs/basic-features/image-optimization#domains) array assigned\n    - The image host assigned in [`images.domains`](https://nextjs.org/docs/basic-features/image-optimization#domains) allows user-provided SVG\n- **Not affected**: The `next.config.js` file has [`images.loader`](https://nextjs.org/docs/basic-features/image-optimization#loader) assigned to something other than default\n- **Not affected**: Deployments on [Vercel](https://vercel.com) are not affected\n\n### Patches\n[Next.js v11.1.1](https://github.com/vercel/next.js/releases/tag/v11.1.1)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Next.js es un framework de React. Las versiones de Next.js entre 10.0.0 y 11.0.0 contienen una vulnerabilidad de tipo cross-site scripting. Para que una instancia este afectada por la vulnerabilidad, el archivo \"next.config.js\" debe tener asignado el array \"images.domains\" y el host de imágenes asignado en \"images.domains\" debe permitir el SVG proporcionado por el usuario. Si el archivo \"next.config.js\" tiene asignado \"images.loader\" a algo distinto de lo predeterminado o la instancia está desplegada en Vercel, la instancia no está afectada por la vulnerabilidad. La vulnerabilidad está parcheada en versión 11.1.1 de Next.js","source":"nvd"}],"published":"2021-08-30T23:55:09.000Z","modified":"2026-07-08T06:27:32.575Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.5,"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"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 10.0.0, < 11.1.1","status":"affected"}],"vendor":"vercel","product":"next.js","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"10.0.0","status":"affected","fixed":"11.1.1"}],"ecosystem":"npm","package":"next","purl":"pkg:npm/next","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"10.0.0","fixed":"11.1.1"}],"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-9gr3-7897-pp7m","tags":["patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vercel/next.js/releases/tag/v11.1.1","tags":["patch","release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-39178","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vercel/next.js/pull/28620","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vercel/next.js/commit/7afc97c5744b38bdf36aa7f87625f438224688aa","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vercel/next.js","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-39178","url":"https://www.cve.org/CVERecord?id=CVE-2021-39178","licence":"CVE Terms of Use","modified":"2024-08-04T01:58:18.141Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9gr3-7897-pp7m","url":"https://github.com/advisories/GHSA-9gr3-7897-pp7m","licence":"CC-BY-4.0","modified":"2026-07-08T06:27:32.575Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-39178","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-39178","licence":"Public domain","modified":"2026-06-17T04:03:15.377Z"}],"updatedAt":"2026-11-25T22:58:03.563Z","epss":{"score":0.01139,"percentile":0.67515,"date":"2026-12-01T12:00:22.000Z"}}