One more issue found with T340201: Use custom language code to find i18n XSS issues:
Impact: A sysop account can inject arbitrary JavaScript to pages.
Steps to reproduce:
- Add <script>alert(1);</script> to MediaWiki:Youhavenewmessagesfromusers
- Have an another user write something to your talk page
- Load any page
Seems to be coming from here, although I couldn't immediately figure out how to patch this issue without breaking formatting of the message itself.