The preview system message is appended as HTML by the TwoColConflict extension, making the message vulnerable to stored XSS.
Reproduction Steps
- Edit MediaWiki:Preview and replace its contents with <script>alert("TwoColConflict XSS")</script>
- Make sure live preview is enabled ("Show preview without reloading the page" in Special:Preferences)
- Cause the Edit conflict UI to show up while editing a page (example: Create a page with a paragraph; edit the paragraph with two accounts at once so there is a conflict)
- Select a version
- Click the "Show preview" button
Cause
The preview system message is appended unescaped into raw HTML:
