Quick answers
- Is CVE-2021-3810 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2021-3810 being exploited in the wild.
- How severe is CVE-2021-3810?
- Low severity, with a CVSS score of 3, published 20 September 2021.
- Which products and versions are affected?
- code-server (npm) SEMVER:introduced=0,fixed=3.12.0.
- Is there a fix for CVE-2021-3810?
- 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-3810 attacked?
- It is attacked over the network, in a web application.
- Am I affected by CVE-2021-3810?
- 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
code-server contains a ReDoS (Regular Expression Denial of Service) vulnerability in an ANSI escape code parsing regex located in src/node/util.ts. The vulnerable pattern exhibits catastrophic backtracking when processing specially crafted input, allowing an unauthenticated network attacker to trigger excessive CPU consumption without requiring user interaction. The regex was intended to filter ANSI color codes from terminal output but contained nested quantifiers that could cause exponential matching behavior. The vulnerability was patched in version 3.12.0 by optimizing the regex pattern to avoid backtracking. All prior versions are affected.
Affected products
- Coder code-server before 3.12.0
Identifiers
- CVE-2021-3810
- GHSA-49x3-8228-3w3m
Timeline
- 2021-09-17: disclosed: Published on NVD
- 2021-09-20: advisory: GitHub Security Advisory GHSA-49x3-8228-3w3m published
- 2021-09-20: patched: Fixed in code-server 3.12.0 via commit ca617df