CVE-2021-42648: Cross-Site Scripting in code-server

code-server Updated 02 Oct 2025

Summary

12/05/2022
Yes i
Moderate
6.1

CVE-2021-42648: Cross site scripting in code-server. Affects code-server versions < 3.12.0. Fixed in 3.12.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

code-server is an open-source platform that allows users to run Visual Studio Code on a remote server. It provides a web-based interface for coding and editing files. This vulnerability affects code-server versions prior to 3.12.0. The vulnerability allows attackers to execute arbitrary code by exploiting a cross-site scripting (XSS) vulnerability through a crafted URL.

Vulnerability Detail

The cross-site scripting (XSS) vulnerability in code-server allows attackers to inject and execute arbitrary code by manipulating the URL. This can lead to various security risks, such as unauthorized access, data theft, and privilege escalation. The vulnerability is rated as moderate severity with a CVSS score of 6.1. The CWE ID associated with this vulnerability is CWE-79.

How To Fix

Minimum fixed version

3.12.0

This is the first release that contains the fix.

npm install code-server@3.12.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update to the latest version of code-server to address the issue.

Conclusion

The cross-site scripting (XSS) vulnerability in code-server poses a moderate security risk, allowing attackers to execute arbitrary code. It is crucial to update code-server to version 3.12.0 or later to mitigate this vulnerability. Users should take immediate action to ensure the security of their code-server installation. For additional support and guidance, contact DevNack.com.

See every vulnerability recorded for code-server →

Share this vulnerability

FAQ

code-server is an open-source platform that allows users to run Visual Studio Code on a remote server. It provides a web-based interface for coding and editing files.

Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. This can lead to various attacks, such as session hijacking, data theft, and defacement.

This vulnerability can be exploited by attackers to execute arbitrary code, leading to unauthorized access, data theft, and privilege escalation. It is crucial to address this vulnerability promptly to prevent potential security breaches.

You can use Vulert's playground at Vulert Scanner to check if your code-server installation is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities without requiring access to the code or installation.

For further support on vulnerability remediation, you can contact info@devnack.com. They can provide assistance and guidance in addressing this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for code-server.

How To Fix

Minimum fixed version

3.12.0

This is the first release that contains the fix.

npm install code-server@3.12.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback