{"id":"CVE-2021-32622","aliases":["EUVD-2022-0961","GHSA-8796-gc9j-63rv","GHSA-cg57-p69r-3m7p"],"status":"published","title":"File upload local preview can run embedded scripts after user interaction","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.","severity":{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00373,"percentile":0.31592,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-434","CWE-74"],"published":"2021-05-17T19:35:11Z","modified":"2026-10-20T10:50:10Z","fixes":[{"ecosystem":"npm","package":"matrix-react-sdk","fixed_in":["3.21.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"matrix-react-sdk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.21.0"}]}]},{"source":"ghsa","ecosystem":"npm","package":"matrix-react-sdk","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.21.0"}]}]},{"source":"osv","ecosystem":"npm","package":"matrix-react-sdk","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.21.0"}]}]},{"source":"osv","ecosystem":"npm","package":"matrix-react-sdk","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"3.21.0"}]}]}],"products":[{"vendor":"matrix-org","product":"matrix-react-sdk"},{"vendor":"matrix-react-sdk_project","product":"matrix-react-sdk"}],"references":[{"url":"https://github.com/matrix-org/matrix-react-sdk/security/advisories/GHSA-8796-gc9j-63rv","tags":["x_refsource_CONFIRM","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/matrix-org/matrix-react-sdk/pull/5981","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/advisories/GHSA-8796-gc9j-63rv"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32622","tags":["advisory"]},{"url":"https://www.npmjs.com/package/matrix-react-sdk","tags":["web"]},{"url":"https://github.com/advisories/GHSA-cg57-p69r-3m7p"},{"url":"https://github.com/matrix-org/matrix-react-sdk","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-32622","title":"File upload local preview can run embedded scripts after user interaction","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.","status":"published","published":"2021-05-17T19:35:11Z","modified":"2024-08-03T23:25:30.863Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","level":"medium","assessor":"cna"}],"cwes":["CWE-74"],"updated_at":"2026-11-02T14:33:06.658806Z"}],"euvd":[{"id":"EUVD-2022-0961","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.","status":"published","published":"2021-05-17T19:35:11Z","modified":"2024-08-03T23:25:30Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","level":"medium"}],"updated_at":"2026-11-03T03:24:36.41075Z"}],"ghsa":[{"id":"GHSA-8796-gc9j-63rv","title":"File upload local preview can run embedded scripts after user interaction","description":"### 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.","status":"published","published":"2021-05-17T20:51:16Z","modified":"2023-01-09T05:04:43Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-74"],"updated_at":"2026-11-02T14:36:10.502376Z"},{"id":"GHSA-cg57-p69r-3m7p","title":"Improper file handling in matrix-react-sdk","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.","status":"published","published":"2022-02-10T23:46:51Z","modified":"2023-02-01T05:06:01Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-74","CWE-434"],"updated_at":"2026-11-02T14:36:36.66596Z"}],"nvd":[{"id":"CVE-2021-32622","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.","status":"published","published":"2021-05-17T20:15:07.527Z","modified":"2026-06-17T03:53:17.46Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","level":"medium","assessor":"secondary"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"2.0","score":4.4,"vector":"AV:L/AC:M/Au:N/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-74","CWE-434"],"updated_at":"2026-11-02T14:06:53.343329Z"}],"osv":[{"id":"CVE-2021-32622","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.","status":"published","published":"2021-05-17T20:15:07.527Z","modified":"2026-10-20T10:50:10.316189933Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:44:19.793849Z"},{"id":"GHSA-8796-gc9j-63rv","title":"File upload local preview can run embedded scripts after user interaction","description":"### 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.","status":"published","published":"2021-05-17T20:51:16Z","modified":"2026-07-08T06:49:32.495171089Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-74"],"updated_at":"2026-11-02T15:46:42.077781Z"},{"id":"GHSA-cg57-p69r-3m7p","title":"Improper file handling in matrix-react-sdk","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.","status":"published","published":"2022-02-10T23:46:51Z","modified":"2026-07-08T06:49:32.495171089Z","cvss":[{"version":"3.1","score":4.2,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-434","CWE-74"],"updated_at":"2026-11-02T15:46:44.927642Z"}]}}
