An issue was discovered in SiteLinksView.php in Wikibase in MediaWiki through 1.39.3. There is XSS via a crafted badge title attribute. This is also related to lack of escaping in wbTemplate (from resources/wikibase/templates.js) for quotes (which can be in a title attribute).
https://phabricator.wikimedia.org/T339111
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/933650
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/933649