The Decision You Are Facing
On November 16, Report URI identified malicious JavaScript in Optimizely files associated with 178 organizations, including the BBC, CNN, Zoom, Salesforce, and GitLab. This code could redirect cryptocurrency payments, skim card details, and deliver exploit kits targeting vulnerable iPhones and iPads. These organizations weren't breached directly; they loaded a snippet from a trusted service, which became the delivery route for the attack.
Researchers captured a clean version of the BBC's snippet at 02:21 UTC and an injected version two hours later. That's the window you're managing. Your decision is how much control to impose on each third-party script running in your customers' browsers. You have three realistic paths: monitor, isolate, or remove it. Most programs need all three, applied to different scripts.
Key Factors That Affect Your Choice
Consider these questions for each script before choosing a path.
- Where does it execute? A script on a payment or login page can read card fields and session data. A script on a marketing blog cannot. Page context is the biggest driver.
- What does it need to do? Experimentation tools like Optimizely work by changing what visitors see, so they need broad DOM access by design. That makes them powerful and hard to constrain.
- Can you tell what it's supposed to do? Without a baseline of normal behavior, you can't detect changes.
- How much would the business notice its loss? A script with a clear commercial owner and measurable value is easier to justify keeping under controls.
- Does your risk governance require it? Under SR 23-4, you're expected to scale oversight to the risk and criticality of the relationship. Under the EBA Outsourcing Guidelines, services supporting Critical or Important Functions draw stricter requirements, including sub-outsourcing visibility. A script vendor supporting a regulated customer journey may qualify, so check your Criticality Classification before assuming a tag manager entry is low risk.
Path A: Monitor (Keep the Script, Watch It Closely)
Choose this when: the script sits on pages with no payment or credential entry, the vendor delivers real business value, and you can establish a behavioral baseline.
Monitoring requires continuous oversight of active arrangements applied to code. Annual questionnaires can't catch a change made at 04:21 UTC on a Thursday. Your controls need to operate at the speed of the attack.
If the script is low-sensitivity, then:
- Inventory every script and its owner. You can't monitor what you haven't listed. Include scripts loaded by other scripts.
- Deploy a Content Security Policy in report mode first. Use
report-uri/report-toto see which sources load and which connections the scripts open. Tighten to enforcement once the noise is understood. - Hash and diff the delivered file. Capture the script as served and alert on any change. The BBC timeline shows why: a clean capture followed by an injected version is exactly the signal a diff catches.
- Watch outbound connections. Malicious payloads need somewhere to send data or load more code. Restrict
connect-srcand alert on new destinations. - Feed in real-time threat intelligence. Indicators of compromise for known-bad domains and payload patterns shorten the gap between a vendor compromise and your detection. Treat intel as an accelerator for the controls above, not a substitute.
Limit of this path: monitoring detects; it doesn't prevent. If the script can read card data, detection after the fact is too late.
Path B: Isolate (Keep the Script, Shrink What It Can Touch)
Choose this when: the script is business-critical, runs near sensitive data, and you can't give it up.
If the script must coexist with payment or authentication flows, then reduce its reach:
- Separate the pages. Don't load experimentation or personalization tags on checkout, payment, or login pages unless there's a documented reason. This one decision would have removed the card-skimming exposure for many sites.
- Use sandboxed iframes for third-party widgets that don't need DOM access to your page.
- Enforce strict CSP with explicit allowlists for script and connection sources, so an injected payload can't phone home or pull a second stage from an unapproved domain.
- Use Subresource Integrity where the file is static. Note the constraint: SRI breaks when a vendor legitimately updates a hosted file, which is common with tools that serve customer-specific configurations. Where you can't pin a hash, rely on the diff-and-alert approach from Path A.
- Protect payment fields structurally. Hosted payment fields served from the processor's domain keep card entry outside your page's script scope, which also supports PCI DSS requirements on payment page script management.
The usability tradeoff: tighter controls will occasionally break a marketing test or delay a tag. Settle that in advance. Agree with web and marketing teams on a fast exception process so security isn't bypassed when a campaign deadline hits.
Path C: Replace or Remove (Stop Depending on It)
Choose this when: the script has broad access, the vendor can't demonstrate change controls, or the business value doesn't justify the exposure.
If any of these are true, then exit or replace:
- The vendor can't explain how it prevents unauthorized changes to files served to your visitors.
- The script has no active owner or measurable use.
- You can't isolate it from sensitive pages and can't monitor it effectively.
Your Wind-Down Plan should exist before you need it. Know how to remove the snippet quickly, what breaks, and what the Substitutability options are. Also review contract terms: Notification Timeline for security incidents, Right to Audit, Liability and Indemnification, and Termination Rights. For anything touching a Critical or Important Function, confirm a Sub-Outsourcing Clause gives you visibility into who hosts and delivers the vendor's code. This is Fourth and Nth Party Management applied to the web layer.
Concentration matters too. If one vendor's snippet is on every page you operate, your Provider Concentration Risk is the whole site, not one feature.
Summary Matrix
| Factor | Path A: Monitor | Path B: Isolate | Path C: Replace/Remove |
|---|---|---|---|
| Page sensitivity | Low (no payment or credentials) | Medium to high | High, with no feasible isolation |
| Business value | Moderate to high | High, hard to replace | Low or unclear |
| Vendor change controls | Adequate or testable | Partial | Absent or unverifiable |
| Primary control | File diffing, CSP report mode, intel feeds | Page separation, strict CSP, sandboxing, hosted payment fields | Wind-Down Plan, removal |
| Detects vs. prevents | Detects | Prevents and limits | Eliminates |
| Main cost | Alert triage effort | Friction with web and marketing teams | Lost functionality, migration effort |
| Governance anchor | SR 23-4 Continuous Monitoring of Active Arrangements | EBA Outsourcing Guidelines for Critical or Important Functions | Termination Rights, Substitutability |
Most mature programs end up with a mix: monitor the low-risk tags, isolate the critical ones, and retire what can't be defended. The BBC timeline is the benchmark for your detection speed. If your current process couldn't have flagged a changed file within hours, start with Path A's inventory and diffing, then move your sensitive pages to Path B.





