Multiple system messages in MultimediaViewer are vulnerable to stored XSS.
multimediaviewer-multiple-authors-combine
multimediaviewer-repository-local
- Upload a file to your wiki
- Add the file to a page
- Go to the page using the ?uselang=x-xss parameter
- Click on the thumbnail to open it in MultimediaViewer
multimediaviewer-view-expanded
- Upload a file to your wiki
- Go to the file's page while using the ?uselang=x-xss parameter
- Click on the thumbnail to open it in MultimediaViewer
multimediaviewer-copy-button
- Upload a file to your wiki
- Add the file to a page
- Go to the page using the ?uselang=x-xss parameter
- Click on the thumbnail to open it in MultimediaViewer
- Click the Download button in the bottom right
multimediaviewer-download
- Upload a file to your wiki
- Add the file to a page
- Go to the page using the ?uselang=x-xss parameter
- Click on the thumbnail to open it in MultimediaViewer
- Click the Download button in the bottom right
Cause: Concatenation of HTML and the unescaped message at https://github.com/wikimedia/mediawiki-extensions-MultimediaViewer/blob/8423935d2167119bc3421a946c720138456cb6b4/resources/mmv.ui.reuse/mmv.ui.download.pane.js#L83
multimediaviewer-download-preview-link-title
Cause: Calling .html() with the unescaped message as the argument: https://github.com/wikimedia/mediawiki-extensions-MultimediaViewer/blob/8423935d2167119bc3421a946c720138456cb6b4/resources/mmv.ui.reuse/mmv.ui.download.pane.js#L108
Requirement
Fix multiple stored XSS vulnerabilities in MultimediaViewer by ensuring system messages are properly escaped and not directly injected into the DOM using .html() or string concatenation.
Vulnerable messages:
- multimediaviewer-multiple-authors-combine
- multimediaviewer-repository-local
- multimediaviewer-view-expanded
- multimediaviewer-copy-button
- multimediaviewer-download
- multimediaviewer-download-preview-link-title
All are exploitable by manipulating the uselang parameter to x-xss, which injects arbitrary content into localized UI elements in MultimediaViewer.
BDD
Feature: XSS protection in MultimediaViewer Scenario: Localized system messages are properly escaped Given a file is uploaded and added to a wiki page And the URL is accessed with ?uselang=x-xss When the thumbnail is clicked to open MultimediaViewer Then no XSS is executed in the following UI elements: | Message key | | multimediaviewer-multiple-authors-combine | | multimediaviewer-repository-local | | multimediaviewer-view-expanded | | multimediaviewer-copy-button | | multimediaviewer-download | | multimediaviewer-download-preview-link-title |
Test Steps
Test Case 1: Validate XSS is not triggered in multimediaviewer-multiple-authors-combine
- Upload a file to the wiki
- Add the file to a wiki page
- Visit the page with ?uselang=x-xss
- Click the thumbnail to open MultimediaViewer
- AC1: Confirm the multiple authors label is shown without script execution
Test Case 2: Validate XSS is not triggered in multimediaviewer-repository-local
- Repeat steps from Test Case 1
- AC2: Confirm repository name in MultimediaViewer is not executable HTML
Test Case 3: Validate XSS is not triggered in multimediaviewer-view-expanded
- Visit the file’s page directly (not via a content page)
- Add ?uselang=x-xss to the URL
- Click the file to open in MultimediaViewer
- AC3: Confirm view-expanded label is escaped
Test Case 4: Validate XSS is not triggered in multimediaviewer-copy-button
- Open any file with ?uselang=x-xss
- Open MultimediaViewer and click “Download”
- AC4: Confirm Copy button text is safe
Test Case 5: Validate XSS is not triggered in multimediaviewer-download
- Open MultimediaViewer with ?uselang=x-xss
- Click “Download”
- AC5: Confirm Download label is not executing HTML
Test Case 6: Validate XSS is not triggered in multimediaviewer-download-preview-link-title
- Open MultimediaViewer and click “Download” tab
- AC6: Confirm preview link title is escaped properly
QA Results - Prod
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T394863#10926943 |
| 2 | ✅ | T394863#10926943 |
| 3 | ✅ | T394863#10926943 |
| 4 | ✅ | T394863#10926943 |
| 5 | ✅ | T394863#10926943 |
| 6 | ✅ | T394863#10926943 |







