CVE-2023-37259: Matrix react sdk Cross-Site Scripting Vulnerability
MODERATECVE-2023-37259 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Matrix react sdk libraries in the npm ecosystem. The issue involves matrix-react-sdk vulnerable to xss in export chat feature. Remediation is available by upgrading affected packages to version 3.76.0.
CVE-2023-37259 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N).
How to Fix CVE-2023-37259
To remediate this vulnerability, upgrade all affected Matrix react sdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install matrix-react-sdk@3.76.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls matrix-react-sdk
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-37259, inspect your project dependencies using npm:
npm ls matrix-react-sdk
Analyze the terminal output to locate any version of Matrix react sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.76.0), your application is affected.
Note: The npm ls matrix-react-sdk 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-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Matrix react sdk, 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
CVE-2023-37259 Affected Matrix react sdk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-react-sdk
|
npm |
≥ 3.32.0
< 3.76.0
|
3.76.0
|
References
Frequently Asked Questions
What is CVE-2023-37259?
Which Matrix react sdk versions are affected?
What version fixes CVE-2023-37259?
Is matrix-react-sdk affected?
What is the CVSS score of CVE-2023-37259?
What CWE is associated with CVE-2023-37259?
How can I check npm dependencies for CVE-2023-37259?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c9vx-2g7w-rp65",
"modified" : "2023-07-19T20:04:38Z",
"published" : "2023-07-18T16:58:01Z",
"aliases" : [ "CVE-2023-37259" ],
"summary" : "matrix-react-sdk vulnerable to XSS in Export Chat feature",
"details" : "### Description\n\nThe Export Chat feature includes certain attacker-controlled elements in the generated document without sufficient escaping, leading to stored XSS.\n\n### Impact\n\nSince the Export Chat feature generates a separate document, an attacker can only inject code run from the `null` origin, restricting the impact.\n\nHowever, the attacker can still potentially use the XSS to leak message contents. A malicious homeserver is a potential attacker since the affected inputs are controllable server-side.\n\n### Patches\nThis was patched in matrix-react-sdk 3.76.0.\n\n### Workarounds\nNone, other than not using the Export Chat feature.\n\n### References\nN/A\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "matrix-react-sdk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.32.0"
}, {
"fixed" : "3.76.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-react-sdk/security/advisories/GHSA-c9vx-2g7w-rp65"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-37259"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-react-sdk/commit/22fcd34c606f32129ebc967fc21f24fb708a98b8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/matrix-react-sdk"
}, {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.76.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-80" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-07-18T16:58:01Z",
"nvd_published_at" : "2023-07-18T17:15:11Z"
}
}