What are Content Security Policies?
Content security policies are a modern security feature, which tell the browser which domains are allowed to operate on your website, and what permissions they're allowed.
They are specified either on the Response Headers (most common) for the document, or by using the Meta Tag. e.g.:
HTTP Header example:
Content-Security-Policy: default-src 'self'; img-src https://*; child-src 'none';
Meta Tag example:
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; img-src https://*; child-src 'none';" />
Adding Webtrends Optimize to your Content Security Policies
Use of '*' and default
Many websites opt to use "*" and default as an option for some rules, in which case you may not need to specify our domain explicitly. For example, default-src is an acceptable fallback for listing all of script-src, connect-src, style-src and img-src.
Webtrends Optimize has 2 domains from which we operate, depending on what you're doing with us. These are:
*.webtrends-optimize.com- for core services*.webtrends-optimize.workers.dev- for custom libraries, geolocation services, social proofing, recommendations engines etc. Note that we create services in cloudflare on request, and as such subdomains used for those services are not deterministic.
Note: The permissions listed below are the strictest set of required permissions. If you prefer to use looser-rules such as "all", wildcard domains and default-src, the domains are listed above. We will not provide guidance in this document for weaker setups.
Permissions listing
If you don't want to use wildcards for domains, consider the following CSP rules:
For core services
script-src 'unsafe-eval' 'unsafe-inline' c.webtrends-optimize.com;
connect-src pat.webtrends-optimize.com collect.webtrends-optimize.com;
style-src 'unsafe-inline' c.webtrends-optimize.com;
img-src c.webtrends-optimize.com;
(only if you use Surveys)
frame-src https://c.webtrends-optimize.com/acs/accounts/d25dc2a4-010d-4fd1-a1ad-41e81138c16d/manager/;
Note: This does not include support for Geolocation lookup services, Social Proofing, Recommendations and other custom services we may build for you - see below in that instance.
For all services
script-src 'unsafe-eval' 'unsafe-inline' c.webtrends-optimize.com *.webtrends-optimize.workers.dev;
connect-src pat.webtrends-optimize.com collect.webtrends-optimize.com *.webtrends-optimize.workers.dev;
style-src 'unsafe-inline' c.webtrends-optimize.com *.webtrends-optimize.workers.dev;
img-src c.webtrends-optimize.com *.webtrends-optimize.workers.dev;
(only if you use Surveys and/or hosted iframes)
frame-src https://c.webtrends-optimize.com/acs/accounts/d25dc2a4-010d-4fd1-a1ad-41e81138c16d/manager/ https://c.webtrends-optimize.com/acs/accounts/[your account id]/manager/;
As above, note that custom services on workers.dev are built on request, and as such are not deterministic in their subdomains/paths.
What are each of these domains?
c.webtrends-optimize.com - our CDN, used for all scripts, imagery, etc.
pat.webtrends-optimize.com - our newer test decision engine.
collect.webtrends-optimize.com - our newer data collection service.
ots.webtrends-optimize.com - our legacy test decision and data collection engine. Has been removed from the above policies on 2026-11-20.
*.webtrends-optimize.workers.dev - where we keep any custom services we build for you, such as product feed lookups, social proofing, recommendations engines, etc.
The need for keywords
There are a few CSP keywords that we need to include. The reasons for them are found below.
Unsafe-eval
Our tag ships code backwards and forwards from PAT services, when rendering experiences on the page. This code is shipped as a string, and so Eval is needed to execute this response.
Is eval really unsafe?
No more than anything else, nowadays. There was a time where it was looked-down on, but in reality any MITM attack could choose to target any resource, such as the page itself, your GTM container, or anything else they choose. There is no "need" to have eval to execute malicious code in this scenario, as once feared in 2000-2010.
Unsafe-inline
We write style blocks to the page, as opposed to remote stylesheets, as common practice for things like masking the page temporarily and transformations for your experiments.
It is also used for inline scripts being run, such as onclick= event handlers.
Why do we need each policy / permission?
script-src
What is it?
This covers everything that runs Javascript:
<script src>and inline<script>blocks (inline ones need'unsafe-inline', a nonce or a hash)Inline event handlers such as
onclick="..."(also need'unsafe-inline')javascript:URLs in links, iframes and so on (need'unsafe-inline')eval(),new Function()andsetTimeout/setIntervalwith a string argument (need'unsafe-eval')Dynamic
import()and ES module loadingWebAssembly compilation (needs
'wasm-unsafe-eval'or'unsafe-eval')Workers:
worker-srcfalls back toscript-srcif neitherworker-srcnorchild-srcis set
Relevant values explained:
'unsafe-eval': Your experiences are returned as javascript via. the decisioning API call, and this permission is required for that asynchronous JS to load.
'unsafe-inline': In your experiences, it's very normal to add onclick= attributes to new elements, and in those cases unsafe-inline is the permission that allows this to happen.
For c.webtrends-optimize.com: Your Javascript Snippet, associated libraries, plus our Force Experiment Widget are all hosted on our CDN, which is c. - adding this subdomain allows your javascript snippet to work and without it, it won't.
For *.webtrends-optimize.workers.dev: If we host Javascript for your custom projects, which is rare but possible, this permission will allow us to load the associated script files. Typically, for uses such as Social Proofing, Recommendations, connect-src is sufficient as the data is called with XHR/Fetch.
connect-src
What is it?
connect-src controls which URLs a page’s scripts are allowed to make network connections to. Without our domain in here, each of those services cannot receive XHR, Fetch, Beacon etc. calls.
Relevant values explained:
For c.webtrends-optimize.com: This is where we keep all core libraries
For pat.webtrends-optimize.com: This is where we fetch decisions from, and the process relies on XHR / fetch calls to do so.
For collect.webtrends-optimize.com: This is where we ship user behaviour, and the process relies on either beacon tracking and fetch/xhr calls.
For *.webtrends-optimize.workers.dev: This is where we keep your custom microservices, such as looking up product feeds, reading back Social Proofing data etc. In the case of each of these, exchange of information typically flows through XHR/Fetch calls.
style-src
What is it?
This controls which CSS the page is allowed to load, typically through:
External stylesheets:
<link rel="stylesheet" href="...">and@importinside CSSInline
<style>blocks: blocked unless the policy has'unsafe-inline', a nonce or a hashInline
style="..."attributes
Note that as things stand, this does not cover the use of CSSOM and use of .insertRule with Javascript to existing style blocks. As such, the rules are largely aesthetic and far from complete for browser security.
Relevant values explained:
'unsafe-inline': Users have the ability to write CSS to the page for experiences, as a core part of the work we do. The Visual Editor / WYSIWYG will also draw on the page as you edit elements. These are written either as <style> blocks or style= attributes, and so require this permission as a must.
For c.webtrends-optimize.com: It is very normal to host external stylesheets with us for your experiences too. Plus, tooling such as the Force Experiment Widget comes with the need host and apply CSS to the page in the format of stylesheets.
For *.webtrends-optimize.workers.dev: Custom services you build may require us to deliver stylesheets, with this being the potential place they are hosted. These cases are more rare than hosted APIs, but are possible if you use Optimize for that reason.
img-src
What is it?
This is the permission to load assets into img tags, src and srcset attributes, background-image, border-image etc. CSS attributes, favicons, image elements inside SVGs, and images loaded using Javascript's new Image.
Relevant values explained:
For c.webtrends-optimize.com: Loading images onto our CDN for use in experiences is very normal practice, and this policy/permission allows that. We also have tooling like our Force Experiment bookmarklet, which is both hosted on the CDN and has image assets embedded into it.
For *.webtrends-optimize.workers.dev: Some microservices we run for customers come with image assets that they need to be able to load, such as dynamically-generated image banners. These cases are rare, but when used this policy/permission is required.
frame-src
What is it?
This is used to control iframe and legacy frame HTML tags.
Relevant values explained:
For https://c.webtrends-optimize.com/acs/accounts/d25dc2a4-010d-4fd1-a1ad-41e81138c16d/manager/: Surveys are a core part of the product, and the survey components are rendered via. an iframe. If you do not have this policy enabled, surveys will not render on your website. This folder path, which may look strange, allows us to restrict iframes to just one place where we host product assets, and block iframes from all customer accounts from hosting iframes.
Please note, though, that we do for various reasons host iframes and custom survey renderers as part of experiences we build, and if you intend to use the product in that way you will need broader permissions such as:
frame-src
https://c.webtrends-optimize.com/acs/accounts/d25dc2a4-010d-4fd1-a1ad-41e81138c16d/manager/ (for the core survey component)
https://c.webtrends-optimize.com/acs/accounts/[your account id]/manager/ (for any custom renderers and custom iframes you upload into your account only)
Doing so would mean iframes hosted in other WTO accounts would not be able to run on your website, which is reasonable protection to consider.
Protection against the 16 Nov 2026 cyberattack
Good CSP hygiene was a key differentiator between those whose compromised Optimizely snippets had data stolen from customers vs. those who didn't - over 40% had no CSP protection.
Any of the recommendations above, even the most permissive like allowing *.webtrends-optimize.com in default-src would have blocked the majority of issues observed as part of this cyberattack.
The topic is covered in depth, if you need more details, at:
https://docs.webtrends-optimize.com/en/articles/18471565-unaffected-optimizely-s-sign-up-flow-vulnerability-2026-11-17
The recommendations made in this docment have been evaluated against vulnerable points that were exploited for this cyberattack, and we believe would provide adequate protection. This is evaluated on this web page, which you are free to review:
You should expect to see this in the top-right corner:
And can inspect the response headers in Devtools > Network to view the Content Security Policies used.

