← Back to context

Comment by goalieca

11 days ago

It also makes adding csp a nightmare. Your marketing department is putting in 30 trackers, changing monthly. And then there’s different countries for end clients with different TLDs for connect-src. You can’t possibly get anything locked down enough. That’s bad for security when you rely on csp for mitigating other factors.

> And then there’s different countries for end clients with different TLDs for connect-src.

Oh how I hate that one. I wish Facebook, Instagram, Google and others would figure out serving the public scripts from .com only.

  • I'm sure they know how to serve from a single domain - but it is in their interest if you are forced to give them the nonce pass. So yeah, it's (again) all about incentives.

    • I don't think that's the case. Csp doesn't restrict them from doing what they want with tracking tech.

relying on any client-side "security" is probably a bad idea

  • CSP is there to protect your user’s browser, not your servers. It’s ultimately their credentials that are going to get compromised with an XSS attack.

    • All things considered I think CSP is a good thing, a bit of a nuance for website operators, but it probably helps protect against lot of attack types.

  • Client side security isn't the issue, but CSP is kind of a shit show. The configuration apparatus is godawful. I think the best way to think of it is if someone turned CSS (yes, the styling language) into a security configuration protocol. It uses the same style of cascading overrides that CSS employs.

  • What is the alternative when you need to embed third-party JavaScript on your pages? Other than just "not doing that"?

    • If it's available, pull the third party JS in at build time via package manager rather than at runtime via a CDN you don't control.

      NPM isn't perfect but there's typically a substantial delay between the release of a malicious package and that code getting onto your production environment. Unless you're automatically updating every day, there's a good chance someone will discover the problem before it affects you. And you can always scan your upstream dependencies.

      This doesn't work if you're using someone else's CDN. Any change to their content is distributed to all your users immediately.

    • Vet everything, cut down to 2-3 services tops. Selfhost analytics whenever possible. Point to the OP article when asked why we can’t blindly put 30 tags using GTM.

      7 replies →

    • A certificate-based approach for scripts residing on different domains, for example, so you can be sure it hasn't been tampered with.

      A javascript file served from example-a.com should be able to run on example-b.org only if it has been signed with the same TLS key used for example-a.com .

      5 replies →

  • Most of it is server to server now with server side tagging. 3rd party cookies are now 1st party and beacon call is server to server.

I mean, really that situation is CSP finally earning its keep. Put whatever you want in tag manager but at the end of the day it's not going to work unless I review it.