What is the problem?
When entering a temporary username in the URL (i.e. Special:Block/<username>), as long as the username is in the correct format for a temporary account (i.e. *<anything>), we don't validate the username before sending the request to the temporaryaccount endpoint.
For example,
- Special:Block/*foobar will make the request /w/rest.php/checkuser/v0/temporaryaccount/*foobar
- Special:Block/*Unregistered_70%3Flimit=3 will make the request: /w/rest.php/checkuser/v0/temporaryaccount/*Unregistered%2070?limit=3 (the limit is applied)
I worry that this might be vulnerable to some sort of reflected XSS or cross origin attack. However, I haven't found any way to exploit this yet.
Steps to reproduce problem
- Open browser devtools to the network tab
- Go to Special:Block/*<anything>, for example:
- Special:Block/*Unregistered_70%3Flimit=3
- Special:Block/*Unregistered_99999999
- Special:Block/*Foobar
Expected behavior: No request is made to /w/rest.php/checkuser/v0/temporaryaccount/...
Observed behavior: Request is made with the username you entered in the URL, which might return a 404 or other error
Environment
Wiki(s): MediaWiki 1.41.0-alpha (a8ab841) 01:43, 26 April 2023. CheckUser 2.5 (5b750d7) 17:37, 25 April 2023.