Third-party marketing JS is the problem
Tag managers and A/B tools let marketing inject unvetted, constantly changing scripts, and this attack is the predictable result.
No accountability, so nothing changes
Costs are externalised onto users, so some argue for civil or criminal liability, while others worry that would crush open source maintainers.
Lock it down with CSP, SRI, blockers
Strict CSP, self-hosted vetted scripts, Subresource Integrity, and client-side blockers like uMatrix or NoScript would have limited the damage, though SRI clashes with scripts that change all the time.