Miggo Logo

CVE-2021-29434: Improper validation of URLs ('Cross-site Scripting') in Wagtail rich text fields

6.1

CVSS Score
3.1

Basic Information

EPSS Score
0.50524%
Published
4/20/2021
Updated
11/19/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
wagtailpip>= 2.12, <= 2.12.32.12.4
wagtailpip<= 2.11.62.11.7

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from missing URL protocol validation in the rich text content conversion process. The patch adds wagtail.core.whitelist.check_url validation to the link_entity function, which handles external link processing. The pre-patch version in contentstate.py directly assigned props.get('url') without validation, making this function the injection point. The diff shows this was the only modification required to fix the XSS vulnerability, confirming this function's critical role in the security flaw.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t W**n s*vin* t** *ont*nts o* * ri** t*xt *i*l* in t** **min int*r****, W**t*il *o*s not *pply s*rv*r-si** ****ks to *nsur* t**t link URLs us* * v*li* proto*ol. * m*li*ious us*r wit* ****ss to t** **min int*r**** *oul* t*us *r**t * POST r*qu

Reasoning

T** vuln*r**ility st*ms *rom missin* URL proto*ol v*li**tion in t** ri** t*xt *ont*nt *onv*rsion pro**ss. T** p*t** ***s w**t*il.*or*.w*it*list.****k_url v*li**tion to t** link_*ntity *un*tion, w*i** **n*l*s *xt*rn*l link pro**ssin*. T** pr*-p*t** v*