Wagtail vulnerable to stored Cross-site Scripting attack via ModelAdmin views
Date: 2023-04
Affected: pip/wagtail, pip/wagtail
Attack vector: xss
Category: vulnerability-disclosure
Severity: High
CVE: CVE-2023-28836
CWE: CWE-79
CVSS: 6.4 (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H)

### Impact A stored cross-site scripting (XSS) vulnerability exists on ModelAdmin views within the Wagtail admin interface. A user with a limited-permission editor account for the Wagtail admin could potentially craft pages and documents that, when viewed by a user with higher privileges, could perform actions with that user's credentials. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin, and only affects sites with ModelAdmin enabled. - For page, the vulnerability is in the "Choose a parent page" ModelAdmin view ([`ChooseParentView`](https://docs.wagtail.org/en/stable/reference/contrib/modeladmin/chooseparentview.html#customising-chooseparentview)), available when managing pages via ModelAdmin. - For documents, the vulnerability is in the ModelAdmin Inspect view ([`InspectView`](https://docs.wagtail.org/en/stable/reference/contrib/modeladmin/inspectview.html#enabling-customising-inspectview)) when displaying document fields. ### Patches Patched versions have been released as Wagtail 4.1.4 (for the LTS 4.1 branch) and Wagtail 4.2.2 (for the current 4.2 branch). ### Workarounds Site owners who are unable to upgrade to the new versions can disable or override the corresponding functionality. #### `ChooseParentView` For [`ChooseParentView`](https://docs.wagtail.org/en/stable/reference/contrib/modeladmin/chooseparentview.html#modeladmin-choose-parent-view-class): - Disable ModelAdmin for all page models. - Or provide a


Mitigations:

Architectural layers (MAESTRO):