Live data from Hacker News

Polyfill supply chain attack hits 100K+ sites

sansec.io

221–230 of 387 posts

Re: Polyfill supply chain attack hits 100K+ sites

#221
post #88

start projects with Content-Security-Policy: default-src 'self'; then add narrow, individually justified exceptions.

That wouldn't have helped here.

Anyone adding CSPs would have had polyfill.io as permitted... which allowed this attack.

Re: Polyfill supply chain attack hits 100K+ sites

#222
MathJax [1] still recommends this way of using it:

  
  
Therefore, if you ever used MathJax, by possibly copying the above and forgetting, make sure to patch it out.

[1] https://www.mathjax.org/#gettingstarted

EDIT: To clarify, patch out just the polyfill (the first line in the snippet). You can of course keep using MathJax, and the second line alone should be enough. (Though still better host a copy by yourself, just in case).

Re: Polyfill supply chain attack hits 100K+ sites

#223

> 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…

Also the folks who spec'ed ES6 modules didn't think it was a required feature to ship SRI from that start so it's still not broadly and easily supported across browsers. I requested the `with` style import attributes 8 years ago and it's still not available. :/

Re: Polyfill supply chain attack hits 100K+ sites

#224

Earlier quoted context omitted.

Does this person telling us not to use polyfill.io, and the guy who sold polyfill.io to the chinese company both work at Fastly? If so, that's kind of awkward...

It appears both currently do work for Fastly. I am pleased the Fastly developer advocate warned us, and announced a fork and alternative hosting service: [1] https://community.fastly.com/t/new-options-for-polyfill-io-u... But it leaves me with an uneasy feeling about Fastly.

literally went from cloudflare to fastly and now this stuff happpens....

can't catch a break

Re: Polyfill supply chain attack hits 100K+ sites

#225

> 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…

World Economic Forum website is affected here, for example!

What did they say about ownership? How ironic.

Re: Polyfill supply chain attack hits 100K+ sites

#226
post #52

> 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…

I always prefer to self-host my dependencies, but as a developer who prefer to avoid an npm-based webpack/whatever build pipeline it's often WAY harder to do that than I'd like. If you are the developer of an open source JavaScript library, please take the time to offer a downloadable version of it that works without needing to run an "npm install" and then fish the right pieces out of the node_modules folder. jQuery…

I always prefer to self-host my dependencies,

Wouldn't this just be called hosting?

Re: Polyfill supply chain attack hits 100K+ sites

#227

> 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…

[flagged]

Re: Polyfill supply chain attack hits 100K+ sites

#228

Earlier quoted context omitted.

polyfilling and minification both belong on the ash heap of js development technologies.

I would agree with you if minification delivered marginal gains, but it will generally roughly halve the size of a large bundle or major JS library (compared to just gzip'ing it alone), and this is leaving aside further benefits you can get from advanced minification with dead code removal and tree-shaking. That means less network transfer time and less parse time. At least for my use-cases, this will always justify…

Cool, I can download 20 MB of JavaScript instead of 40. Everyone uses minification, and "web apps" still spin up my laptop fans. Maybe we've lost the plot.

Re: Polyfill supply chain attack hits 100K+ sites

#229
post #206

Earlier quoted context omitted.

> prefer to avoid an npm-based webpack/whatever build pipeline What kind of build pipeline do you prefer, or are you saying that you don't want any build pipeline at all?

I don't want a build pipeline. I want to write some HTML with a script type=module tag in it with some JavaScript, and I want that JavaScript to load the ES modules it depends on using import statements (or dynamic import function calls for lazy loading).

That's still allowed! :)
Post reply on HN