Quick answers
- Is CVE-2021-42648 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2021-42648 being exploited in the wild.
- How severe is CVE-2021-42648?
- Low severity, with a CVSS score of 3.1, published 12 May 2022.
- Which products and versions are affected?
- code-server (npm) SEMVER:introduced=0,fixed=3.12.0.
- Is there a fix for CVE-2021-42648?
- Yes. code-server (npm): upgrade to 3.12.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2021-42648 attacked?
- It is attacked over the network, in a network appliance.
- Am I affected by CVE-2021-42648?
- Check whether you run code-server (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- code-server (npm): upgrade to 3.12.0 or later
npm install code-server@3.12.0
Technical details
A reflected cross-site scripting (XSS) vulnerability exists in Coder code-server versions prior to 3.12.0. The root cause is the failure to escape HTML content within error messages before rendering them on the error page (specifically within 'src/node/routes/errors.ts'). An attacker can exploit this by tricking a user into clicking a specially crafted URL containing malicious scripts. If successful, the attacker can execute arbitrary JavaScript in the context of the user's session, which could lead to session hijacking or unauthorized data access. The issue was resolved in version 3.12.0 by implementing proper HTML escaping for error message strings.
Affected products
- Coder code-server < 3.12.0
Identifiers
- CVE-2021-42648
- GHSA-2gp3-6c9p-jp7w
Timeline
- 2021-11-09: patched: Fix merged into main branch via PR 4430
- 2022-05-11: advisory: NVD published CVE-2021-42648
- 2022-05-12: disclosed: GitHub Advisory published