Back to all lessons
Awareness Lessons
5 days ago

Malicious Scripts Served via Trusted CDN Steal Crypto and Card Data from 186 Sites

Written by AI from the linked story. Not reviewed by an editor. How this works

The OPTIMJACK campaign demonstrates how attackers exploit the implicit trust placed in third-party content delivery networks by injecting malicious JavaScript that is then served to end users as if it were legitimate content. Website operators loaded scripts through Optimizely's CDN without adequately verifying the integrity of what was being delivered, allowing a crypto clipper and card skimmer to silently harvest sensitive data. This matters because a single compromised or abused third-party script can instantly affect hundreds of sites and millions of users, with victims having no visible warning. The attack also shows adversaries chaining delivery mechanisms—using .icu domains for a second-stage mobile payload—to maximize reach and evade simple domain-based blocking.

Tactical Insight

Immediate actions

  • Audit all third-party scripts currently loaded on your site and verify their source URLs against expected, documented values
  • Implement Subresource Integrity (SRI) hashes on every externally hosted script tag so browsers reject tampered content
  • Review Content Security Policy (CSP) headers and restrict `script-src` to explicitly allowlisted origins only

Long-term improvements

  • Establish a formal third-party vendor review process that includes periodic re-evaluation of CDN and tag management providers
  • Maintain a living inventory of all external JavaScript dependencies and monitor them for unexpected changes
  • Adopt a client-side security monitoring solution that detects anomalous script behaviour or exfiltration attempts in real time

Detection measures

  • Deploy website integrity monitoring tools that alert on new or modified script tags appearing in page source
  • Monitor outbound network traffic from browsers (via CSP violation reports) for connections to unrecognised domains such as .icu or newly registered TLDs
  • Implement server-side logging of all CDN resource loads and alert on deviations from baseline script inventories

Back this up with a control

All controls and vendors

Training helps people spot this. These controls make the attack fail even on the day someone does not.