CVE-2021-39178
MEDIUM 6.1CVSS 3.1XSS in Image Optimization API for Next.js
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.
- Published
- 31 Aug 2021
- Last modified
- 8 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- GHSA-9gr3-7897-pp7m
- Sources
- NVDJSONOSV GHSA-9gr3-7897-pp7mJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | vercel | next.jscpe:2.3:a:vercel:next.js:*:*:*:*:*:node.js:*:* |
>= 10.0.0, < 11.1.1 | 11.1.1 |
| OSV | npm | next | >= 10.0.0, < 11.1.1 | 11.1.1 |
References
- https://github.com/vercel/next.js/releases/tag/v11.1.1 · Patch, Release Notes, Third Party Advisory, WEB
- https://github.com/vercel/next.js/security/advisories/GHSA-9gr3-7897-pp7m · Patch, 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
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 31 Aug 2021)
- 25 Nov 2026 20:10 UTC · OSV: first stored (published 1 Sep 2021)