Special:OAuth/rest_redirect (apparently created to make the returnto / returntoquery mechanism used by login/signup able to target MediaWiki REST API endpoints) does unrestricted redirects.
Example: https://www.mediawiki.org/wiki/Special:OAuth/rest_redirect?rest_url=https:/evil.com/
Another example (which is fairly easy to exploit, just send the user to the login page and then have the redirect page replicate the login page with an apparent login error): https://mediawiki.org/wiki/Special:UserLogin?returnto=Special:OAuth/rest_redirect&returntoquery=rest_url%3Dhttps%3A%2F%2Fevil.com%2F
Instead of just calling wfExpandUrl() the code should validate that it received an URL with only a path component.