What happened

On October 29, 2026, Polymarket paused its international platform after users reported their positions being sold and funds moved without their consent. The cause was a third-party script. Polymarket loaded a real-user-monitoring (RUM) script from DebugBear, a website performance vendor. The file served at cdn.debugbear.com/C7xcKKrjUnXK.js had been replaced with code written to drain Polymarket accounts.

Key facts so far:

  • Analytics firms cited by CNBC say at least $2.7 million was taken across about 710 wallets. Other on-chain counts put the attacker's haul at about $2.6 million. No final figure has been published.
  • Users who signed in with email, using an embedded Magic wallet, were drained without seeing any signing prompt. Users with external wallets such as MetaMask were shown a signature request for a token transfer.
  • The vendor's CDN reported the malicious file as last modified on October 27. That may mean it was in place for two days, but it is not confirmed that it was served to visitors before October 29.
  • Polymarket removed the script, resumed trading about an hour after the pause, and says it is fully reimbursing affected traders.
  • Polymarket referred the incident to law enforcement. CNBC and Reuters report the referral went to UK authorities, where DebugBear is based.
  • DebugBear confirmed a security incident and told all RUM customers to remove its embed code. It has not published a root cause.

No smart contract was exploited. The exchange, the order book and the token contracts all worked as designed. What failed was trust in code loaded from someone else's server.

Why an analytics script had that much power

A browser does not separate scripts that run in the same page. A script tag for analytics, chat or performance monitoring runs with the same privileges as the site's own code. It can read local storage, see the page's state and call any function the page can call.

On Polymarket, that page also held a live trading client and, for email users, a wallet that can sign without asking. Researchers who analysed the file found it:

  1. Read Polymarket session data from the browser's local storage.
  2. Searched the page for the live order-book client.
  3. Looked up the user's positions and balances.
  4. Sold positions or transferred tokens to the attacker, depending on how the user had signed in.
  5. Reported results to data.debugbear.com, so the traffic looked like normal vendor telemetry.

A performance script needs none of those capabilities. It had them anyway.

Your vendors are your supply chain

Every external script is code you run but do not control. If the vendor's build system, CDN or account is compromised, the attacker's code runs on your site under your domain, with your users' trust. Your own code can be perfect and still ship malware.

For crypto platforms the stakes are higher than usual. A compromised script on a news site steals clicks. On a trading or wallet page, it can move money.

What site owners can do

  • Inventory every third-party script on pages where users log in, sign or trade. Include anything injected through a tag manager.
  • Keep non-essential scripts off sensitive pages entirely. Analytics rarely needs to run where a signing session lives.
  • Self-host vendor scripts, or pin them to a fixed version, so a change on the vendor's side cannot silently change your site.
  • Use Subresource Integrity (SRI) on every external script. The browser checks the file against a hash you set and refuses to run it if the content changes. A tampered file breaks instead of running. SRI only works with fixed files, which is another reason to pin or self-host.
  • Use a strict Content Security Policy (CSP) that limits where scripts can load from and where data can be sent. Note its limit: here the stolen data went to the vendor's own domain, which a RUM integration would normally allow. CSP narrows the blast radius. It does not stop a trusted domain from turning hostile.
  • Isolate what you cannot remove. A sandboxed iframe or a separate origin keeps a third-party script away from your session and signing objects.
  • Add friction for high-risk actions from embedded wallets, such as selling an entire portfolio or sending the full balance to a new address.
  • Monitor for unexpected changes in third-party script content, and have a kill switch ready.

What users can do

  • Treat embedded and email-login wallets like a hot wallet. Keep only what you are actively trading there.
  • Read every signature request. If the site asks you to sign a transfer you did not start, reject it.
  • When a platform reports an incident, close all open tabs and reload before using it again. A fix only reaches a fresh page load.
  • Keep long-term holdings in a separate wallet, ideally a hardware wallet, that never connects to trading sites.
  • Ignore DMs, emails and links offering refunds or claims after an incident. Use only the platform's official channels.

The takeaway

The most dangerous code on a crypto site is often not the site's own. Any script you load is part of your attack surface, and your users' funds depend on your vendors' security as much as yours.