Miggo Logo

CVE-2023-28836: Wagtail vulnerable to stored Cross-site Scripting attack via ModelAdmin views

6.4

CVSS Score
3.1

Basic Information

EPSS Score
0.70827%
Published
4/3/2023
Updated
11/19/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
wagtailpip>= 1.5, < 4.1.44.1.4
wagtailpip>= 4.2, < 4.2.24.2.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key functions:

  1. PageChoiceField.label_from_instance in forms.py used mark_safe() to create breadcrumbs with unescaped page titles, allowing stored XSS in parent page selection views. The commit 5be2b1e shows this was fixed by removing mark_safe.
  2. InspectView.get_document_field_display in views.py directly interpolated document.title into HTML without escaping. The commit ff806ab demonstrates the fix by switching to format_html which auto-escapes values. Both functions handle user-controlled input (page/document titles) and were missing proper output encoding, meeting CWE-79 criteria.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t * stor** *ross-sit* s*riptin* (XSS) vuln*r**ility *xists on Mo**l**min vi*ws wit*in t** W**t*il **min int*r****. * us*r wit* * limit**-p*rmission **itor ***ount *or t** W**t*il **min *oul* pot*nti*lly *r**t p***s *n* *o*um*nts t**t, w**n

Reasoning

T** vuln*r**ility st*ms *rom two k*y *un*tions: *. P*****oi***i*l*.l***l_*rom_inst*n** in *orms.py us** m*rk_s***() to *r**t* *r****rum*s wit* un*s**p** p*** titl*s, *llowin* stor** XSS in p*r*nt p*** s*l**tion vi*ws. T** *ommit ******* s*ows t*is w