It amazes me that ad companies are allowed to let anyone with a few dollars shove arbitrary JavaScript/assets down the throats of the wider internet. Not only that, but the operators are financially incentivized to allow malvertising to continue operating because they're amazing repeat customers.
The problem is there's no liability for doing so. If the arbitrary JavaScript would make the ad company liable for tens of thousands in damages per user there would be a lot of innovation around making ad delivery safe.
It amazes me that site operators are willing to include ad networks in a way that gives them code execution.