# CVE-2021-39178: XSS in Image Optimization API for Next.js versions between 10.0.0 and 11.1.0

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.14%, higher than 67% of CVEs (2026-12-01)
- Published: 2021-08-30T23:55:09.000Z
- Modified: 2026-07-08T06:27:32.575Z
- Also known as: GHSA-9gr3-7897-pp7m
- Weaknesses: CWE-79
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- vercel next.js: >= 10.0.0, < 11.1.1; from 10.0.0 before 11.1.1
- next (npm): from 10.0.0 before 11.1.1

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## 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

- CVE List: [CVE-2021-39178](https://www.cve.org/CVERecord?id=CVE-2021-39178), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-9gr3-7897-pp7m](https://github.com/advisories/GHSA-9gr3-7897-pp7m), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-39178](https://nvd.nist.gov/vuln/detail/CVE-2021-39178), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-39178 · Whole record: https://cve.day/CVE-2021-39178.json · Rebuilt by cve.day 2026-11-25T22:58:03.563Z
