Both Script Hijacks Were Preventable. A CSP Stops the Next One Before It Starts.
Two incidents, eighteen days apart
Their servers were fine. Their code was fine. Basically, they got robbed through a door they had handed someone else the key to.
On October 29, Polymarket traders started losing money. Not because of a bad contract or a bad bet. A page speed monitoring script from DebugBear, a vendor that does a lot of what we do, got swapped for a wallet drainer. Attackers hijacked DebugBear's DNS at the registrar and pointed the script at their own server. For about an hour, that script sat inside signed-in sessions, read the trading keys Polymarket kept in the browser, dumped positions, and moved money out. Roughly $2.7M left 726 wallets. Polymarket ended up returning $3.9M to cover the theft plus the losses from halting trading.
Then on November 16, it happened again at a much bigger scale. Attackers used a flaw in Optimizely Web Experimentation to write a loader into customers' Project JavaScript. The snippet still came from cdn.optimizely.com with a valid certificate, so every browser treated it as legit. At least 178 organizations served it to their visitors: CNN, BBC, Zoom, Salesforce, IKEA, HSBC, Air France-KLM, and a long list of others. The payload swapped crypto wallet addresses, skimmed card numbers typed into on-site forms, grabbed cookies and screenshots, and on older iPhones opened an exploit chain in a hidden iframe. The first injection showed up at 04:21 UTC. Mass cleanup didn't start until 20:40. That's a full business day of serving malware from some of the most visited sites on the internet.
Neither Polymarket nor the Optimizely customers got breached in the traditional sense. Their servers were fine. Their code was fine. Basically, they got robbed through a door they had handed someone else the key to. And here's the part that should bother every ecommerce leader reading this: the browser already has a lock for that door. Most sites just never turn it on.
Every tag is someone else's code running with your keys
I spent years at The Home Depot building out a vendor SRE team. That team existed because of a simple and uncomfortable truth: the vendors on your site can take your site down, and your customers don't care whose fault it was. Back then we mostly worried about vendors breaking performance. A slow tag, a blocking script, a timeout holding checkout hostage. Security was someone else's meeting.
That separation doesn't hold up anymore. The browser doesn't know the difference between your checkout code and a page speed snippet. Once a script loads, it gets the same access your own code does: the DOM, every form field, local storage, any cookie that isn't HttpOnly, and the ability to send data wherever it wants. A RUM tool, an A/B testing tool, a chat widget. All of them run with your keys.
And here's the part I have to put on display, because it applies to us too. Blue Triangle's tag is a third-party script. If your strategy for us is "they're a monitoring company, they're probably fine," that's the exact same trust assumption that cost Polymarket's traders $2.7M. Hold us to the same standard as everyone else. That's the whole point of this post.
A CSP stops this before it can happen
A Content Security Policy (CSP) flips the default. Without one, every script on your page can load whatever it wants and send data wherever it wants. With one, the browser only allows the domains you approved, and refuses everything else before a single malicious line runs. No cleanup, no forensics, no customer notification letters. Let's drill in on both incidents.
A CSP doesn't catch the theft after it happens, it removes the path the theft needs. But only if the policy is tight, scoped to the pages that matter, and actually maintained.
Optimizely: the attack needed two things a CSP takes away. First, the loader had to pull the clipper and skimmer from an attacker domain (1688360[.]cc). A strict script-src refuses that load. Second, stolen card data had to go back to that same domain. A strict connect-src refuses that too. Even the variant that carried the whole payload inline still had to phone home, and that call dies in the browser. A site with a tight policy served a hijacked snippet that did nothing. One catch the researchers called out: allowing cdn.optimizely.com alone doesn't help. The policy has to control where data goes, not just where scripts come from.
Polymarket: the drainer came from DebugBear's own address and reported back to a DebugBear domain, so a sitewide policy that trusted DebugBear everywhere would have let it through. The fix is a policy scoped to the page. A page speed script has no business running where a signed-in trader can move money. Leave DebugBear out of the script-src on that page and the hijacked file never loads. 726 wallets stay full.
That's the whole value in one line: a CSP doesn't catch the theft after it happens, it removes the path the theft needs. But only if the policy is tight, scoped to the pages that matter, and actually maintained. That last part is where almost everyone falls down.

Why most sites don't have a real CSP
Security owns the risk. Marketing and ecommerce own the tags. Engineering owns the header. Nobody owns the approval.
If CSPs are this useful, why do most big sites run either nothing or a policy so loose it's decoration? Because building and maintaining one by hand is miserable. Marketing adds a tag through the tag manager on a Friday. A vendor quietly adds a subdomain. Someone wildcards *.vendor.com to make the console errors go away. Nobody owns the list, so the list rots. Teams get burned once by a CSP that broke checkout, and the policy gets loosened until it can't break anything, which also means it can't protect anything.
That's an organizational problem dressed up as a technical one. Security owns the risk. Marketing and ecommerce own the tags. Engineering owns the header. Nobody owns the approval.
How Blue Triangle CSP Manager fixes the ownership problem
This is where CSP Manager earns its spot. It lives in the Blue Triangle portal (Services > CSP Management) and it's built around the workflow that usually falls apart, not just the header syntax.
- See every domain first. CSP Manager starts with discovery: the domains and services running on your site, which ones map to a known vendor, and which ones are unassigned. Unassigned is the list that should make you nervous.
- Make approval someone's actual job. Tag Management Admins and Security Admins approve or reject pending domains, and the portal shows the percent approved, pending, and rejected. A new vendor domain stops being something that just appears and becomes a decision somebody made.
- Build policies from approved domains only. You can't drag an unapproved domain into a policy. You can also create multiple named policies, which is how you keep checkout and account pages on a much tighter list than your blog.
- Test without breaking revenue. Start in monitoring mode. Violations get reported, nothing gets blocked, and Domain Whitelist Violation and CSP Violation notifications tell you exactly what would have broken. That's the step most homegrown CSP efforts skip, and it's why they get burned.
- Enforce, then keep watching. Flip to blocking once you're confident, and deploy as a meta tag, response header, or domain whitelist. The Domain Violation & Audit Log tracks violations and changes over time, so when an Optimizely-style loader tries to call a domain nobody approved, the browser blocks it and you get a violation report instead of a headline.
Worst case, you end up with a clean inventory of every third party on your site and who signed off on it. Best case, the next time a trusted vendor gets hijacked, the attack dies in your customers' browsers before it takes a single card number or wallet, and you hear about it from a violation report, not a reporter.

Your Monday morning list
- Pull the full list of third-party domains running on your site. If you can't do that in an afternoon, that's your answer.
- Give every vendor an owner and every new domain an approver.
- Get third-party tags off checkout, login, and any page where a customer can move money. Use your payment provider's hosted fields for card entry.
- Stand up a CSP in monitoring mode, and lock down connect-src, not just script-src.
- Mark cookies HttpOnly and stop keeping sensitive keys in browser storage where any script can read them.
- Move to enforcement and treat violations like uptime alerts.
The vendors on your site aren't the enemy. Most of them make the experience better, us included. But "trusted" isn't a security control. Approval is, and a CSP is how that approval gets enforced in the browser before anything bad can run. Optimizely's customers and Polymarket's traders found that out within three weeks of each other. You don't have to be next.
Sources
- Cybernews: 178 company websites infected with malware
- The Hacker News: Hijacked Optimizely scripts served card skimmers
- The Hacker News: Hackers steal about $2.7M from Polymarket traders via hijacked DebugBear script
- SecurityWeek: $2M+ drained from Polymarket traders in supply chain attack
- Blue Triangle help center: The CSP Manager
See every third-party domain on your site, and who approved it.
Nick Paladino
Seasoned professional turned podcast host with a diverse background in technology, product management, and a little bit of woodworking, I thrive on challenges and innovation. With a track record of driving results and optimizing conversion through a friction filled pursuit of frictionless experiences, I excel in leading teams, fostering valuable relationships, and unlocking successful products. My journey has been a blend of technical acumen and creativity while transforming passions into professions and friction into function.