Introduction
In the Optimizely incident, attackers reportedly exploited a flaw in the Experimentation account signup flow, impersonated a user, and added malicious JavaScript to customer projects. The code was served from the vendor's CDN, under the vendor's certificate, from a host every affected site already trusted. Researcher Scott Helme's team directly observed 178 victims and said there could be more. None of those sites needed to be breached for the script to run in their visitors' browsers.
This checklist is for security engineers who own the browser-side attack surface. It covers inventory, Content Security Policy (CSP), exposure scoping, and independent validation of vendor remediation. Each item has a done/not-done state and a description of what good looks like. Where relevant, items map to ISO/IEC 27001:2022 Annex A controls and SOC 2 Trust Services Criteria.
Prerequisites
Before you start, confirm you have:
- Access to your tag manager, CDN configuration, and web server or edge headers.
- A list of pages that handle credentials, payment data, or personal data.
- A CSP reporting endpoint, or the ability to stand one up.
- Your supplier register, so findings can feed supplier risk reviews.
Checklist items
1. Inventory every third-party script on sensitive pages. Reference: ISO/IEC 27001:2022 Annex A 5.9 (inventory of information and other associated assets); SOC 2 CC6.1. Done when each script has an owner, a business purpose, and a record of what it can read or modify on the page. Include scripts loaded indirectly through tag managers. Good looks like: a living inventory generated from crawling production pages, reconciled against what the business believes it has approved. Unknown scripts are treated as findings.
2. Classify scripts by what they can touch. Reference: Annex A 5.12 (classification of information); Annex A 5.19 (information security in supplier relationships). Done when each script is rated by access: can it read form fields, intercept fetch/XHR requests, read cookies, or inject DOM? The reported skimmer watched form submissions and POST requests for card number, expiry date, and CVV, so any script on a page with those fields deserves the highest rating. Good looks like: an experimentation or personalization script on a checkout page is rated as high-risk code, not as marketing tooling.
3. Treat vendor-hosted script content as a change-managed dependency. Reference: Annex A 8.32 (change management); SOC 2 CC8.1. Done when you know who can alter what your site executes, including customer-editable fields in vendor consoles. In this incident, attackers inserted code into the Project JavaScript field and left the rest of each snippet untouched. Good looks like: you can name every person and vendor workflow that can change code served to your visitors, and changes in those consoles are logged and reviewed.
4. Restrict script-src to the hosts each page needs.
Reference: Annex A 8.9 (configuration management); Annex A 8.26 (application security requirements).
Done when sensitive pages use an allowlist or nonce/hash-based script-src, and wildcard or overly broad sources are removed. Note the limit of host allowlisting: when the trusted host itself serves the malicious code, as in this case, a host allowlist alone won't stop execution. That's why the next items matter.
Good looks like: each sensitive page has the narrowest policy it can function under, documented per page type.
5. Remove unsafe-eval wherever possible, and justify it where not.
Reference: Annex A 8.9; SOC 2 CC6.8.
Done when every unsafe-eval exception has a documented owner, reason, and expiry date. Analyst Frank Dickson noted that at HSBC the policy blocked the main payload and the data theft, but a backup copy of the malicious code still ran through the unsafe-eval setting. A single permissive directive can undo an otherwise sound policy.
Good looks like: vendor setup guides are reviewed critically before their CSP advice is adopted, and exceptions are tested to confirm what they actually permit.
6. Lock down connect-src to limit exfiltration.
Reference: Annex A 8.20 (networks security); Annex A 8.23 (web filtering).
Done when outbound browser connections from sensitive pages are limited to known endpoints. The reported skimmer sent stolen cards to an attacker-controlled domain using navigator.sendBeacon. A tight connect-src can block direct sends to unapproved endpoints, but it won't prevent exfiltration through an allowed endpoint.
Good looks like: a test injection of a request to an unlisted domain from a sensitive page is blocked and reported. Check how your policy treats beacon requests specifically.
7. Deploy new policies in report-only mode first.
Reference: Annex A 8.29 (security testing in development and acceptance).
Done when a Content-Security-Policy-Report-Only header runs in production long enough to cover your real traffic patterns, and violation reports are triaged by a named owner.
Good looks like: violations are classified as legitimate dependency, unknown script, or attack, and the enforced policy is promoted only after legitimate violations are resolved. Silent report-only mode with nobody reading reports is a common failure.
8. Monitor CSP violation reports as a detection source. Reference: Annex A 8.16 (monitoring activities); SOC 2 CC7.2. Done when violation reports feed your alerting, with a defined threshold and response path for unexpected script sources or blocked outbound connections. Good looks like: a new, unrecognized script source on a payment page generates a ticket the same day.
9. Map payment-page architecture to actual exposure. Reference: Annex A 5.12; Annex A 8.26. Done when you've documented, per page, whether card data is entered in a hosted payment iframe or in your own form fields. The report said hosted iframes from providers such as Stripe and Adyen were out of the skimmer's reach, while cards typed into a site's own fields were not. Good looks like: your exposure assessment is driven by how data is collected, not by whether a vendor script was present. Pages that collect sensitive data in first-party fields are prioritized for isolation or migration.
10. Establish your own exposure window. Reference: Annex A 5.24 (information security incident management planning); Annex A 5.28 (collection of evidence). Done when you've reconstructed when attacker code first loaded on your pages from your own telemetry: CDN logs, CSP reports, synthetic monitoring, or web archives of served scripts. Vendor and researcher timelines can differ. Dickson pointed to a three-and-a-half-hour gap between the vendor's reported first malicious write and an independent observation of attacker code loading. Good looks like: your scoping starts from the earlier credible timestamp and narrows only with evidence, not vendor assurance.
11. Request evidence for vendor remediation claims. Reference: Annex A 5.19, 5.20 (addressing information security within supplier agreements), 5.22 (monitoring, review and change management of supplier services). Done when you've asked the vendor in writing for the root cause, a reconciled forensic timeline, the list of affected projects, and how injected code was removed. Optimizely said it blocked the vulnerable path, ended sessions, revoked tokens, reset access, removed injected code, and blocked delivery in Cloudflare. Those are claims to verify, not conclusions to file. Good looks like: your supplier record holds the vendor's evidence, your own verification results, and open questions. Helme said he couldn't yet verify the fix and wanted to see whether cleaned sites got reinfected, which is the right posture.
12. Re-verify after the vendor says it's fixed. Done when you've diffed served script content against a known-good baseline after remediation, rotated vendor console credentials and tokens, and scheduled repeat checks over the following weeks. Good looks like: reinfection monitoring is in place, and you can show an assessor the baseline, the checks, and the dates.
13. Preserve a rollback and kill-switch option. Done when you can disable a vendor script on short notice without a full deployment. Salesforce said it disabled Optimizely scripts across preview and production as a precaution. Good looks like: the decision to pull a script is pre-authorized in your incident procedures, with the business impact understood in advance.
Common mistakes
- Treating a trusted vendor domain in
script-srcas proof the content is safe. - Adopting a vendor's recommended CSP without testing what each exception allows.
- Running report-only mode with no one reviewing violations.
- Accepting "fully secured" language from a vendor mid-investigation.
- Scoping exposure by whether a script was installed, rather than by what sensitive data your pages collect.
- Reviewing vendors at onboarding only, with no reassessment when the vendor's behavior or access model changes.
Next steps
Start with items 1, 2, and 9, since they tell you which pages matter most. Then run items 5 through 7 against those pages. Record the results in your risk register and supplier reviews so the work is visible during surveillance audits or SOC 2 testing. Finally, add the incident-time steps (items 10 through 13) to your incident response procedures now, so you aren't inventing them while a vendor's advisory is still changing.




