CVE-2021-41086: Jsuites Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-qh7x-j4v8-qw5w
CVSS 8.7
CWE-79
Published
Advisory Summary

CVE-2021-41086 is a HIGH (CVSS 8.7) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Jsuites libraries in the npm ecosystem. The issue involves clipboard-based xss. Remediation is available by upgrading affected packages to version 4.9.11.

CVE-2021-41086 at a Glance

CVE Identifier CVE-2021-41086
GHSA Identifier GHSA-qh7x-j4v8-qw5w
Severity HIGH
CVSS v3.1 Base Score 8.7
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Jsuites
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2021-41086

To remediate this vulnerability, upgrade all affected Jsuites dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jsuites fixed: 4.9.11
npm install jsuites@4.9.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls jsuites

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-41086, inspect your project dependencies using npm:

npm ls jsuites

Analyze the terminal output to locate any version of Jsuites in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.9.11), your application is affected.

Note: The npm ls jsuites command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Jsuites, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact XSS against the user. ### Details jsuites is vulnerable to DOM based XSS if the user can be tricked into copying _anything_ from a malicious and pasting it into the html editor. This is because a part of the clipboard content is directly written to `innerHTML` causing XSS. ### References The Curious Case of Copy & Paste – on risks of pasting arbitrary content in browsers: https://research.securitum.com/the-curious-case-of-copy-paste/

CVE-2021-41086 Affected Jsuites Versions

1 component(s)
Fixed Versions:
4.9.11
Product / Package Ecosystem Affected Versions Fixed Version
jsuites
npm
< 4.9.11
4.9.11

References

Frequently Asked Questions

What is CVE-2021-41086?
CVE-2021-41086 is a security vulnerability in Jsuites involving Clipboard-based XSS under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Jsuites versions are affected?
Affected versions include releases prior to 4.9.11 across affected packages: jsuites.
What version fixes CVE-2021-41086?
Upgrading to 4.9.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jsuites affected?
Yes, jsuites is affected in releases prior to 4.9.11. Upgrade your dependency to 4.9.11 or later.
What is the CVSS score of CVE-2021-41086?
CVE-2021-41086 has a CVSS v3.1 base score of 8.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2021-41086?
CVE-2021-41086 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2021-41086?
Run the dependency tree command: 'npm ls jsuites'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qh7x-j4v8-qw5w",
  "modified" : "2021-10-21T14:19:54Z",
  "published" : "2021-09-22T20:39:26Z",
  "aliases" : [ "CVE-2021-41086" ],
  "summary" : "Clipboard-based XSS",
  "details" : "### Impact\nXSS against the user.\n\n### Details\njsuites is vulnerable to DOM based XSS if the user can be tricked into copying _anything_ from a malicious and pasting it into the html editor. This is because a part of the clipboard content is directly written to `innerHTML` causing XSS.\n\n### References\nThe Curious Case of Copy & Paste – on risks of pasting arbitrary content in browsers: https://research.securitum.com/the-curious-case-of-copy-paste/\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jsuites"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.9.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jsuites/jsuites/security/advisories/GHSA-qh7x-j4v8-qw5w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-41086"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsuites/jsuites/commit/d47a6f4e143188dde2742f4cffd313e1068ad3b3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsuites/jsuites/commit/fe1d3cc5e339f2f4da8ed1f9f42271fdf9cbd8d2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jsuites/jsuites"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/jsuites"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-21T21:50:39Z",
    "nvd_published_at" : "2021-09-21T21:15:00Z"
  }
}