Polymarket
Why it happened
Attack class: Supply chain / dependencyTrust in outside code on the front end.
What would have stopped it
- Pin vendor scripts to reviewed versions with integrity checks and a strict content security policy.
- Keep third-party scripts out of pages that request signatures.
What the score saw
Our pre-hack assessment of Polymarket already rated operational security as its weakest area after the May wallet compromise, but it measured key custody and alerting, not the outside scripts running on its website. Its supply-chain review looked only at smart-contract dependencies, so this attack surface was missed.
Score dimensions
- Supply chainmissed
- Operational securitypartly flagged
- Adversarial resiliencepartly flagged
An attacker compromised a third-party vendor script on Polymarket's website, and the tampered code tricked high-value users into signing transfers of their pUSD balances to attacker wallets. About 3.1 million dollars was taken from 11 accounts on Polygon, according to AMLBot. Polymarket's smart contracts and other users' funds were not affected, and Polymarket said it removed the vendor code and refunded affected users in full. The stolen funds were bridged to Ethereum, swapped to about 1,893 ETH, and later split across about a dozen new wallets.
A compromised vendor script on Polymarket's website got victims to sign transfers that Polymarket's own relayer executed, starting with 446,539 pUSD to an attacker wallet; the proceeds were bridged to Ethereum and gathered as 1,892.9 ETH in a consolidation wallet.
Attack flow
All 5 on-chain stepsThe attack in 4 steps. Step 1, Root control: Victim deposit wallets (source). Step 2, Relayed theft: Attacker wallet 1 (attacker), Attacker wallet 2 (attacker), Attacker wallet 3 (attacker), Other attacker wallets (attacker), about $1.89M reached this step. Step 3, Swap & bridge: Relay bridge (bridge), about $3.1M reached this step. Step 4, Consolidation: Consolidation wallet (exit).
Step 1: Root control
- SourceVictim deposit wallets11 accounts on Polygon~ $3.1M pUSD0xd88139ef...15af24
Step 2: Relayed theft
- AttackerAttacker wallet 1446,539 pUSDfirst theft 05:51 UTC0x51Cf7822...f9c5Ca
- AttackerAttacker wallet 2538,064 pUSDthree victims0xC771A30a...cBaAe2
- AttackerAttacker wallet 3227,468 pUSDtwo victims0x7BCECe0d...aA75A6
- AttackerOther attacker walletsrest of the 11 victims~ $1.9M
Step 3: Swap & bridge
- BridgeRelay bridgepUSD to USDC.e to Ethereumswapped to ether0x4cD00E38...38BC31
Step 4: Consolidation
- ExitConsolidation wallet1,892.9 ETH in1,788.5 ETH moved on, split July 190xe65b1C58...71E1eD
Why each step worked
- Compromised vendor scriptoutside JavaScript ran inside polymarket.com
- Valid user signaturesvictims approved transfers the page asked for
- Relayer executes any valid signature0x00000000000Fb5C9ADea0298D729A0CB3823Cc07
- No check on large transfers to new addressesmissing controlwhole balances left in one request
- No script integrity controlmissing controlno pinned version or integrity check on the vendor file
- Late public detectionmissing controlstatement came about nine hours after the first theft
Full forensic detail
Step-by-step reconstruction, root cause, counterfactuals, remediation, and disclosure timeline.
Exploit anatomy
Root cause
The root cause was trust in outside code on the front end. Polymarket's website loaded JavaScript from a third-party vendor, and that vendor's code was compromised and replaced with a drainer aimed at Polymarket users. Because the file ran inside Polymarket's own page, its signing prompts looked like they came from Polymarket. Victims signed authorizations that sent their pUSD to attacker wallets, and Polymarket's gasless relayer executed those requests through the Deposit Wallet Factory exactly as it would a real user request. No smart contract was broken and no key was stolen: every transfer carried a valid user signature. What failed was the integrity of the website itself, with no pinned version or integrity check on the vendor file, plus a relayer that applied no policy check to large transfers to never-seen addresses. Polymarket says it detected the problem, removed the dependency and refunded affected users in full. On-chain, the proceeds were bridged from Polygon to Ethereum and consolidated as 1,892.9 ETH, matching the roughly 3.1 million dollar loss that AMLBot and PeckShield reported.
Prevention analysis
A swapped vendor file would have failed its integrity check and never run, and a tight policy on where scripts can load from would have blocked a nested library from a new source.
Marketing and analytics tags do not need to run where users approve transfers. Sandboxing them away from the trading and signing pages removes their ability to prompt for signatures at all.
A hold or second confirmation on transfers of a whole balance to a never-seen address would have stopped or slowed the largest thefts, which each moved hundreds of thousands of dollars in one request.
Similar incidents
Users were sent to a tampered front end and tricked into signing approvals that drained their wallets. The contracts were never touched; the trusted web surface was.
A widely used front-end library was replaced with a drainer, and every dApp that loaded it showed malicious signing prompts. Same class: third-party JavaScript running inside a trusted site.
Injected JavaScript in a signing interface made a malicious transaction look legitimate, and valid signatures did the rest. Same lesson: the front end is part of the security boundary.
Remediation
Timeline
Get your protocol scored across 12 dimensions, or request ongoing coverage.