Optimizely Vulnerability Used to Inject Malicious JavaScript into Client Sites

An attacker exploited an Optimizely vulnerability to inject malicious JavaScript into client projects. Site owners are advised to check custom code and access permissions.

· 5 min read · 4 comments

On November 16, visitors to sites using Optimizely Web Experimentation received malicious JavaScript: an unknown attacker had added it to client projects by exploiting a vulnerability in the account registration process. As Search Engine Journal reports, the script replaced crypto wallet addresses, searched site forms for card details, and loaded tools to attack iPhones and iPads running older versions of iOS. Teams should check their projects’ custom code and access permissions in Optimizely.

Malicious code was added to project settings

Checking the site’s source code alone is not enough. Optimizely Web delivers JavaScript snippets to clients for experiments, and project settings include a Project JavaScript section: code added there runs whenever a page containing the snippet loads. That is where the attacker placed the malicious code, leaving the rest of the script unchanged. It continued to arrive from cdn.optimizely.com, a familiar source for these sites, so the trusted delivery domain alone did not reveal the tampering.

Report URI founder Scott Helme found malicious code in snippets belonging to 178 organizations, including Zoom, BBC, CNN, Salesforce, and GitLab. Snippets served by clients from their own domains were also affected, as were scripts for optimizely.com and login.optimizely.com.

Helme’s team examined 1,611 Optimizely snippet files, mostly from its own scan data. Malicious code appeared in 188 files; Helme believes the actual number may have been higher. The first detection was on November 16 at 04:21 UTC. By 23:11 UTC that same day, all infected files the team had found were clean.

Optimizely closed off the vulnerable path, released a fix, terminated active sessions, revoked tokens, and reset access for affected accounts. The company notified affected clients. As of the morning of November 17, its investigation was ongoing: published reports did not specify how many projects were affected or how the registration flaw allowed changes to existing projects.

What the script did and where CSP helped

The injected code loaded a second script that replaced crypto wallet addresses with the attacker’s addresses. From 13:43 UTC, it also monitored input of card numbers, expiration dates, and CVVs in the sites’ own forms and attempted to send the data once it had all three. It could not access payment fields in embedded payment iframes, such as those from Stripe and Adyen.

When replacing an address near words such as wallet or payment, the script tried to send the attacker the page URL, cookies without the HttpOnly attribute, and a snapshot of the page. For visitors using iPhones and iPads, it also loaded the Coruna and DarkSword exploit kits. By 19:25 UTC on November 16, the attacker’s wallets had received about $7,040. Report URI could not determine how many cards, cookies, or devices had been compromised.

A comparison of Content Security Policy (CSP) settings across 159 organizations showed varying levels of protection. Sixty-eight had no CSP; for 50, the policy allowed both code execution and data exfiltration. On another 17 sites, the code could run, but connect-src restrictions prevented it from sending data out. That did not stop wallet address replacement. At 24 organizations, roughly 15% of those checked, a stricter script-src blocked the code from running altogether.

Simply allowing the Optimizely domain in CSP was not enough: the malicious code came from an allowed address. Depending on how it was loaded, strict-dynamic or unsafe-eval settings could also permit it to run. What matters in a review, then, is the specific script-src and connect-src rules, not merely whether a CSP header is present.

What site owners and teams should check

If your site uses Optimizely Web, review Project JavaScript in every project and custom JavaScript in experiments. Helme recommends looking for 1688360.cc, atob(, and code your development team did not add. The project history records changes to Project JavaScript: you can filter entries by type, date, and source—the REST API or the Web Experimentation interface.

Check which users have editing access and which API tokens and integrations are active, then rotate credentials. Treat card details entered into the site’s own forms on November 16 as potentially exposed. Session tokens and secrets stored in cookies without HttpOnly should also be rotated.

The marketing team needs to take part in this review alongside developers. The change was made in the experimentation tool’s project, not in the site’s source code. That means checking not only what runs on the pages, but also who can change project settings.

My take

I would start with the change history and access permissions in Optimizely, then compare the code in projects and experiments against the CSP settings. Checking the specific points through which code reaches the pages is more useful here than a general promise to “improve security.”

For me, the main takeaway is simple: if a third-party tool can run JavaScript on every page, its account and settings deserve the same attention as the site’s code. A trusted domain does not, by itself, guarantee safe content; script-src and connect-src restrictions are best assessed in light of how scripts are actually loaded.

Sources

Where the news comes from. The text is a retelling in the author’s own words; the facts come from the source, the opinion is the author’s.

  1. Optimizely Says Attacker Used A Signup Flaw To Inject Malware via @sejournal, @MattGSouthern www.searchenginejournal.com

About the author

Vitalie E.

Senior full-stack developer

I build backend systems and integrations for online stores, mostly with PHP and TypeScript. When investigating performance, I look at queries and caching first, not trendy rewrites.

All posts by the author

Leave a comment

Not published. We’ll send a link to confirm your comment.

No links or ads. Your first comment is published after review. By sending a comment you agree to the privacy notice.

  1. one useful bit of incident hygiene is keeping versioned snapshots of Optimizely project settings, so a change to Project JavaScript can be diffed against a known-good state instead of reconstructed from memory during cleanup. “who changed this and when” is a much nicer question when the answer is in an audit trail

  2. On a small project I worked on, we found an old experiment snippet still loading after the test was supposedly over — because apparently “finished” and “removed” are different states. Since Optimizely’s Project JavaScript runs wherever its snippet is installed, I’d include that custom-code area in access reviews, not just inspect the site source.

    1. @gio_backend, did your access review include checking who could edit Project JavaScript, or did the stale experiment turn out to be an ownership and cleanup issue? Those seem like separate failure modes, and both matter here.

      1. Vitalie E. Post author

        Those are separate checks: review who can edit Project JavaScript, then audit the code and remove experiments that are no longer needed; a stale snippet can persist even when nobody has malicious access.