Problem
Since the CORS header can be set with an API param, that means a site can make a request to an intranet site and it will work.
Example:
I have a MediaWiki install setup at 192.168.1.1 and it is only accessible on the local network. I visit https://example.com and that website makes an XHR request to http://192.168.1.1. and sets the origin param to *. This allows example.com to read everything on my wiki that was only accessible over the local network.
Solution
The origin parameter should be removed and the configuration should be global (i.e. for all requests) and set in LocalSettings.php For Wikimedia Wikis, see T210790
Alternative Solution
One could argue that the intranet site is exposed to any client application, and therefor, is not a problem. If that is the case, then the origin parameter is useless and should be removed and all requests should have Access-Control-Allow-Origin: *