Writing · public incident

Polymarket: a vendor script changed at the same URL

$2.73M left 737 accounts in about an hour. The script tag in Polymarket's HTML never changed.

Summary

  • On 2026-10-29 the real-user-monitoring script that polymarket.com loaded from DebugBear was replaced on the vendor's side. The URL in Polymarket's pages stayed the same.
  • The replacement used logged-in sessions to sell positions and move funds. Bitquery counts $2.73M from 737 accounts between 17:10 and 18:10 UTC. Polymarket returned $3.9M in total: the $2.7M taken plus $1.2M for losses during the trading pause.
  • Polymarket's Content Security Policy allowed every request the script made, because each one went to an origin the real product also used.
  • A hash baseline of third-party scripts would show the vendor file going from 60,493 to 15,187 bytes at an unchanged URL.

Timeline, UTC

  1. First withdrawalson-chain
  2. Main wave of withdrawals beginson-chain
  3. Polymarket reports unauthorized activity on user walletsprimary
  4. A trader warns publicly on Xmediaunverified
  5. Polymarket ships a build that removes the vendor scriptsecurity-firm
  6. Last withdrawal of the main waveon-chain
  7. Polymarket says the issue is identified and fixedprimary
  8. Polymarket's relayer is back onlineon-chain

What would have shown up first

JS-09

Script-hash baseline differs from the last recorded bytes

Only if the vendor served the changed file to our scanner as well as to users. Comparing it continuously is the Monitor pilot.

What happened

Polymarket used DebugBear for real-user monitoring. A small inline loader in each page added cdn.debugbear.com/C7xcKKrjUnXK.js. On 29 October someone got into DebugBear’s domain registrar account and served their own file at that address. DebugBear says the attacker’s file was served for about two hours.

Neither company names the other. Polymarket’s post-mortem refers to “a third-party vendor whose performance-monitoring script loaded on polymarket.com”, and DebugBear to “at least one DebugBear customer website”. We name DebugBear because of Report URI, which recovered the file and matched it byte for byte to what Polymarket served.

The attacker replaced the script with one built to target Polymarket users.

Polymarket, post-mortem on its status page

The genuine file is 60,493 bytes of monitoring code. The replacement was 15,187 bytes and measured nothing. It ran inside the page, with the session the user already had open. Report URI describes two paths. Accounts that logged in with email had their positions sold with fill-and-kill orders: first at 97% of the price, then at 50%, then at the minimum tick. Accounts with a self-custody wallet had their outcome tokens moved in one batch transfer. The cash went out through Polymarket’s own relayer.

Bitquery found no broken contract. Every drain was a normal withdrawal with a valid approval. By the time a trader warned on X at 17:45 UTC, 48% of the money was already gone. Polymarket’s post-mortem says the script “used their active session to sell positions and move funds out of their wallet”. It does not say whether anyone saw a wallet prompt.

Why the CSP let it through

Polymarket enforced a Content Security Policy. Report URI pulled it from an archived copy of the homepage taken that morning. script-src-elem allowed cdn.debugbear.com, which the product needs. connect-src allowed data.debugbear.com, *.polymarket.com, *.alchemy.com and *.fun.xyz. Every request the drainer made went to one of those. It even reported each victim’s portfolio to data.debugbear.com/metrics/submit, an endpoint the real product calls anyway.

The policy checked where the code came from and where it sent data. Both answers were hosts Polymarket had approved.

What a script-hash baseline would have shown

The vendor file went from 60,493 to 15,187 bytes behind the same URL. Each frontcanary scan records a SHA-256 baseline of the third-party scripts a page loads (JS-09). The next scan compared against it would show the change. Comparing it continuously is the Monitor pilot. The baseline shows the swap only if the vendor served the changed file to our scanner as well as to users.

What helps

Polymarket’s post-mortem lists what it is doing: “Redeploying third party scripts with additional integrity controls and continuous monitoring and verification (some examples include stronger CSP, explicit version pinning, sandboxing, etc)”. The four below are our recommendations for any team that loads a vendor script on a page with a live session.

Pin the vendor file with SRI

Subresource Integrity makes the browser refuse a script whose bytes don’t match a hash you set. Polymarket’s loader built the script element in JavaScript, so adding it would have taken one integrity property and one crossorigin property. The cost is upkeep: a monitoring vendor ships updates, and every update breaks a pinned hash until you change it. After the incident DebugBear added integrity checks to its RUM script.

Serve the vendor file from your own build

If the bytes come out of your build and your origin, a takeover of the vendor’s domain no longer reaches your users. You take on updating the file yourself.

Keep monitoring scripts away from the session

A performance script needs timings and nothing from the trading client. Load it in a sandboxed iframe on another origin. From there it cannot read the page’s storage or reach React state.

Count vendor endpoints as attack surface

connect-src stopped nothing here, because the drainer used origins the app already trusted. Every vendor origin in that list is a place a swapped script can send data. On pages that hold a trading session, keep only the ones that page needs.

Sources

  1. Polymarket, post-mortem on its status page
  2. Bitquery, on-chain investigation of the withdrawals
  3. DebugBear, October 2026 security incident
  4. Report URI, analysis of the script and Polymarket's CSP

Request a free private scan

Passive checks on public data only. The full report goes only to a verified owner of the domain.