Steps to replicate the issue (include links if applicable):
- Install MediaWiki and Cargo (making sure to use https://gerrit.wikimedia.org/r/q/I77d6013c7d5acda90fca47cb23d2a106670d421f as that fixes a bug that causes XSS 4 to fail)
- Import the following backup:
- Upload a file with the filename "html.png" (not sure if this is required, but too lazy to test)
- Create cargo tables for Template:Cargo, Template:Cargo/file, and Template:Cargo/allowedvalues
- See heading "XSS reproduction paths"
XSSes:
- XSS 1 (DOM-based, requires (editinterface)): System message cargo-viewdata-tablestooltip
- XSS 2 (DOM-based, requires (editinterface)): System message cargo-viewdata-orderbytooltip
- XSS 3 (DOM-based, requires (editinterface)): System message show
- XSS 4 (DOM-based, requires (editinterface)): System message cargo-cargotables-columncountinfo
- XSS 5 (DOM-based): HTTP query parameter header_tooltips
- XSS 6 (DOM-based, requires (editinterface), cannot use <>, requires user interaction): System message cargo-dynamictables-searchcolumn
- XSS 7 (DOM-based, requires (editinterface), requires user interaction): System message cargo-recreatedata-success (and probably everything in ext.cargo.recreatedata.js)
- XSS 8 (stored, requires (editinterface)): System message cargo-cargotables-mandatory
- XSS 9 (reflective): HTTP query parameter delimiter
- XSS 10 (reflective): HTTP query parameter filename
- XSS 11 (reflective): HTTP query parameter link_text
- XSS`12 (stored, requires (editinterface)): System message cargo-pagevalues-tablevalues
- XSS 13 (stored): Allowed values in a table
- XSS 14 (stored, requires (editinterface)): System message cargo-field-type
- XSS 15 (stored, requires (editinterface)): System message cargo-allowed-values
- XSS 16 (stored, requires (editinterface)): System message cargo-cargotables-replacementtable
- XSS 17 (stored, requires (editinterface)): System message returnto
- XSS 18 (stored, requires (editinterface)): System message cargo-switchtables-confirm
XSS reproduction paths:
- /wiki/Special:CargoQuery: XSS 1, XSS 2
- /wiki/Special:CargoTables/cargo: XSS 3, XSS 8
- /wiki/Special:CargoTables: XSS 4
- /wiki/Special:CargoQuery?tables=cargo&fields=_pageName&format=dynamic+table&header_tooltips=<script>alert("awawa (xss 5)")</script>: XSS 1, XSS 2, XSS 5
- /wiki/Special:CargoQuery?tables=cargo&fields=_pageName&format=dynamic+table&searchable_columns=yes: XSS 1, XSS 2, XSS 6
- /wiki/Template:Cargo?action=recreatedata: XSS 7
- /wiki/Special:CargoQuery?tables=cargo&fields=_pageName&format=list&delimiter=<script>alert("the+fight+against+the+eep...+(xss+9)")</script>: XSS 1, XSS 2, XSS 9
- /wiki/Special:CargoQuery?tables=cargofile&fields=file&format=zip&filename=">awawa<%2Fdiv><script>alert("xss+in+filename+%3A3+(xss+10)")<%2Fscript><div+a&link_text=<script>alert("xss+in+link+text+%3A)+(xss+11)")<%2Fscript>: XSS 1, XSS 2, XSS 10, XSS 11
- /wiki/Special:PageValues/cargo: XSS 12, XSS 14
- /wiki/Special:CargoTables/cargoallowedvalues: XSS 13
- /wiki/Special:PageValues/Cargo/allowedvalues: XSS 3, XSS 12, XSS 13, XSS 14, XSS 15
- /wiki/Special:CargoTables/cargo?_replacement (requires replacement table): XSS 3, XSS 8, XSS 16
- /wiki/Special:DeleteCargoTable/cargo?_replacement (on Delete, requires replacement table): XSS 17
- /wiki/Special:SwitchCargoTable/cargo (requires replacement table): XSS 18
- /wiki/Special:SwitchCargoTable/cargo (on Switch, requires replacement table): XSS 17
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
- MediaWiki: 1.42.1 (523b312) 15:03, 1 August 2024
- PHP: 8.1.20 (fpm-fcgi)
- MariaDB: 11.4.2-MariaDB
- Cargo: 3.6.1 (6b8d1eb) 10:34, 10 August 2024
Other information (browser name/version, screenshots, etc.):
XSS 4 requires a patched Cargo (change ID I77d6013c7d5acda90fca47cb23d2a106670d421f), as the code susceptible to the DOM-based XSS fails to load otherwise.
Miraheze issue tracker task: https://issue-tracker.miraheze.org/T12453
Video of me demonstrating all the XSSes: https://phorge-static.wikitide.net/file/data/73lu74ajmi2nj6pdeoww/PHID-FILE-2jhjxuatrm634yfkqp52/cargo-xsses.mp4
![Screenshot 2024-08-17 at 13-59-55 View replacement tabl[...].png (124×2 px, 81 KB)](https://phab.wmfusercontent.org/file/data/wgkg6gganipaqd4v377n/PHID-FILE-ddmvtuflgdavivuvrk47/preview-Screenshot_2024-08-17_at_13-59-55_View_replacement_tabl%5B...%5D.png)

