CVE-2018-18282 Next.js has cross site scripting (XSS) vulnerability via the 404 or 500 /_error page

Medium 6.1 Published Updated

Attackers can execute arbitrary scripts in victim browsers via the Next.js error pages, potentially leading to session hijacking or data theft.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2018-18282?

CVE-2018-18282 is a medium-severity cross-site scripting vulnerability in n/a, published on 12 Oct 2018. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Next.js 7.0.0 and 7.0.1 has XSS via the 404 or 500 /_error page.

Weakness: CWE-79

Which versions are affected by CVE-2018-18282?

2 open source packages ship an affected version, including next. It affects 1 product.

PackageAffectedFixed in
next npmFrom 7.0.07.0.2
next npmFrom 7.0.07.0.2

Products include Zeit Next.js.

How do I fix CVE-2018-18282?

Upgrade next to 7.0.2 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2018-18282 being exploited?

There is no known exploitation of CVE-2018-18282 in the wild and no public exploit code.

Sources

Also known as GHSA-qw96-mm2g-c8m7.

Is CVE-2018-18282 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free