LiveActive security incident?Get immediate response
CVE Record

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

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.

HighCVSS 7.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

This issue can let an attacker run unwanted script in a user's browser through Next.js image handling, but only in a narrow setup. Exposure requires affected Next.js versions, configured image domains, and an allowed image host that accepts user-provided SVG. Vercel deployments and non-default image loaders are reported as not affected.

Executive priority

Prioritize remediation for public-facing, self-hosted Next.js applications that use the built-in image optimizer with configured external image domains. The issue is high severity but conditional, so exposure validation should come before broad emergency response.

Technical view

CVE-2021-39178 is a CWE-79 cross-site scripting flaw in the Next.js Image Optimization API. Sources identify affected Next.js versions as 10.0.0 through before 11.1.1, with the fix in 11.1.1. The vulnerable condition depends on default image loading, images.domains configuration, and a listed host allowing user-provided SVG.

Likely exposure

Most likely exposed systems are self-hosted Next.js applications using versions >=10.0.0 and <11.1.1, the default image loader, and images.domains entries pointing to hosts where users can upload SVG content.

Exploitation context

The CVSS vector shows network attack surface, high complexity, no privileges, and required user interaction. The supplied sources do not show CISA KEV listing or active exploitation evidence. Risk is meaningful where the exact configuration exists because browser script execution can affect user sessions and data.

Researcher notes

The key research question is configuration reachability, not just package version. Confirm default image loader use, non-Vercel hosting, images.domains presence, and whether any trusted image host can serve user-controlled SVG. The source bundle does not provide exploit telemetry.

Mitigation direction

  • Upgrade Next.js to version 11.1.1 or later.
  • Review next.config.js for images.domains usage.
  • Remove or restrict image domains that allow user-provided SVG.
  • Confirm whether deployment is on Vercel or uses a non-default image loader.
  • If upgrade is delayed, follow current vendor guidance.

Validation and detection

  • Inventory Next.js applications and dependency versions.
  • Flag versions >=10.0.0 and <11.1.1 for review.
  • Inspect next.config.js for images.domains entries.
  • Check whether listed image hosts permit user-provided SVG uploads.
  • Confirm images.loader and hosting model for affected applications.
  • Verify remediation by confirming Next.js 11.1.1 or later.
Prepared
Confidence
high
Sources
4

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · medium confidence lookup

CWE-79: User-session and phishing behavior lookup

Client-side and session-facing weaknesses should be reviewed alongside initial-access and user-execution behaviors. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-39178 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
3Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H1.65.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.5High
CVSS 3.1 vector shape for CVE-2021-39178Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
vercelnext.js>= 10.0.0, < 11.1.1Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.