Earlier quoted context omitted.
yes you just put integrity="sha384-whatever" and you're good to go
Can't do that with this one because it generates the polyfill based on the user agent.
Polyfill supply chain attack hits 100K+ sites
41–50 of 387 posts
Re: Polyfill supply chain attack hits 100K+ sites
#42> this domain was caught injecting malware on mobile devices via any site that embeds cdn.polyfill.io I've said it before, and I'll say it again: https://httptoolkit.com/blog/public-cdn-risks/ You can reduce issues like this using subresource intergrity (SRI) but there are still tradeoffs (around privacy & reliability - see article above) and there is a better solution: self-host your dependencies behind a CDN servic…
It's especially annoying because the projects I've seen it on were using NPM anyway so they could have easily pulled the dependency in through there. Hell, even without NPM it's not hard to serve these JS libraries internally since they tend to get packed into one file (+ maybe a CSS file).
Re: Polyfill supply chain attack hits 100K+ sites
#43Game theory at work? Someone needs to maintain legacy code for free that hosts thousands of sites and gets nothing but trouble (pride?) in return. Meanwhile the forces of the world present riches and power in return to turn to the dark side (or maybe just letting your domain lapse and doing something else). If security means every maintainer of every OSS package you use has to be scrupulous, tireless, and not screw u…
Re: Polyfill supply chain attack hits 100K+ sites
#44Game theory at work? Someone needs to maintain legacy code for free that hosts thousands of sites and gets nothing but trouble (pride?) in return. Meanwhile the forces of the world present riches and power in return to turn to the dark side (or maybe just letting your domain lapse and doing something else). If security means every maintainer of every OSS package you use has to be scrupulous, tireless, and not screw u…
Re: Polyfill supply chain attack hits 100K+ sites
#45Earlier quoted context omitted.
But if the dependency from a CDN is already cached, it will skip an extra resource and site will load faster. I agree with the points though.
Because of modern cache partitioning, HTTP/2+ multiplexing, and sites themselves being served off CDNs, external CDNs are now also worse for performance. If you use them, though, use subresource integrity.
Funnily enough I can't set up CDN on Azure at work because it's not approved but I could link whatever random ass CDN I want for external dependencies if I was so inclined.
Re: Polyfill supply chain attack hits 100K+ sites
#46[flagged]
No, it wasn’t. It was always a really bad idea, and it’s been exploited repeatedly since the start.
Re: Polyfill supply chain attack hits 100K+ sites
#47[flagged]
> Relying on third-party, un-audited code was acceptable when the majority of contributors were from the West. No, it wasn’t. It was always a really bad idea, and it’s been exploited repeatedly since the start.
Re: Polyfill supply chain attack hits 100K+ sites
#48Game theory at work? Someone needs to maintain legacy code for free that hosts thousands of sites and gets nothing but trouble (pride?) in return. Meanwhile the forces of the world present riches and power in return to turn to the dark side (or maybe just letting your domain lapse and doing something else). If security means every maintainer of every OSS package you use has to be scrupulous, tireless, and not screw u…
Re: Polyfill supply chain attack hits 100K+ sites
#49> this domain was caught injecting malware on mobile devices via any site that embeds cdn.polyfill.io I've said it before, and I'll say it again: https://httptoolkit.com/blog/public-cdn-risks/ You can reduce issues like this using subresource intergrity (SRI) but there are still tradeoffs (around privacy & reliability - see article above) and there is a better solution: self-host your dependencies behind a CDN servic…
> self-host your dependencies I can kind of understand why people went away from this, but this is how we did it for years/decades and it just worked. Yes, doing this does require more work for you, but that's just part of the job.
In my experience from inside companies, we went from self-hosting with largely ssh access to complex deployment automation and CI/CD that made it hard to include any new resource in the build process. I get the temptation: resources linked from external domains / cdns gave the frontend teams quick access to the libraries, fonts, tools, etc. they needed.
Thankfully things have changed for the better and it's much easier to include these things directly inside your project.
Re: Polyfill supply chain attack hits 100K+ sites
#50I had this conversation countless times with developers: are you really ok if someone hijacks the CDN for the code you're including? They almost always seem to be fine with it, simply because everyone else is doing it like this. At the same time they put up with countless 2FAs in the most mundane places. The follow up of "you know that the random packages you're including could have malware" is even more hopeless.
yes you just put integrity="sha384-whatever" and you're good to go