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

Published Aug 30, 2021
·
Updated

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.

Affected Software

1 affected component
Vercel Next.js Node.js>=10.0.0<11.1.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade next.js to a version that resolves this vulnerability.

    Fixed in 11.1.1
  2. Configuration

    For instances that are affected (next.config.js has images.domains set and the listed image host allows user-provided SVG), modify images.domains so that the image host(s) do not allow user-provided SVG.

    Next.js (next.config.js) images.domains = must not allow user-provided SVG in domains listed in images.domains

Event History

Aug 30, 2021
CVE Published
via MITRE·11:55 PM
Data Sourced
via MITRE·11:55 PM
DescriptionSeverityWeakness
Aug 31, 2021
Data Sourced
via NVD·12:15 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is CVE-2021-39178?

CVE-2021-39178 is a cross-site scripting vulnerability in Next.js versions between 10.0.0 and 11.0.0.

2

How severe is CVE-2021-39178?

CVE-2021-39178 has a severity rating of 6.1, which is considered high.

3

How does CVE-2021-39178 impact Next.js?

CVE-2021-39178 can allow attackers to perform cross-site scripting attacks on instances of Next.js.

4

How can I fix CVE-2021-39178?

To fix CVE-2021-39178, you should upgrade Next.js to version 11.1.1 or higher, which includes a fix for the vulnerability.

5

Where can I find more information about CVE-2021-39178?

You can find more information about CVE-2021-39178 on the Next.js GitHub page and the associated security advisory.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203