CVE-2021-42648 Cross site scripting in code-server

Medium 6.1 Published Updated

Attackers can execute arbitrary code via crafted URLs in Code-Server, requiring an upgrade to secure the web application.

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-2021-42648?

CVE-2021-42648 is a medium-severity cross-site scripting vulnerability in n/a, published on 11 May 2022. 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

Cross-site scripting (XSS) vulnerability exists in Coder Code-Server before 3.12.0, allows attackers to execute arbitrary code via crafted URL.

Weakness: CWE-79

Which versions are affected by CVE-2021-42648?

2 open source packages ship an affected version, including code-server. It affects 1 product.

PackageAffectedFixed in
code-server npmAll versions3.12.0
code-server npmAll versions3.12.0

Products include Coder Code-Server.

How do I fix CVE-2021-42648?

Upgrade code-server to 3.12.0 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-2021-42648 being exploited?

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

Sources

Also known as GHSA-2gp3-6c9p-jp7w.

Is CVE-2021-42648 in your software?

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

Check your SBOMs for free