CVE-2021-39178
JavaScript vulnerability analysis and mitigation

Overview

Next.js, a React framework, was found to contain a cross-site scripting (XSS) vulnerability affecting versions between 10.0.0 and 11.0.0. The vulnerability was discovered and disclosed on August 30, 2021, and was assigned CVE-2021-39178. For an instance to be vulnerable, specific conditions must be met: the next.config.js file must have images.domains array assigned, and the image host assigned in images.domains must allow user-provided SVG (GitHub Advisory, NVD).

Technical details

The vulnerability is specifically related to the Image Optimization API in Next.js. The CVSS v3.1 base score was rated as 6.1 MEDIUM by NVD and 7.5 HIGH by GitHub, indicating a significant security risk. The vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation). Instances where the next.config.js file has images.loader assigned to something other than default or deployments on Vercel are not affected by this vulnerability (NVD).

Impact

The vulnerability could allow attackers to execute cross-site scripting attacks through the Image Optimization API when specific configuration conditions are met. This could potentially lead to unauthorized access to user data or execution of malicious code in the context of the affected web application (GitHub Advisory).

Mitigation and workarounds

The vulnerability was patched in Next.js version 11.1.1. Users are advised to upgrade to this version or later. For those unable to upgrade immediately, two workarounds are available: either assign the images.loader to something other than default in the next.config.js file, or deploy the application on Vercel, as Vercel deployments are not affected by this vulnerability (GitHub Advisory, Next.js Release).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-67731HIGH8.7
  • JavaScriptJavaScript
  • servify-express
NoYesDec 12, 2025
CVE-2025-67718HIGH8.7
  • JavaScriptJavaScript
  • formio
NoYesDec 11, 2025
CVE-2025-65513HIGH7.5
  • JavaScriptJavaScript
  • mcp-fetch-server
NoNoDec 09, 2025
CVE-2025-67716MEDIUM5.7
  • JavaScriptJavaScript
  • @auth0/nextjs-auth0
NoYesDec 11, 2025
CVE-2025-67490MEDIUM5.4
  • JavaScriptJavaScript
  • @auth0/nextjs-auth0
NoYesDec 10, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management