GHSA-8796-gc9j-63rv: Matrix react sdk File Upload Local Preview Can Vulnerability
MODERATEGHSA-8796-gc9j-63rv is a MODERATE (CVSS 4.2) file upload local preview can vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Matrix react sdk libraries in the npm ecosystem. The issue involves file upload local preview can run embedded scripts after user interaction. Remediation is available by upgrading affected packages to version 3.21.0.
GHSA-8796-gc9j-63rv at a Glance
Security Impact
CVSS: 4.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L).
How to Fix GHSA-8796-gc9j-63rv
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.21.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 GHSA-8796-gc9j-63rv, 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.21.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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. 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
GHSA-8796-gc9j-63rv Affected Matrix react sdk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
matrix-react-sdk
|
npm |
< 3.21.0
|
3.21.0
|
References
Frequently Asked Questions
What is GHSA-8796-gc9j-63rv?
Which Matrix react sdk versions are affected?
What version fixes GHSA-8796-gc9j-63rv?
Is matrix-react-sdk affected?
What is the CVSS score of GHSA-8796-gc9j-63rv?
What CWE is associated with GHSA-8796-gc9j-63rv?
How can I check npm dependencies for GHSA-8796-gc9j-63rv?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8796-gc9j-63rv",
"modified" : "2021-10-05T16:31:48Z",
"published" : "2021-05-17T20:51:16Z",
"aliases" : [ ],
"summary" : "File upload local preview can run embedded scripts after user interaction",
"details" : "### Impact\n\nWhen uploading a file, the local file preview can lead to execution of scripts embedded in the uploaded file, but only after several user interactions to open the preview in a separate tab. This only impacts the local user while in the process of uploading. It cannot be exploited remotely or by other users.\n\n### Patches\n\nThis has been fixed by https://github.com/matrix-org/matrix-react-sdk/pull/5981, which is included in 3.21.0.\n\n### Workarounds\n\nThere are no known workarounds.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "matrix-react-sdk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.21.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/matrix-org/matrix-react-sdk/security/advisories/GHSA-8796-gc9j-63rv"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/matrix-org/matrix-react-sdk"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-17T16:51:38Z",
"nvd_published_at" : null
}
}