\

Tell HN: Cloudflare silently injects its analytics when you switch nameservers

94 points - today at 5:49 PM


A 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.

  • purpleidea

    today at 7:14 PM

    Yikes! I see this too:

    <script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/v4513226..." integrity="sha512-ZE9pZaUXND66v380QUtch/5sE9tPFh2zg45pR2PB0CVkCtOREv2AJKkSidISWkysEuQ0EH8faUU5du78bx87UQ==" data-cf-beacon='{"version":"2024.11.0","token":"c0859b51a7804ab5a9cc8e9e2b2c4cde","r":1}' crossorigin="anonymous"></script>

    • celsoazevedo

      today at 7:12 PM

      Yes, they add the js if "web analytics" is enabled. I believe I had to manually enable it on my old sites though. Maybe it's enabled by default when adding new domains?

      • ValentineC

        today at 7:25 PM

        Took me a minute to realise this isn't 1.1.1.1 (which Cloudflare also runs), but their original website DNS hosting service.

        • minraws

          today at 7:39 PM

          Is there an opt-out mechanism at least? CF is burning goodwill in months it built over the last decade.

          • BorisMelnik

            today at 7:34 PM

            yep, last website I did was JS free 100% except that pesky cloudflare script

            • windexh8er

              today at 7:06 PM

              Isn't this well known when using CF as a proxy? Not sure how they would provide traffic / DDoS telemetry otherwise.

                • JoshTriplett

                  today at 7:35 PM

                  They're serving the HTML, they have every ability to track individual web requests without modifying the content they're serving.

                    • sscaryterry

                      today at 7:41 PM

                      100% But this does not give you any useful personal data :)

                        • JoshTriplett

                          today at 7:43 PM

                          Or data for the increasingly invasive Cloudflare captcha.

              • pudgywalsh

                today at 7:32 PM

                You left out the part about how you use them as a reverse proxy, which is decoupled from DNS. One is coincidental; the other required.

                If they can inject script, they can also snoop on all your cleartext traffic without you knowing....

                  • stagas

                    today at 7:57 PM

                    Oh gosh I didnโ€™t enable anything like that also. I just wanted the nameservers in order to serve the bucket under my subdomain. What else is there I wonder?

                    • johntash

                      today at 7:39 PM

                      Indeed. I have several domains using cf for dns only and they don't/can't inject anything into those sites.

                  • csomar

                    today at 7:03 PM

                    To add to your experience: It was also very hard, for me, to find the setting that disables this JavaScript.

                    • today at 7:45 PM

                      • moktonar

                        today at 7:20 PM

                        Surprise! The man in the middle man-in-the-middles! This is only the beginning, when youโ€™ll get used to this theyโ€™ll do worse and worse, enshittification, remember?

                          • _def

                            today at 7:35 PM

                            If I wouldn't know it better I'd sometimes think some of the big tech shops are just fronts for centralizing the net.

                              • LoganDark

                                today at 7:54 PM

                                Cloudflare is doing this already. Once they had enough monopoly power, they started a program to block all bots that don't undergo invasive KYC procedures. Eventually, they might become a KYC broker for regular browser users too. The free internet is over.

                                  • sssilver

                                    today at 7:57 PM

                                    #savetheinternet

                        • today at 7:19 PM