Tell HN: Cloudflare silently injects its analytics when you switch nameservers
663 pointsA few hours ago I switched my nameservers to Cloudflare in order to enable R2 bucket serving through my own subdomain, and I found out that it silently had injected a JS analytics snippet in my HTML-only JS-free site textlog.cc — I had to go to the Analytics dashboard, Add the site to the analytics and then disable the snippet. I find this approach entirely invasive, you should opt-in to features like that not have to opt-out. Just a warning out there to folks who might not be aware of this.
Comments (202) 49 threads
Earlier commentsYes, when you proxy anything through Cloudflare (CF) you give up on having your contents encrypted as CF terminates the TLS endpoints, but going from this to changing the content of the served site and injecting JavaScript is quite a big step and likely not what a lot of people would want nor expect. Your JavaScript-free site becomes a site that ships JavaScript without you knowing or having done anything.
Additionally, this introduces additional tracking of users, which a lot of people don't want.
And finally, there's the slippery slope. Today it's RUM, tomorrow it's ads or something else? Once CF starts modifying the user's content, what's stopping them from doing it more and more?
For now, a pure JavaScript free site and a JavaScript-free-except-a-bit-of-analytics does not make meaningful difference to visitors of the site. The benefits of proxying are more important.
One day the delivery service starts adding free sausages to every delivery on an opt-out basis.
By the time you realize, they'll already have delivered adulterated meals. You won't have a lot of customers left!
People are often vegetarian for ethical reasons. In a similar way, many people have Ethical Opinions (tm) about Analytics as well. They don't like it when other people collect private information about themselves, and refuse to Do Unto Others.
But even if you're fine with analytics in general: When intermediaries and other transitive dependencies (like software libraries) start injecting analytics on an opt-out basis, you simply can't control what's going on. And that's before we talk about the ethics and legality of third parties modifying content in-flight.
In the EU, the law actually codifies the ethics at play here (GDPR). Several people point out that cloudflare disables this 'feature' for the EU. This makes a lot of sense, because it would have been a huge mess for everyone impacted to have to go to their customers with a "sorry, we leaked your PII, here's how we'll make you whole"; as well as possibly lawsuits against cloudflare to recover those damages upstream.
Here you told them to unpack the food and repack it (TLS termination), filtering order (WAF), reheating pre-made food (cache) and they offer service to even prepare food or part of the food (edge compute). When your food is not available they will serve their own (error pages), with their brand visible. At that level of service, it's not so surprising to have extra stuff included.
If you are vegan and care about your customers (conservative on data collection and JS), maybe you should use a vegan architecture and not give your last-mile to the cheapest (free-tier) all-purpose repacking kitchen and delivery service.
Right, that's the lesson being learned here today.
To be fair, up 'till now, afaik these services actually have been trustworthy on this count, so this is a new low.
Just because people extend you a lot of trust to do A,B, and C doesn't mean you can't lose it if you randomly start doing D instead.
I don't think we can run a viable (high trust) western economy if we constantly have to beware of our own providers. Principle of least surprise applies.
Presumably these include any measures which would counter their operating model of tracking users on the web, under the excuse of stopping bots.
They are only "enabling Web Analytics by default" "by providing a powerful, in-depth monitoring solution that helps you debug and optimize applications" when users do not come from the EU
Cloudflare is doing a great job most of the time, but I feel like this feature was speed run through approvals and could use more discussions
In the meantime, also implement "bot protection" and get everyone on the internet to outsource the decision on who can access their website. With no appeal.
I'm increasingly worried about Cloudflare.
All comments shown.
Couldn't load more comments. Check your connection and try again.