File upload local preview can run embedded scripts after user interactionGHSA-8796-gc9j-63rv
MEDIUMGHSA-8796-gc9j-63rv is a medium-severity (CVSS 4.2) CWE-74 vulnerability in matrix-react-sdk. A fix is available for matrix-react-sdk — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
matrix-react-sdknpmDescription
Impact
When 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.
Patches
This has been fixed by https://github.com/matrix-org/matrix-react-sdk/pull/5981, which is included in 3.21.0.
Workarounds
There are no known workarounds.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | matrix-react-sdk | all versions | 3.21.0npm install matrix-react-sdk@3.21.0 |
Affected Products
matrix-react-sdkmatrix-react-sdk_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for matrix-react-sdk, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update matrix-react-sdk to 3.21.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-8796-gc9j-63rv is resolved across your whole dependency graph.
Workarounds
Treat uploaded files as untrusted until proven otherwise: validate the actual content type rather than the supplied extension, store uploads outside the web root on a volume mounted without execute permission, and rename them to server-generated identifiers so an attacker cannot choose the path a request will later resolve.
Frequently Asked Questions
Is GHSA-8796-gc9j-63rv in your dependencies?
Find it across npm, including transitive dependencies.