Third-Party Website Scripts: How to Reduce the Risk to Your Business
A trusted testing tool was used to put card-skimming code on 178 websites. Here is what third-party website scripts can do and how to limit the risk.

Most business websites run code written by other companies. Analytics, live chat, A/B testing, advertising pixels, review widgets and cookie banners all arrive as third-party website scripts. Each one runs inside your visitor's browser with the same access as your own code, so it can read what people type into your forms.
That risk became concrete in November 2026. An attacker abused a flaw in a popular website testing product to add malicious code to customer sites, including pages where people enter card details. If your website loads tools you did not build, this article explains what happened, what it means for a Kenyan or African business, and the practical steps that reduce your exposure.
- Any script you add to your site can read and change the page, including checkout and login forms.
- Keep a short list of every third-party script, who owns it and which pages it loads on. Remove what you no longer use.
- Keep payment fields on your payment provider's hosted page or iframe, and keep extra tools off checkout pages.
- A Content Security Policy limits where scripts can load from and send data to. It is one of the few controls that helped in this incident.
- Under Kenya's Data Protection Act, a breach affecting personal data can trigger a 72-hour duty to notify the Data Commissioner, so plan your response before you need it.
What happened with Optimizely in November 2026
As of 30 November 2026, this is what has been publicly reported. On 16 November 2026, malicious JavaScript was added to customer projects in Optimizely Web Experimentation, a tool companies use to test different versions of their web pages. Optimizely's status page says an unauthorised party exploited a vulnerability in its Experimentation product, and that the flaw has been fixed and the injected code removed. Optimizely later said the attacker used a weakness in the account signup flow to impersonate users on targeted accounts, and described it as not being a credentials breach.
Two security research teams, StepSecurity and Report URI, each reported that 178 organisations had the malicious code in their Optimizely snippet, and Report URI says the real number is likely higher. According to their analysis, the code tried to capture card numbers, expiry dates and security codes typed into forms, swap cryptocurrency wallet addresses so that payments went to the attacker, and take browser cookies. Report URI reports that the infected files were cleaned the same day.
The important detail for business owners is how ordinary the entry point was. None of the affected companies had to make a mistake in their own code. They had added a trusted vendor's snippet to their pages, and that snippet changed underneath them.
Why this matters if you run a website in Kenya
You do not need to be a global brand to carry this risk. A small online shop, a school portal or a booking site often loads several third-party tools, sometimes added years ago by a previous developer or a marketing agency. Each tool is a separate company you are trusting with your visitors' data.
For many Kenyan sites, the checkout uses M-Pesa through Safaricom's Daraja API rather than a card form. That reduces the card-skimming risk, but it does not remove the wider one. A malicious script on the same page can still read names, phone numbers, delivery addresses and login details, or change the text a customer sees. Those are personal data, and losing them can harm both your customers and your reputation.
There is also a legal side. Kenya's Data Protection Act, 2019 requires a data controller to notify the Data Commissioner without delay, and within 72 hours of becoming aware, of a personal data breach where there is a real risk of harm to the people affected. A compromised third-party script on a form page can be exactly that kind of breach, even though you did not write the code. Take legal advice on your specific obligations; the point here is that you need to know what runs on your pages in order to respond in time.
Which third-party scripts carry the most risk?
Not every script is equally dangerous. The risk depends on two questions: what the script can change, and which pages it loads on. A tool that can run any code its vendor's dashboard allows, on every page including checkout, deserves more care than a static font file.
| Option | Good fit | Trade-off |
|---|---|---|
| A/B testing and personalisation tools | Designed to change your pages from an outside dashboard, often with custom JavaScript. | High. Anyone with access to the tool's account can change what runs on your site, which is what happened in this incident. |
| Tag managers | Let marketing teams add other scripts without a developer. | High. Convenient, but every person with access can add code to every page the tag manager loads on. |
| Analytics and advertising pixels | Measure visits and campaigns. | Medium. Usually fixed code, but they still run with full page access and often load more scripts. |
| Live chat and support widgets | Let visitors talk to your team. | Medium. Often load on every page and handle what visitors type. |
| Hosted payment page or payment iframe | Takes card or mobile money details on the payment provider's own page. | Lower for your site. Researchers reported that card fields inside cross-origin payment iframes were out of reach of the skimming code. |
A practical checklist to reduce the risk

These steps are listed roughly in the order we would take them. The first three need no special tools, only time and access to your website and accounts.
1. List every script your site loads
Open your main pages in a browser, including the checkout, login and contact forms, and look at the network requests or ask your developer to do it. Write down each third-party domain, what the tool does, who in your business asked for it, and which pages need it. Many businesses find tools nobody uses any more. Removing them is the cheapest security improvement available.
2. Keep extra tools off sensitive pages
Your checkout, payment, login and account pages should load as little outside code as possible. If marketing wants to test a checkout change, consider building that variation in your own code for a limited period instead of handing the page to an outside tool. The PCI DSS card security standard takes the same view: requirement 6.4.3 asks merchants to keep an inventory of scripts on payment pages, justify each one and confirm it is authorised, and requirement 11.6.1 asks them to detect unauthorised changes.
3. Review who can change your tools
For every tool that can change your pages, check who has an account, remove former staff and agencies, turn on two-factor sign-in and review any API keys. If you use Optimizely Web Experimentation, review the Project JavaScript and custom code in every project and its change history around 16 November 2026, as both research teams recommend.
4. Add a Content Security Policy
A Content Security Policy is a header your server sends that tells the browser which domains scripts may load from and which domains the page may send data to. In this incident, Report URI found that, among the affected sites it checked, those with a restrictive policy blocked the malicious code from loading or from sending stolen data to the attacker's servers. A policy is not a complete defence, since it cannot stop bad code served from a domain you already allow, and it needs testing so it does not break legitimate tools. Start in report-only mode, learn what your site really loads, then enforce it.
5. Pin static scripts and monitor changes
For scripts that should never change, such as a fixed version of a library, Subresource Integrity lets the browser refuse a file that differs from the version you approved. It does not suit tools that change every time someone edits an experiment, so pair it with monitoring that alerts you when the scripts or outgoing connections on key pages change.
6. Write down what you will do if a vendor is compromised
Decide in advance who removes a tool from the site, who contacts the vendor, who assesses whether personal data was exposed and who handles notification to the Data Commissioner and to customers. A one-page plan agreed now is far more useful than a long discussion during an incident.
Questions to ask before adding a new tool
The safest script is the one you never added. Before a new widget, pixel or testing tool goes live, ask: which pages does it need, can it run custom code, who at the vendor and in our team can change it, does it support two-factor sign-in, what personal data does it see, and how will we remove it if we stop using it? If the answers are unclear, limit it to the pages that need it or choose a simpler option.
Building these limits in from the start is easier than retrofitting them. When we work on websites and web applications, the scripts each page loads and the payment flow are part of the plan, not an afterthought.
When to ask for a review
If your site has grown over several years, was built by someone who has moved on, or relies on a tag manager that several people can edit, an outside review is often the fastest way to see what is really running. Our technical consulting service can review an existing website or web app, list the third-party scripts it loads, and give you clear priorities for what to remove, restrict or rebuild.
You do not need to have a security incident to start. Contact Alphonix with your website address and a short note on the tools you use, and we will suggest a practical next step.
How we prepared this guide
Written by Alphonix. It is based on Optimizely's public incident notice as reported by security researchers, two independent technical write-ups of the November 2026 incident, published PCI DSS guidance on payment page scripts, and Kenya's Data Protection Act, 2019. Facts were checked on 30 November 2026 and details of the incident may change as more is disclosed. This is practical guidance, not legal advice or an independent ranking of security tools or vendors.
Facts reviewed
- Optimizely status page: Experimentation incident
- StepSecurity: OPTIMJACK, Optimizely-hosted scripts loaded a crypto clipper and card skimmer
- Report URI: World's largest brands infected with malware via Optimizely
- PCI Security Standards Council: Scaling 6.4.3 and 11.6.1 browser script management
- Kenya Law: Data Protection Act, 2019 (No. 24 of 2019)
- MDN Web Docs: Content Security Policy (CSP)


