Ackatec
All insights

The Optimizely Script Injection: How to Control Third-Party JavaScript and Meet PCI DSS 6.4.3 and 11.6.1

Malicious code served through Optimizely reached visitors of 178 organizations. How to inventory, restrict, and monitor third-party scripts under PCI DSS.

Author
Ackatec
Published
Reading time
7 min read
  • Application security
  • Supply chain security
  • PCI DSS
  • Compliance
  • Incident readiness

On November 16, 2026, an attacker inserted malicious JavaScript into customer projects in Optimizely Web Experimentation, a widely used A/B testing tool. The code then ran in the browsers of ordinary visitors to the sites that load those projects. Researcher Scott Helme of Report URI found the code in 188 of the 1,611 Optimizely snippets his team checked (opens in a new tab), belonging to 178 organizations. Report URI says the code swapped cryptocurrency wallet addresses, skimmed payment cards, stole cookies and screenshots, and delivered exploit kits to iPhones and iPads.

The affected sites did not need to be breached directly. Visitors were exposed because each site had told the browser to trust whatever Optimizely served.

The short answer: if you use Optimizely Web, follow the vendor's incident guidance now. Whether you use it or not, treat this as a prompt to inventory every third-party script on your sensitive pages, cut the ones you do not need, enforce a restrictive Content Security Policy, and monitor for script changes. If you accept card payments online, those steps also map directly to PCI DSS Requirements 6.4.3 and 11.6.1.

What happened in the Optimizely incident?

According to Optimizely's security advisory (opens in a new tab), an unauthorized third party exploited a flaw in the Web Experimentation account signup flow, used it to impersonate users on targeted customer accounts, and inserted malicious JavaScript into those customers' projects. Optimizely says it closed the vulnerability within three hours of detection, removed the injected code from all affected projects, and that fewer than 5 percent of its customers were impacted. It says this was not a credentials breach and no other product was affected.

Optimizely's customer incident report (opens in a new tab) gives an exposure window of 07:51 to 22:24 UTC on November 16. It says the script targeted card details typed into forms on the site itself, that cards entered in hosted payment iframes such as Stripe or Adyen were not accessible, and that sites with a strong Content Security Policy were protected.

Helme's analysis adds detail for defenders. The attacker wrote the loader into each project's Project JavaScript field, so the file still came from Optimizely's own CDN. One variant hid the attacker's URL in base64, and another carried an inline copy of the payload that ran through eval if the attacker's domain was blocked.

What is a third-party JavaScript supply chain attack?

A third-party JavaScript supply chain attack is one in which code you load from an outside provider, such as an analytics, testing, chat, or tag management service, is altered to behave maliciously and then runs for your own users. The browser cannot tell the difference, because the script arrives from a host you approved.

As Helme argues in a follow-up post (opens in a new tab), most organizations review server code through pull requests and pipelines, yet let a script tag fetch and run whatever a vendor serves at runtime. That gap applies to every marketing and product tag on your pages.

Did Content Security Policy actually help?

Yes, when it was restrictive. Report URI crawled sites belonging to affected organizations and tested their policies against what this payload needed. In that sample, 68 organizations had no CSP at all, 50 had a CSP that still allowed the payload and the data theft, 17 let the payload run but blocked the data theft with connect-src, and only 24 blocked the payload outright.

Three findings stand out:

  • Allowing the vendor's host did nothing. The code came from the trusted host itself. What protected sites was a script-src listing only the hosts actually needed.
  • Two common settings let it through. 'strict-dynamic' extends trust to any script the snippet inserts, and 'unsafe-eval' allowed the inline fallback to run even where the external file was blocked.
  • connect-src limits the damage. Restricting where a page can send data stopped card, cookie, and screenshot theft for 17 organizations, although address swapping inside the page still worked.

A Content Security Policy (opens in a new tab) is not a complete defense, but it is one of the few controls that still works when trusted vendor code turns hostile.

What do PCI DSS Requirements 6.4.3 and 11.6.1 require?

PCI DSS v4.x added two requirements aimed at exactly this kind of e-skimming. The PCI Security Standards Council's March 2025 information supplement, Payment Page Security and Preventing E-Skimming (opens in a new tab), explains them:

  • Requirement 6.4.3 says all payment page scripts loaded and executed in the consumer browser must be managed with a method to confirm each script is authorized, a method to assure the integrity of each script, and an inventory of all scripts with a written business or technical justification for each.
  • Requirement 11.6.1 says a change and tamper detection mechanism must alert personnel to unauthorized modification of security-impacting HTTP headers and the script contents of payment pages as received by the consumer browser, at least weekly or at a frequency set by a targeted risk analysis.

The supplement names CSP and Subresource Integrity as example approaches, without mandating either. It also warns that malicious changes can persist between checks, so it recommends frequent or real-time monitoring where feasible. Report URI says the attacker rebuilt this payload 26 times in one day, which shows how much a weekly check can miss.

Does an embedded payment iframe take you out of scope?

Not entirely. With embedded payment forms, the supplement makes the merchant responsible for scripts on the parent page that includes the iframe, and where scripts create the iframe, both requirements apply to them. SAQ A does not include 6.4.3 or 11.6.1, but its eligibility criteria require the merchant to confirm that its site is not susceptible to attacks from scripts that could affect its e-commerce systems. Confirm your validation path with your acquirer or assessor.

What should you do this week?

If you use Optimizely Web Experimentation:

  • Follow the vendor's actions. Optimizely asks customers to treat this as a security incident, confirm which pages loaded the snippet during the window, review CSP reports, outbound browser requests, and card and crypto transactions, and assess notification duties with counsel.
  • Keep logs for all of November 16. Optimizely asks customers to retain web server, CDN, WAF, CSP, payment, and fraud logs covering at least that day. Report URI's timeline shows injection activity hours before Optimizely's stated start time.
  • Check access. Report URI recommends reviewing who and what can write to your account, including users, API tokens, and integrations, and rotating credentials and any secrets held in non-HttpOnly cookies.

For every organization with sensitive web forms:

  1. Inventory scripts on sensitive pages. List every script on login, checkout, and account pages, with an owner and a reason.
  2. Remove what you do not need. Optimizely itself recommends removing its snippet from pages that handle sensitive input where you are not running experiments. Apply that rule to every tag.
  3. Tighten your CSP. Restrict script-src and connect-src, avoid 'unsafe-eval' where you can, and enable violation reporting. Start in Report-Only mode if enforcement would break something, then move to enforcement.
  4. Pin what you can. Use Subresource Integrity (opens in a new tab) for static third-party files. Dynamic vendor snippets usually cannot be pinned.
  5. Monitor and rehearse. Alert on new or changed scripts and headers, and decide in advance who can pull a vendor tag from production.

How do you know your web pages are protected?

You know your pages are protected when you can produce a current script inventory, show a restrictive policy in enforcement, and point to alerts that would fire if vendor code changed. Ackatec can help:

  • Compliance readiness support can map PCI DSS 6.4.3 and 11.6.1 to accountable owners and surface evidence gaps before your assessor does.
  • A penetration test scoped to your web applications can examine how script loading, CSP, and sensitive forms hold up from an attacker's point of view.
  • Incident readiness work can make sure your team knows who decides to pull a third-party tag, who calls the vendor, and who assesses notification duties.

Our post on the LiteLLM supply chain attack covers the same trust problem on the server side. If you want an outside view of your third-party script exposure, talk with Ackatec.