-
Notifications
You must be signed in to change notification settings - Fork 84
Description
Dear W3C,
As we dive into deep technical conversations on missing features and support of evolving needs in CSP3 I would like to take a step back.
CSP is a challenging thing to implement, and mostly, maintain.
By design, CSP is an allow list. Anything that does not meet that allowed behaviour is either reported upon or stopped. This works for static or self managed assets. However, most 3rd party scripts will change without notice. This is a normal and intended behaviour for client-side scripts.
Today client-side scripts are used for dynamic conditional use cases. A/B testing, but also serving different script versions based on user agents, time of day, location… A chatbot widget may add more assets or tooling.
Depending on the policy these changes would not be allowed and this breaks features or user flows.
As a result, people do not want to use CSP. The complexity of writing a good CSP is definitely part of the problem but the bigger issue is that once a CSP is set to blocking, a week later something would change and in a quick response CSP would be thrown out again because it broke parts of the site and cost the business money. The result: CSP gets a bad name, it gets kicked out. CSP? Never again.
There is more to say here: in many companies the development environment does not have CSP setup (at all or in the same way) as the production environment. So when things get pushed to production the CSP kicks in unexpectedly.
Now this is the problem: in an organization of decent size, the companies that are a prime target for client-side attacks, the people that vouch for client-side security are more often than not people within the security or GRC team.
They have a hard time getting engineering resources, they have a hard time moving quickly and in many companies culturally struggle to get the broader engineering team to allow them to do things. Culturally, they are often not seen as core revenue driving roles instead they are there to cover the business. Those people have to pick their fights. There are rarely second chances…
CSP is a leading cause of emergency production releases. Does a specification work if it causes emergency production releases routinely?
The fact that CSP is a hard coded HTTP header makes it a hard to adopt security feature.
CSP, because of the fact that it needs to be adjusted quickly needs to be easier to adjust.
Today, full web proxies are at a major unfair advantage as they have the ability to change headers at the proxy. While proxies are often compensating for imperfections in specifications, we should strive to improve specifications so that a full proxy is not necessary.
A discussion we need to have: we are doing a good job at discussing CSP directives. Adding directives with dynamicness in mind. But let’s go a level deeper, should CSP be hard coded or can it be a call to an external endpoint or a file? Allowing dynamic management, allowing faster adjustments.
I know about implementing via meta tags, but that is not really what we want here…
There is of course the latency concern, but there are aways to make this work. I'd love to start the thread on how we can make CSP a lot more usable in real world circumstances.
Would love to hear your thoughts.
Simon - CEO cside.dev