18 ms·
Polyfill supply chain attack hits 100K+ sites
- MadisonTaelor 2y ago[dead]
- doctorpangloss 2y agoBut Microsoft Azure for GitHub ScanningPoint 2024 is SOC2 compliant. How could this happen?
- ssahoo 2y agoProbably those auditors following playbook from 2008. Using ..VPN, AD, umm pass.
- jstanley 2y agoAlways host your dependencies yourself, it's easy to do & even in the absence of a supply chain attack it helps to protect your users' privacy.
- can16358p 2y agoBut 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.
- pityJuke 2y agoThat’s not been true since Site Isolation IIRC e: Not sure it’s Site Isolation specifically, but it’s definitely still not true anymore: https://news.ycombinator.com/item?id=24745748 https://news.ycombinator.com/item?id=24745748 e2: listen to the commenter below, its Cache Partitioning: https://developer.chrome.com/blog/http-cache-partitioning https://developer.chrome.com/blog/http-cache-partitioning
- andrewmcwatters 2y agoIf that's true, this is a wild microcosm example of how the web breaks in ways we don't expect.
- collinmanderson 2y ago> this is a wild microcosm example of how the web breaks in ways we don't expect. I think the performance characteristics of the web are subject to change over time, especially to allow increased security and privacy. https is another example of increased security+privacy at the cost of being slightly slower than non-https connections because of an extra round trip or two to create the connection. The lesson I take from it is: don't use complicated optimization techniques that might get out of date over time. Keep it simple instead of chasing every last bit of theoretical performance. For example, there used to be a good practice of using "Domain Sharding" to allow browsers to download more files in parallel, but was made obsolete with HTTP/2, and domain sharding now has a net negative effect, especially with https. https://developer.mozilla.org/en-US/docs/Glossary/Domain_sharding https://developer.mozilla.org/en-US/docs/Glossary/Domain_sha... Now they're realizing that HTTP/2's multiplexing of a single TCP connection can have negative effects on wireless connections, so they're working on HTTP/3 to solve that. Also don't use polyfills. If your supported browsers don't support the feature then don't use the feature, or implement the fallback yourself. Use the features that are actually available to you.
- simonw 2y agoRight - and site isolation is about five years old at this point. The idea that CDNs can share caches across different sites is quite out of date.
- can16358p 2y agoDidn't know that. Then why are we (I mean, many web devs) still using it? Just an old convention, simplicity, or saving bandwidth?
- minitech 2y agoBecause 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.
- fkyoureadthedoc 2y ago> and sites themselves being served off CDNs 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.
- toast0 2y agoIn addition to Cache Partitioning, it was never really likely that a user had visited another site that used the same specific versions from the same cdn as your site uses. Making sure all of your pages were synchronized with the same versions and bundling into appropriate bits for sharing makes sense, and then you may as well serve it from your own domain. I think serving from your www server is fine now, but back in the day there were benefits to having a different hostname for static resources and maybe it still applies (I'm not as deep into web stuff anymore, thank goodness).
- antifa 2y agoThis theory gets parroted endlessly, but nearly never actually happens in reality.
- api 2y agoSoftware supply chains feel like one of the Internet's last remaining high-trust spaces, and I don't think that's going to last long. A tidal wave of this is coming. I'm kind of surprised it's taken this long given how unbelievably soft this underbelly is.
- acedTrex 2y agogoing back to rolling it yourself, or relying on a few high quality stdlib providers that you likely have to pay for.
- aembleton 2y agoPaying for dependencies sounds like a good idea. Reduces the incentive to sell out; allows contributors to quit day jobs to focus on fixing bugs and security holes; less likely to result in abandonware.
- im3w1l 2y agoSo what did the malware actually do?
- rolph 2y agoThe first time a user, who uses a phone, open a website through an ads ( google ads or facebook ) with this link, it will redirect user to a malicious website. The request send to https://cdn.polyfill.io/v2/polyfill.min.js https://cdn.polyfill.io/v2/polyfill.min.js needs to match the following format: Request for the first time from a unique IP, with a unique User-Agent. User-Agent match that of a phone, we used an iphone's user agent ( Mozilla/5.0 (iPhone14,2; U; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/15E148 Safari/602.1 ). Referer from a reputable website that installed polyfill. Accept / Accept-Encoding gzip, deflate, br, zstd Delete all cookies The request will return the original polyfill code, appended with a piece of malicious code. This code will make a run javascript from https://www.googie-anaiytics.com/ga.js https://www.googie-anaiytics.com/ga.js , if the device is not a laptop. You can reproduce this multiple time on the same machine by changing User agent gently, (ex: change Mozilla/5.0 to Mozilla/6.0). Sometimes the server will just timeout or return code without the injection, but it should work most of the time. The javascript on https://www.googie-anaiytics.com/ga.js https://www.googie-anaiytics.com/ga.js will redirect users to a malicious website based on some condition check for a number of conditions before running ( useragent, screen width, ...) to ensure it is a phone, the entry point is at the end: bdtjfg||cnzfg||wolafg||mattoo||aanaly||ggmana||aplausix||statcct?setTimeout(check_tiaozhuan,-0x4*0x922+0x1ebd+0xd9b):check_tiaozhuan(); The code has some protection built-in, so if it is run on a non-suitable environment, it will attempt to relocate a lot of memory to freeze the current devices. It also re-translate all attribute name access with _0x42bcd7 . https://github.com/polyfillpolyfill/polyfill-service/issues/ https://github.com/polyfillpolyfill/polyfill-service/issues/...
- stusmall 2y agoI'm surprised there is no mention of subresource integrity in the article. It's a low effort, high quality mitigation for almost any JS packages hosted by a CDN. EDIT: Oh, it's because they are selling something. I don't know anything about their offerings, but SRI is made for this and is extremely effective.
- davidfischer 2y agoSRI generally won't work here because the served polyfill JS (and therefore the SRI hash) depends on the user agent/headers sent by the user's browser. If the browser says it's ancient, the resulting polyfill will fill in a bunch of missing JS modules and be a lot of JS. If the browser identifies as modern, it should return nothing at all. Edit: In summary, SRI won't work with a dynamic polyfill which is part of the point of polyfill.io. You could serve a static polyfill but that defeats some of the advantages of this service. With that said, this whole thread is about what can happen with untrusted third parties so...
- koolba 2y agoIt absolutely would work if the browser validates the SRI hash. The whole point is to know in advance what you expect to receive from the remote site and verify the actual bytes against the known hash. It wouldn’t work for some ancient browser that doesn’t do SRI checks. But it’s no worse for that user than without it.
- stusmall 2y agoTheir point is that the result changes depending on the request. It isn't a concern about the SRI hash not getting checked, it is that you can't realistically know the what you expect in advance.
- reubenmorais 2y agoThe CDN in this case is performing an additional function which is incompatible with SRI: it is dynamically rendering a custom JS script based on the requesting User Agent, so the website authors aren't able to compute and store a hash ahead of time.
- baxtr 2y agoImportant context given by the author of polyfill: > If your website uses http://polyfill.io http://polyfill.io, remove it IMMEDIATELY. I created the polyfill service project but I have never owned the domain name and I have had no influence over its sale. (1) Although I wonder how the GitHub account ownership was transferred. (1) https://x.com/triblondon/status/1761852117579427975 https://x.com/triblondon/status/1761852117579427975
- yesimahuman 2y agoDoes 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...
- rafram 2y agoSeems like it. I hope the money was worth it.
- teruakohatu 2y agoIt 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-users/2540 https://community.fastly.com/t/new-options-for-polyfill-io-u... But it leaves me with an uneasy feeling about Fastly.
- localfirst 2y agoliterally went from cloudflare to fastly and now this stuff happpens.... can't catch a break
- linclark 2y agoNeither of them had ownership of the project, so neither of them were responsible for the sale or benefited from it. They both simply dedicated a lot of time, care and skill to the project. It's really a shame to see what they spent so much time building and maintaining now being used as a platform to exploit people. I'm sure its extremely disappointing to both of them.
- mihaic 2y agoI 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.
- fkyoureadthedoc 2y agoyes you just put integrity="sha384-whatever" and you're good to go
- ok123456 2y agoCan't do that with this one because it generates the polyfill based on the user agent.
- fkyoureadthedoc 2y agoyeah that's nuts, I would never use a random site for that, but in general people's opinion on CDN use is dated. Tons of people still think that cached resources are shared between domains for example.
- tentacleuno 2y agoWhy not? The `integrity` attribute accepts more than one value[0]. This would technically be feasible, if my understanding of the service is correct. Hashes could be recorded for each combination of feature -- you could then give those list of hashes to the user to insert into the attribute. Of course, the main difficulty here would be the management of individual hashes. Hmm, definitely interesting stuff. [0]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity#using_subresource_integrity https://developer.mozilla.org/en-US/docs/Web/Security/Subres...
- delfinom 2y ago
- program_whiz 2y agoGame 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 up for life, not sure what to say when this kind of thing happens other than "isn't that the only possible outcome given the system and incentives on a long enough timeline?" Kind of like the "why is my favorite company monetizing now and using dark patterns?" Well, on an infinite timeline did you think service would remain high quality, free, well supported, and run by tireless, unselfish, unambitious benevolent dictators for the rest of your life? Or was it a foregone question that was only a matter of "when" not "if"?
- program_whiz 2y agoin a strange way, this almost makes the behavior of hopping onto every new framework rational. The older and less relevant the framework, the more the owner's starry-eyed enthusiasm wears off. The hope that bigcorp will pay $X million for the work starts to fade. The tedium of bug fixes and maintenance wears on, the game theory takes it's toll. The only rational choice for library users is to jump ship once the number of commits and hype starts to fall -- that's when the owner is most vulnerable to the vicissitudes of Moloch.
- chrisweekly 2y agoGood point. What's often (and sometimes fairly) derided as "chasing the new shiny" has a lot of other benefits too: increased exposure to new (and at least sometimes demonstrably better) ways of doing things; ~inevitable refactoring along the way (otherwise much more likely neglected); use of generally faster, leaner, less dependency-bloated packages; and an increased real-world userbase for innovators. FWIW, my perspective is based on building and maintaining web-related software since 1998.
- wadadadad 2y ago
- pimterry 2y ago> 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/ 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 service you control (just bunny/cloudflare/akamai/whatever is fine and cheap). In a tiny prototyping project, a public CDN is convenient to get started fast, sure, but if you're deploying major websites I would really strong recommend not using public CDNs, never ever ever ever (the World Economic Forum website is affected here, for example! Absolutely ridiculous).
- irrational 2y ago> 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.
- jweir 2y agoOwn your process – at best that CDN is spying on your users.
- marcosdumay 2y ago> and it just worked Just to add... that is unlike the CDN thing, that will send developers into Stack Overflow looking how to set-up CORS.
- toddmorey 2y agoFor performance reasons alone, you definitely want to host as much as possible on the same domain. 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.
- karaterobot 2y agoIt's amazing to me that anyone who tried to go to a website, then was redirected to an online sports betting site instead of the site they wanted to go to, would be like "hmm, better do some sports gambling instead, and hey this looks like just the website for me". This sort of thing must work on some percentage of people, but it's disappointing how much of a rube you'd have to be to fall for it.
- causal 2y agoIt plants a seed. Could be a significant trigger for gambling addicts.
- baobabKoodaa 2y agoI'm genuinely puzzled that a group with the ability to hijack 100k+ websites can think of nothing more lucrative to do than this.
- tracker1 2y agoEven with low rates, my first thought would probably be crypto mining via wasm. I'd never do it, but would have been less noticeable.
- EasyMark 2y agoYou’d think they’d contract with some hacker group or government and use it as a vector to inject something more nefarious if money was their goal
- TheMagicHorsey 2y ago[flagged]
- minitech 2y ago> 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.
- TheMagicHorsey 2y agoYeah, maybe, but for the last 20 years there really weren't enough incidents to make it an activity that was too risky to do outside of some really security sensitive applications.
- deleted 2y ago[deleted]
- jscheel 2y agoSo glad I removed polyfill as soon as all that nonsense went down a few months ago.
- no_wizard 2y agoI can’t believe the Financial Times didn’t secure the domain for the project. They backed it for a long time then dropped support of it. I wonder if the polyfills themselves are compromised, because you can build your poly fill bundles via npm packages that are published by JakeChampion
- apitman 2y agoSigstore is doing a lot of interesting work in the code supply chain space. I have my fingers crossed that they find a way to replace the current application code signing racket along the way.
- lifeisstillgood 2y agoSorry - I must have missed this - what’s the application code signing racket?
- apitman 2y agoShipping an app that runs on Windows without scary warnings required ~400USD/year code signing certificate, unless you release through the Microsoft Store.
- victor9000 2y agoI added a ublock rule on mobile to exclude this domain ||polyfill.io^ Any other practical steps that mobile users can take?
- flanbiscuit 2y agoThanks for this, I added it to everywhere I use uBlock Origin. In case anyone was wondering, here's more info: https://github.com/gorhill/uBlock/wiki/Strict-blocking https://github.com/gorhill/uBlock/wiki/Strict-blocking This only works at blocking full domains starting from uBO v0.9.3.0. Latest version is v1.58.1, so it's safe to assume most people are up to date. But noting it just in case. https://github.com/gorhill/uBlock/releases https://github.com/gorhill/uBlock/releases
- tracker1 2y agoJust added to my pihole.
- WarOnPrivacy 2y agoedit:DNS servers for Cloudflare, Quad9, Google and Level3 all cname cdn.polyfill.io to Cloudflare domains. I assume those are the alt endpoints that Cloudflare setup in Feb. Lots of folks seem to be protected now. Cloudflare notice: https://blog.cloudflare.com/polyfill-io-now-available-on-cdnjs-reduce-your-supply-chain-risk https://blog.cloudflare.com/polyfill-io-now-available-on-cdn... Feb discussion: https://github.com/formatjs/formatjs/issues/4363 https://github.com/formatjs/formatjs/issues/4363 (edit:withdrawn) For my use cases, I made the local DNS servers authoritative for polyfill.io. Every subdomain gets a Server Failed error. Might work for pihole too.
- jagged-chisel 2y agoMight as well block googie-anaiytics.com while you're at it
- b0ner_t0ner 2y agoI just set polyfill.io to Untrusted in NoScript.
- aembleton 2y ago
- bangaladore 2y agoIt seems like Cloudflare predicted this back in Feb. https://blog.cloudflare.com/polyfill-io-now-available-on-cdnjs-reduce-your-supply-chain-risk https://blog.cloudflare.com/polyfill-io-now-available-on-cdn...
- jjulius 2y agoCF links to the same discussion on GitHub that the OP does. Seems less like they predicted it, and more like they just thought that other folks concerns were valid and amplified the message.
- TonyTrapp 2y agoGotta love the code excerpt verifying the device type that checks for "Mac68K" and "MacPPC" strings. Your retro Macs are safe!
- lumb63 2y agoI’ll go ahead and make an assumption that the Chinese government was involved. Countries badly need to figure out a way to punish bad actors in cybersecurity realms. It seems that this type of attack, along with many others, are quickly ramping up. If there isn’t competent policy in this area, it could become very dangerous.
- aembleton 2y agoWhy would the Chinese government use this to load a gambling website? I'm sure there are many better uses that would be more subtle that they could come up with this opportunity.
- nneonneo 2y agoThe problem is that they have a CDN that can serve up custom JS depending on the headers and IP of the visitor, which enables remarkably precise targeting. No reason why they couldn’t, for example, send a targeted payload to people in a specific geographic area (by IP) and/or a specific language (by Accept-Language header). The sports betting stuff could be diversion in that case. Of course, I don’t personally believe this to be the case; Occam’s Razor says this is a straightforward case of someone deciding they want to start monetizing their acquisition.
- aembleton 2y ago> No reason why they couldn’t, for example, send a targeted payload to people in a specific geographic area (by IP) and/or a specific language (by Accept-Language header). The sports betting stuff could be diversion in that case. What I don't understand is why blow it sending people to a gambling site? They could have kept it going and sent payloads to specific targets making use of zero day browser bugs. Now they can still do that but to far fewer sites.
- szundi 2y agoIsn't there some hash in the script tag for these kinds of stuff? Maybe that should be mandatory or something? This broke half the internet anyway.
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- the8472 2y agostart projects with Content-Security-Policy: default-src 'self'; then add narrow, individually justified exceptions.
- paranoidrobot 2y agoThat wouldn't have helped here. Anyone adding CSPs would have had polyfill.io as permitted... which allowed this attack.
- the8472 2y agoThe justified in "justified exceptions" is important. Whenever I review CSP additions I ask the following questions - do we have a trust relationship with the vendor - is it strictly required - what are the alternatives - blast radius Adding script-src has a pretty high blast-radius. There is no relationship with an unpaid CDN. Alternatives can be vendoring a static polyfill script, or just fixing a few functions manually, depending on desired level of browser support. So it would not have passed. Adding an exception for 3rd-party images would have to clear a much lower bar for example but even there GDPR or information leakage could be a concern. CSP changes are just a great point to stop and think about how the frontend interacts with the rest of the world. If you just rubber-stamp everything then of course it wouldn't have any effect.
- baobabKoodaa 2y agoIs anyone taking the steps to inform affected site owners?
- jl6 2y agoSo who was the previous owner that sold us all out?
- Animats 2y agoWashington Post home page external content: app.launchdarkly.com cdn.brandmetrics.com chrt.fm clientstream.launchdarkly.com events.launchdarkly.com fastlane.rubiconproject.com fonts.gstatic.com g.3gl.net grid.bidswitch.net hbopenbid.pubmatic.com htlb.casalemedia.com ib.adnxs.com metrics.zeustechnology.com pixel.adsafeprotected.com podcast.washpostpodcasts.com podtrac.com redirect.washpostpodcasts.com rtb.openx.net scripts.webcontentassessor.com s.go-mpulse.net tlx.3lift.com wapo.zeustechnology.com www.google.com www.gstatic.com Fox News home page external content: 3p-geo.yahoo.com acdn.adnxs.com ads.pubmatic.com amp.akamaized.net api.foxweather.com bat.bing.com bidder.criteo.com c2shb.pubgw.yahoo.com cdn.segment.com cdn.taboola.com configs.knotch.com contributor.google.com dpm.demdex.net eb2.3lift.com eus.rubiconproject.com fastlane.rubiconproject.com foxnewsplayer-a.akamaihd.net frontdoor.knotch.it fundingchoicesmessages.google.com global.ketchcdn.com grid.bidswitch.net hbopenbid.pubmatic.com htlb.casalemedia.com ib.adnxs.com js.appboycdn.com js-sec.indexww.com link.h-cdn.com pagead2.googlesyndication.com perr.h-cdn.com pix.pub player.h-cdn.com prod.fennec.atp.fox prod.idgraph.dt.fox prod.pyxis.atp.fox rtb.openx.net secure-us.imrworldwide.com static.chartbeat.com static.criteo.net s.yimg.com sync.springserve.com tlx.3lift.com u.openx.net webcontentassessor.global.ssl.fastly.net www.foxbusiness.com www.googletagmanager.com www.knotch-cdn.com zagent20.h-cdn.com So there's your target list for attacking voters.
- akira2501 2y ago"No sir, we have absolutely no idea why anyone would ever use an ad blocker."
- DaoVeles 2y agoNo just for mental sanity but online safety.
- 38 2y agoExactly why I have a whitelist https://github.com/3052/blog/blob/main/2024-06/ublock-origin/rules.cfg https://github.com/3052/blog/blob/main/2024-06/ublock-origin...
- markus_zhang 2y agoMaybe this will lead to everyone building their own stuffs. A pretty good outcome for SWEs, isn't it?
- ChrisMarshallNY 2y agoI tend to avoid [other people's] dependencies like the plague. Not just for security, but also for performance and Quality. I think I have a grand total of two (2), in all my repos, and they are ones that I can reengineer, if I absolutely need to (and I have looked them over, and basically am OK with them, in their current contexts). But I use a lot of dependencies; it's just that I've written most of them. What has been annoying AF, is the inevitable sneer, when I mention that I like to avoid dependencies. They usually mumble something like "Yeah, but DRY...", or "That's a SOLVED problem!" etc. I don't usually hang around to hear it.
- cqqxo4zV46cp 2y agoIn most professional development contexts your puritan approach is simply unjustified. You’re obviously feeling very smug now, but that feeling is not justified. I note that you say “in all my repos”. What is the context in which these repositories exist? Are they your hobby projects and not of any real importance? Do you have literally anyone that can call you out for the wasted effort of reimplementing a web server in assembly because you don’t trust dependencies? I hope that you’re making your own artisanal silicon from sand you dug yourself from your family farm. Haven’t you heard about all those Intel / AMD backdoors? Sheesh. EDIT: you’re an iOS developer. Apples and oranges. Please don’t stand on top of the mountain of iOS’s fat standard library and act like it’s a design choice that you made.
- ChrisMarshallNY 2y ago> In most professional development contexts your puritan approach is simply unjustified. You’re obviously feeling very smug now, but that feeling is not justified. I note that you say “in all my repos”. What is the context in which these repositories exist? Are they your hobby projects and not of any real importance? Do you have literally anyone that can call you out for the wasted effort of reimplementing a web server in assembly because you don’t trust dependencies? I hope that you’re making your own artisanal silicon from sand you dug yourself from your family farm. Haven’t you heard about all those Intel / AMD backdoors? Sheesh. EDIT: you’re an iOS developer. Apples and oranges. Please don’t stand on top of the mountain of iOS’s fat standard library and act like it’s a design choice that you made. -- ahem, yeah... [EDIT] Actually, no. Unlike most Internet trolls, I don't get off on the misfortune of others. I -literally-, was not posting it to be smug. I was simply sharing my approach, which is hard work, but also one I do for a reason. In fact, most of the grief I get from folks, is smugness, and derision. A lot of that "Old man is caveman" stuff; just like what you wrote. I've been in a "professional development context" since 1986 or so, so there's a vanishingly small chance that I may actually be aware of the ins and outs of shipping software. I was simply mentioning my own personal approach -and I have done a lot of Web stuff, over the years-, along with a personal pet peeve, about how people tend to be quite smug to me, because of my approach. You have delivered an insult, where one was not needed. It was unkind, unsought, undeserved, and unnecessary. Always glad to be of service. BTW. It would take anyone, literally, 1 minute to find all my repos.
- diego_sandoval 2y agoThe phrase "supply chain attack" makes it sound like it's some big, hard to avoid problem. But almost always, it's just developer negligence: 1. Developer allows some organization to inject arbitrary code in the developer's system 2. Organization injects malicious code 3. Developer acts all surprised and calls it an "attack" Maybe don't trust 3rd parties so much? There's technical means to avoid it. Calling this situation a supply chain attack is like saying you were victim of a "ethanol consumption attack" when you get drunk from drinking too many beers.
- ldoughty 2y agoIn this case, the developer sold the user account & repository for money (no ownership change to monitor).. so if you were not privy to that transaction, you really couldn't "easily" avoid this without e.g. forking every repo you depend on and bringing it in house or some other likely painful defense mechanism to implement
- skydhash 2y agoThat’s why businesses pay Redhat, Qt, Unity,… Clear contracts that reduces the risk of compromised dependencies. Or you vet your dependencies (it helps when you don’t have a lot)
- cqqxo4zV46cp 2y agoWhat good does this comment do beside allow you to gloat and put others down? Like, Christ. Are you telling me that you’d ever speak this way to someone in person? I have no doubt that every single person in this thread understands what a supply chain attack is. You are arguing over semantics in an incredibly naive way. Trust relationships exist both in business and in society generally. It’s worth calling out attacks against trust relationships as what they are: attacks.
- diego_sandoval 2y agoAll other things being equal, a computer system that doesn't depend on trusting some external entity is better than one that does. Sometimes, trusting is inevitable (e.g. SSL certificate authorities), but in this case, it was very much a choice on part of the developers.
- leeeeeepw 2y agoName and shame the sports betting site
- orthecreedence 2y agoName and shame people who put unwarranted trust in third parties to save 2ms on their requests.
- EGreg 2y agoSadly this is how the Web works. We need a much more decentralized alternative, that lets static files be served based on content hashes. For now browser extensions are the only way. It’s sad but the Web doesn’t protect clients from servers. Only servers from clients.
- cqqxo4zV46cp 2y agoBefore getting on your soapbox about the decentralised web, please look at what Polyfill actually did. I’m not sure what you’re actually suggesting, but the closest remotely viable thing (subresource integrity) already exists. It simply wouldn’t work in Polyfill’s case because Polyfill dynamically selected the ‘right’ code to send based on user agent. As usual this problem has nothing to do with centralisation v decentralisation. Are you suggesting that people vet the third parties used by the sites visit? How does that sound practical for anyone other than ideological nerds?
- EGreg 2y agoYou seem to have a lot of hate for decentralized solutions. Even ones as simple as browsers providing an alternative to DNS and serving static files. You don’t seem to care about protecting the user. In a secure environment for the user why the f should the only option be to trust a server to choose which file to send based on the user-agent-reported ID? The user-agent knows its own ID and can request the static file of its choice from the network. Vetted static Javascript running in the static website can do that. You are so whipped by the Web’s inversion of power, that you can’t even seriously consider that alternative when writing your post. You say it’s too hard for every person to vet static JS bundles and verify that they have no instructions to phone home or otherwise mess with you. Well, that’s why there are third party auditing companies, they can just sign and publicly post approvals of specific bundle hashes, that your browser can then check and make sure at least 2 reputable audits approved that version. Just like it does for chains of certificates when loading a site. In fact, you are currently sleepwalkinf into learned helplessness by AI models hosted by others, the same way. At least the HN crowd drew the line at Web Environment Integrity by Google. It’s like you are an enthusiastic defender of mild slavery but oppose beating and killing the slaves.
- edm0nd 2y agoThey are denying everything on their Twitter @Polyfill_Global lol https://x.com/Polyfill_Global https://x.com/Polyfill_Global
- nneonneo 2y agoAnd on GitHub issues: https://github.com/polyfillpolyfill/polyfill-service/issues/2890#issuecomment-2191461961 https://github.com/polyfillpolyfill/polyfill-service/issues/...
- tamimio 2y agoI rarely use a CDN for that reason; I prefer to have the libraries hosted with the site.
- shuuji3 2y agoThis has been expected since 4 months ago. I wish the past posts (https://news.ycombinator.com/item?id=39517757 https://news.ycombinator.com/item?id=39517757, https://news.ycombinator.com/item?id=39523523 https://news.ycombinator.com/item?id=39523523) got more traction and people implemented mitigations on a larger scale before exploitation started.
- Kirr 2y agoMathJax [1] still recommends this way of using it: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> 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 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).
- simonw 2y agoI just filed a PR to remove that: https://github.com/mathjax/MathJax-website/pull/102 https://github.com/mathjax/MathJax-website/pull/102
- deleted 2y ago[deleted]
- jjude 2y agoIn times of widespread attacks, it would be better to list out actions that affected parties can take. Here is what I found: - remove it fully (as per original author). It is no more needed - use alternate cdns (from fastly or cloudflare) Also as a good practice, use SRI (though it wouldn’t have helped in this attack) I posted a note here: https://cpn.jjude.com/@jjude/statuses/01J195H28FZWJTN7EKT9JWZZNR https://cpn.jjude.com/@jjude/statuses/01J195H28FZWJTN7EKT9JW... Please add any actions that devs and non-devs can take to mitigate this attack.
- southEastRon 2y agoThis was obviously written by a JS beginner (ex: basic mistake on the "missing" function, the author thinks that `this` refers to the function?, same about the `undefined` implicit global assignment..)
- insane_dreamer 2y ago> However, in February this year, a Chinese company bought the domain and the Github account. Github accounts of open source software are now for sale?
- esroyo 2y agoI don't understand that either. The original repo was owned by the Finantial-Times account [0]. For sure that account has not been sold. I would love to hear how the deal was made to include the repository transfer. It is really surprising. [0] https://web.archive.org/web/20230524161733/https://github.com/Financial-Times/polyfill-service https://web.archive.org/web/20230524161733/https://github.co...
- BandButcher 2y agosadly everyone has a price, its pretty much tech real estate many js devs have used that on their resumes/portfolio - "I own a 10-line library downloaded over 1 billion times!" ^^ pretty easy target to poach github accounts for mass malware spreading.
- deleted 2y ago[deleted]
- sneak 2y agoClientside mitigation: install noscript. https://addons.mozilla.org/en-US/firefox/addon/noscript/ https://addons.mozilla.org/en-US/firefox/addon/noscript/ You can’t expect to remain secure on the modern web while running arbitrary javascript from anyone and everyone.
- globalise83 2y agoNice: to be secure on the web, you just need to install an add-on which needs to: Access browser tabs Store unlimited amount of client-side data Access browser activity during navigation Access your data for all websites
- zuminator 2y agoUnless you design your own silicon, build your own pc and peripherals, and write all your own software, there's always going to be a level of trust involved. But at least NoScript is FOSS so you can in theory examine the source code yourself. https://github.com/hackademix https://github.com/hackademix
- globalise83 2y agoSo is polyfill https://github.com/polyfillpolyfill/polyfill-service https://github.com/polyfillpolyfill/polyfill-service
- bee_rider 2y agoI think there’s a toggle to just disable JavaScript entirely somewhere in the menus, but it is sort of inconvenient, because you can’t selectively enable sites that are too poorly coded to run without JavaScript. Mozilla has marked NoScript as a recommended extension, which is supposed to mean they reviewed the code. Did they do it perfectly? I don’t know. But the same logic could be applied to the patches they receive for their browser itself, right? It’s all just code that we trust them to audit correctly.
- Jakob 2y agoYes that is unfortunate. Safari had the option to toggle JavaScript via Shortcut until recently, but it was removed. The only browser I know which can easily toggle JavaScript now is Brave. But uBlock Origin has that functionality, too, and I guess most people who would care about JavaScript have that already enabled anyways. The web is so much nicer without JavaScript but easily activating it (via cmd-J) once it seems necessary without reloading.
- commandlinefan 2y agoOne of these days we're going to learn our lesson and just write our own damned code.
- CPLX 2y agoBet we won’t.
- hyperhopper 2y agoThen you get to write 10x the vulnerabilities yourself and not have nearly the same chance of any of them getting disclosed to you!
- ChrisMarshallNY 2y agoThat argument doesn't seem to be aging well. I'd say that good [emphasis on "good"] coders can write very secure code. There's fundamental stuff, like encryption algos, that should be sourced from common (well-known and trusted) sources, but when we load in 100K of JS, so we can animate a disclosure triangle, I think it might not be a bad time to consider learning to do that, ourselves.
- vikramkr 2y agoIt's impossible to tell how that argument is aging since we don't have the counterfactual.
- sandwitches 2y agoSo if you can't trust your developers to manage dependencies, and you can't trust them to write dependencies... why have you hired them at all? Seriously, what do they actually do? Hire people who can program, it isn't hard.
- kelsey98765431 2y agoOne has to admit the game of cat and mouse that the web browser brought about has been quite valuable for advancing security as a field, unfortunately this sort of thing seems like we have to get burned to learn the pan is hot and mother warning us is not enough. Pay your security teams more, people.
- helsinkiandrew 2y ago> "If you own a website, loading a script implies an incredible relationship of trust with that third party," he Xeeted at the time. Are people actually calling Tweets "Xeets" now?
- rob74 2y agoI propose "X-crete" as the new verb and "X-cretion" for the final product.
- BlueTemplar 2y agoI was thinking about "Xitting out", but yours is better.
- localfirst 2y agoXeet in the hip hop industry means something completely different.
- thereddaikon 2y agoHow would you even pronounce it?
- pmx 2y agoMaybe like "Zeet" or probably just don't bother because it's stupid
- chefandy 2y agoI think JS (well, ES6) has a ton of positive qualities, and I think it's a great fit for many of its current applications. However, this is a pretty good example of what bothers me about the way many people use it. I see a lot of folks, in the name of pragmatism, adopt a ton of existing libraries and services so they don't have to think about more complex parts of the problem they're solving. Great! No need to reinvent the wheel. But, people also seem to falsely equate popularity with stability-- if there's a ton of people using it, SURELY someone has vetted it, and is keeping a close eye on it, no? Well, maybe no? It just seems that the bar for what people consider 'infrastructure' is simply too low. While I don't think that, alone, is SO different from other popular interpreted languages, the light weight of JS environments means you need to incorporate a LOT of that stuff to get functionality that might otherwise be part of a standard library or ubiquitous stalwart framework, which dramatically increases the exposure to events like this. I think a lot of people conflate criticism of JS with criticism of the way it's been used for the past number of years, putting a nuanced topic into a black-and-white "for or against" sort of discussion. I've done a number of projects heavily using JS-- vanilla, with modern frameworks, server-side and in the browser-- and aside from some fundamental annoyances with it's approach to a few things, it's been a great tool. There's nothing fundamental about JS itself that makes applications vulnerable to this like a buffer overflow would, but the way it is used right now seems to make it a lot easier for inexperienced, under-resourced, or even just distracted developers to open up big holes using generally accepted techniques. But I've never been a full-time front-end-web or node dev, so maybe I'm mistaken? Compared to the server-side stuff I've worked with, there's definitely a concerning wild west vibe moving into modern JS environments. I think there was a casual "well, it's all in client-side userspace" attitude about the way it was used before which effectively shifted most of the security concerns to the browser. We should probably push a little harder to shake that. Think about how much JS your bank uses in their website? I'll bet they didn't write all of their own interaction libraries.
- sandwitches 2y agoThis is the end-stage of having third-party packaging systems without maintainers. This happens vanishingly infrequently for things like apt repositories, because the people maintaining packages are not necessarily the people writing them, and there's a bit of a barrier to entry. Who knew yanking random code from random domains and executing it was a bad idea? Oh yeah, everyone.
- localfirst 2y agoThe fact two Fastly employees are involved does immense damage for its brand. Had it not been for the greed of Fastly's employee, this whole thing could've been avoided.
- ChrisMarshallNY 2y ago> Had it not been for the greed of Fastly's employee I don't think he had anything to do with the sale.
- tslocum 2y agoWhen you are selling an open source project, what outcome do you expect? People who are interested in the project non-financially will demonstrate their value in other ways (PRs, reviews, docs, etc) leading to the more common succession of maintainers without exchanging money. I don't think it's reasonable for software authors, who take the route of giving their projects to buyers rather than top contributors, to act surprised when the consequences roll in.
- upofadown 2y agoI really wish we didn't have to trust the websites we go to. This exploit is a good example of the problem. I go to a website and something in the content of the website forces you to go to an entirely different place. I didn't click on a link, it can just do this based on any criteria it wants to apply.
- zX41ZdbW 2y agoI checked, and here are the top domains that are still using Polyfill.io as of today: https://pastila.nl/?00008b47/8a0d821be418cdd5003a2d620d765895 https://pastila.nl/?00008b47/8a0d821be418cdd5003a2d620d76589... However, theguardian.com is using it from its own domain, which is safe. But most of the other 5000 websites don't.
- havefunbesafe 2y agoMany .gov websites seen on this list.
- zX41ZdbW 2y agoThe number of websites is decreasing, which is good: clickhouse-cloud :) SELECT date, count() FROM minicrawl_processed WHERE arrayExists(x -> x LIKE '%polyfill.io%', external_scripts_domains) AND date >= now() - INTERVAL 5 DAY GROUP BY date ORDER BY date ┌───────date─┬─count()─┐ 1. │ 2024-06-22 │ 6401 │ 2. │ 2024-06-23 │ 6398 │ 3. │ 2024-06-24 │ 6381 │ 4. │ 2024-06-25 │ 6325 │ 5. │ 2024-06-26 │ 5426 │ └────────────┴─────────┘ 5 rows in set. Elapsed: 0.204 sec. Processed 15.70 million rows, 584.74 MB (76.87 million rows/s., 2.86 GB/s.) Peak memory usage: 70.38 MiB. PS. If you want to know about this dataset, check https://github.com/ClickHouse/ClickHouse/issues/18842 https://github.com/ClickHouse/ClickHouse/issues/18842
- delegate 2y agoI don't think most people understand that although '100k+ sites are infected', the actual malware code runs on the visitors (our) machines, the servers themselves are fine ! I read the news yesterday and was 'yeah, that's too bad', but only later did it dawn on me that I'm the one that's potentially going to have to deal with the consequences. This needs to be mitigated client side, not rely on the good will of the administrators.
- creatonez 2y agouBlock Origin had filters available within only a few hours of the discovery. And most browsers already have a builtin domain blacklist via's google safe browsing list, but it's mostly for phishing pages rather than covering every single possibility.
- peanut_worm 2y agoI don’t understand why JS devs treat dependencies the way they do. If you are writing scripts that run on other people’s computers I feel like the dependencies used should be vetted for security constantly, and should be used minimally. Meanwhile most libraries seem to have 80 trillion dependencies written by random github accounts called “xihonghua” or something with no other projects on their account.
- Hightleyez 2y agoCombine that with electron and auto update everything I've seen dev include scripts from templates when the app was for banks internal users and intranet only. They are clueless
- Klonoar 2y agoThere’s a wide, wide range of devs that fit in the label of “JS dev”. At the more junior or casual end, npm and cdns are shoved in your face as the way to go. It shouldn’t be surprising that it’s the natural state of things. I’ve worked with many JS devs who also have broader experience and are more than aware of issues like these, so it just depends I guess. The bigger issue may just be the lack of a culture that vendors their code locally and always relies on the 3rd party infrastructure (npm or cdn). It’s somewhat similar but any Rust project I’m building, I wind up vendoring the crates I pull in locally and reviewing them. I thought it would be more annoying but it’s really not that bad in the grand scheme of things - and there should be some automated things you could set up to catch obvious issues, though I defer to someone with more knowledge to chime in here. This may be an extra level of headache with the JS ecosystem due to the sheer layers involved.
- ricardobayes 2y agoBecause that is how the tutorials on "web development" teach it. Just use this thing and don't ask what it is.
- nullc 2y agoand Meanwhile Meanwhile, years after it was well known that the JS dependency model was an utter security disaster the rust ecosystem went on to copy it.
- hollowturtle 2y agoDon't forget that the author of core-js, a library not a service like polyfill but with almost the same goal, is tired of open source as well https://github.com/zloirock/core-js/blob/master/docs/2023-02-14-so-whats-next.md https://github.com/zloirock/core-js/blob/master/docs/2023-02...
- dec0dedab0de 2y agoI am always shocked at the amount of sites that still use remotely hosted dependencies. Sure, in a true supply chain attack, you wouldn’t be able to trust npm or github or whatever, but atleast you wouldn’t be compromised immediately. And even outside of security concerns, why would you ever allow someone else to deploy code to your site without testing it first?
- Bluestein 2y ago> Sansec security forensics team, which on Tuesday claimed Funnull, a Chinese CDN operator that bought the polyfill.io domain and its associated GitHub account in February, has since been using the service in a supply chain attack. Quite the CDN, eh? :/
- fweimer 2y agoIs this save once more because it moved back to Cloudflare? ;; QUESTION SECTION: ;cdn.polyfill.io. IN A ;; ANSWER SECTION: cdn.polyfill.io. 553 IN CNAME cdn.polyfill.io.cdn.cloudflare.net. cdn.polyfill.io.cdn.cloudflare.net. 253 IN A 172.67.209.56 cdn.polyfill.io.cdn.cloudflare.net. 253 IN A 104.21.23.55 Or is Cloudflare warning about this and hosting the attack site?
- samuelb 2y agoIt is still not safe. The new owner is using Cloudflare as a CDN to appear more legitimate, but the responses are still fully controlled by the malicious backend. This has been the case since the end of February.
- mnholt 2y agoIs there an easy way to go about scanning my domains to see if I'm impacted?
- aragonite 2y agoIs there any evidence that whoever is currently behind polyfill.io is a "Chinese company," as most reports claim? The company known as "Funnull" appears to be based in the Philippines. The phone number associated with their WhatsApp and WeChat accounts has country code +63. Also they appear to be based at 30th Street, 14th Floor, Net Cube Center, E-Square Zone, Metro Manila, Taguig, Philippines at least if the information on this page [1], purportedly from the founder of the company that was acquired and renamed Funnull, is to be trusted (Click "View Source," then run it through Google Translate) Claude translation: === > Announcement > I am the former owner of the original Philippine company Anjie CDN. After my incident, the company was managed by my family. Due to their isolation and lack of support, they were persuaded by unscrupulous individuals to sell the company. Subsequently, the company was acquired and renamed as Fangneng CDN, which later developed into the ACB Group. > This is precisely what I need to clarify: Fangneng CDN company and the ACB Group have no connection with me or my family. Recently, many companies have contacted my family and threatened them, believing that Fangneng CDN company has stolen important information such as member data and financial transactions through client domain names using infiltration and mirroring techniques, and has stolen customer programs through server rental services. This matter is unrelated to me and my family. Please contact Fangneng CDN company to resolve these issues. > I reiterate: As my family has long since closed Anjie CDN company, any events that occurred afterwards are unrelated to me and my family! > Note: Due to my personal issues, this statement is being released on my behalf by my family. > Fangneng CDN's actual office location: 30th Street 14TH Floor, Net Cube Center, E-Square Zone, Metro Manila, Taguig, Philippines. > Due to the release of this statement, the Anjie domain name has been reactivated by Fangneng CDN company. Currently, Anjie and Fangneng are one company, so I once again declare that any conflicts and disputes arising from Anjie CDN and Fangneng CDN companies are not related to me or my family in any way! > First publication date of the announcement: May 18, 2022 > Announcement update date: May 18, 2024 [1] Original URL: https://cc.bingj.com/cache.aspx?q=%E5%AE%89%E6%8D%B7%E8%BF%99%E4%B8%AA%E5%9F%9F%E5%90%8D%E5%8F%88%E8%A2%AB%E6%96%B9%E8%83%BDCDN%E5%85%AC%E5%8F%B8%E9%87%8D%E6%96%B0%E5%90%AF%E7%94%A8%E4%BA%86%EF%BC%8C%E7%9B%AE%E5%89%8D%E5%AE%89%E6%8D%B7%E5%92%8C%E6%96%B9&d=4740742375488099&mkt=en-US&setlang=en-US&w=lKddz7bfpnFr1zQAXb6Yer75P03Dswbo https://cc.bingj.com/cache.aspx?q=%E5%AE%89%E6%8D%B7%E8%BF%9... Archive.today version: https://archive.is/uDNoV https://archive.is/uDNoV
- ricardobayes 2y agoIf you don't use version pinning, you are rolling the dice every single build.
- deleted 2y ago[deleted]
- loisralph44 2y ago[dead]
- wrongsahil 2y agoSince this is effecting end users of websites directly. So instead of waiting for developer to fix it, this could help you stay protected until then https://medium.com/@wrongsahil/protecting-yourself-from-polyfill-io-malware-as-a-user-7be300ff8b94 https://medium.com/@wrongsahil/protecting-yourself-from-poly...