Basically someone who had permissions to alter site js, accidentally added malicious js. The main solution is to be very careful about giving user accounts permission to edit js.
[There are of course other hardening things that maybe should be done based on lessons learned]
The account in question had "staff" rights which gave him basically all rights on all wikis.
It used to be all "admin" accounts, of which there were many more. Restricting it to "interface admin" only is a fairly recent change.
Its been 8 years!
It's a common feature of CMS'es and "tag management systems." Its presence is a massive PITA to developers even _besides_ the security, but PMs _love them_, in my experience.