CVE-2021-39178
JSON

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 packageVersionsReported by
vercel next.js>= 10.0.0, < 11.1.1, from 10.0.0 before 11.1.1CVE List, NVD
next (npm)from 10.0.0 before 11.1.1GitHub Advisory Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD4.3medium CVSS:2.0AV: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.js file has images.domains array assigned
    • The image host assigned in images.domains allows user-provided SVG
  • Not affected: The next.config.js file has images.loader assigned to something other than default
  • Not affected: Deployments on Vercel are not affected
Patches

Next.js v11.1.1

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

Sources

SourceRecordLicence
CVE ListCVE-2021-39178 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-9gr3-7897-pp7m changed 2026-07-08CC-BY-4.0
NVDCVE-2021-39178 changed 2026-06-17Public domain