{"id":"CVE-2021-32622","aliases":["CVE-2021-32622","GHSA-8796-gc9j-63rv","GHSA-cg57-p69r-3m7p"],"related":[],"kind":"vulnerability","state":"published","title":"File upload local preview can run embedded scripts after user interaction","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Matrix-React-SDK es un SDK basado en react para insertar un cliente de chat/voip de Matrix en una página web.&#xa0;Anterior a versión 3.21.0, al cargar un archivo, la vista previa del archivo local puede conllevar a una ejecución de scripts insertados en el archivo cargado.&#xa0;Esto solo puede ocurrir después de varias interacciones del usuario para abrir la vista previa en una pestaña separada.&#xa0;Esto solo afecta al usuario local durante el proceso de carga.&#xa0;No puede ser explotado remotamente o por otros usuarios.&#xa0;Esta vulnerabilidad está parcheada en la versión 3.21.0","source":"nvd"}],"published":"2021-05-17T19:35:11.000Z","modified":"2026-07-08T06:49:32.495Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","score":4.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","score":4.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","score":4.2,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:M/Au:N/C:P/I:P/A:P","score":4.4,"rating":"MEDIUM"}],"cwes":["CWE-74","CWE-434"],"affected":[{"ranges":[{"version":"< 3.21.0","status":"affected"}],"vendor":"matrix-org","product":"matrix-react-sdk","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.21.0"}],"ecosystem":"npm","package":"matrix-react-sdk","purl":"pkg:npm/matrix-react-sdk","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.21.0"}],"ecosystem":"npm","package":"matrix-react-sdk","purl":"pkg:npm/matrix-react-sdk","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.21.0"}],"vendor":"matrix-react-sdk_project","product":"matrix-react-sdk","cpe":"cpe:2.3:a:matrix-react-sdk_project:matrix-react-sdk:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/matrix-org/matrix-react-sdk/security/advisories/GHSA-8796-gc9j-63rv","tags":["patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/matrix-org/matrix-react-sdk/pull/5981","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/matrix-org/matrix-react-sdk","tags":["package"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32622","tags":["advisory"],"sources":["ghsa"]},{"url":"https://www.npmjs.com/package/matrix-react-sdk","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-32622","url":"https://www.cve.org/CVERecord?id=CVE-2021-32622","licence":"CVE Terms of Use","modified":"2024-08-03T23:25:30.863Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8796-gc9j-63rv","url":"https://github.com/advisories/GHSA-8796-gc9j-63rv","licence":"CC-BY-4.0","modified":"2026-07-08T06:49:32.495Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cg57-p69r-3m7p","url":"https://github.com/advisories/GHSA-cg57-p69r-3m7p","licence":"CC-BY-4.0","modified":"2026-07-08T06:49:32.495Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-32622","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32622","licence":"Public domain","modified":"2026-06-17T03:53:17.460Z"}],"updatedAt":"2026-11-25T22:58:01.449Z","epss":{"score":0.00373,"percentile":0.33326,"date":"2026-12-01T12:00:22.000Z"}}