7.5high
XSS in Image Optimization API for Next.js versions between 10.0.0 and 11.1.0
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.14% (higher than 67% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-9gr3-7897-pp7m
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| vercel next.js | >= 10.0.0, < 11.1.1, from 10.0.0 before 11.1.1 | CVE List, NVD |
| next (npm) | from 10.0.0 before 11.1.1 | GitHub Advisory Database |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
Impact
- Affected: All of the following must be true to be affected
- Next.js between version 10.0.0 and 11.1.0
- The
next.config.jsfile hasimages.domainsarray assigned - The image host assigned in
images.domainsallows user-provided SVG
- Not affected: The
next.config.jsfile hasimages.loaderassigned to something other than default - Not affected: Deployments on Vercel are not affected
Patches
NVD (es)
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
References
| https://github.com/vercel/next.js/security/advisories/GHSA-9gr3-7897-pp7m | patch, third-party-advisory, web | |
| https://github.com/vercel/next.js/releases/tag/v11.1.1 | patch, release-notes, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-39178 | advisory | |
| https://github.com/vercel/next.js/pull/28620 | web | |
| https://github.com/vercel/next.js/commit/7afc97c5744b38bdf36aa7f87625f438224688aa | web | |
| https://github.com/vercel/next.js | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-39178 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9gr3-7897-pp7m changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-39178 changed 2026-06-17 | Public domain |