CVE-2021-3780: Cross-site Scripting in peertube
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.5635%
CWE
Published
9/20/2021
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
peertube | npm | < 3.4.0 | 3.4.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from using DomSanitizer.bypassSecurityTrustResourceUrl
with URL.createObjectURL
on user-uploaded SVG files. This combination allowed malicious scripts in SVGs to execute when rendered as image previews. The patched commit replaced these dangerous calls with imageToDataURL
(using FileReader.readAsDataURL
), which properly sanitizes the content by converting it to a data URL without executing embedded scripts. The affected functions were in multiple image preview components handling avatar, banner, and generic upload previews.