Miggo Logo

CVE-2021-3780: Cross-site Scripting in peertube

6.1

CVSS Score
3.1

Basic Information

EPSS Score
0.5635%
Published
9/20/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
peertubenpm< 3.4.03.4.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

p**rtu** is vuln*r**l* to Improp*r N*utr*liz*tion o* Input *urin* W** P*** **n*r*tion ('*ross-sit* S*riptin*'). It w*s *oun* t**t on* *oul* uplo** * SV* im*** *n* t**n s*n* t** url o* t**t to ot**r us*rs *n* w**n t**y op*n t** link w* **n **t t**ir *

Reasoning

T** vuln*r**ility st*mm** *rom usin* `*omS*nitiz*r.*yp*ssS**urityTrustR*sour**Url` wit* `URL.*r**t*O*j**tURL` on us*r-uplo**** SV* *il*s. T*is *om*in*tion *llow** m*li*ious s*ripts in SV*s to *x**ut* w**n r*n**r** *s im*** pr*vi*ws. T** p*t**** *ommi