A Third-Party Script Drained $2.5M From Polymarket

TL;DR: Prediction market Polymarket paused trading after a compromised third-party service injected malicious code. The script drained approximately $2.5 million from user wallets, highlighting the risks of relying on external dependencies for web applications.
Key facts
- Category
- Cybersecurity
- Impact
- Critical
- Published
- Source
- BleepingComputer
Full summary
A compromised third-party script drained $2.5 million from user wallets on Polymarket, forcing the prediction market to halt all trading.
Prediction market platform Polymarket was forced to halt trading after a sophisticated supply chain attack resulted in the theft of approximately $2.5 million from its users. According to reporting from BleepingComputer, the incident occurred when a third-party service used by the platform was compromised. Attackers leveraged this access to inject a malicious JavaScript file into Polymarket's website. This script, designed as a "crypto drainer," was then served to unsuspecting users, enabling the attackers to siphon funds directly from their connected cryptocurrency wallets. The platform acted quickly to suspend operations upon discovering the breach to prevent further losses while it investigated the source and extent of the compromise. The stolen assets were traced to a single wallet address controlled by the attackers, highlighting the speed and direct financial impact of this type of security failure. The event serves as a stark illustration of how vulnerabilities in the digital supply chain can have immediate and devastating consequences for a platform and its user base, even when the platform's own code remains secure. The reliance on external dependencies creates a shared-risk environment where the security posture of the weakest link can determine the security of the entire system.
The attack on Polymarket employed a classic web-based supply chain attack vector, a technique that has become increasingly common as websites grow more complex. This method does not target the primary application's servers or code directly. Instead, it focuses on compromising one of the many third-party services that a modern website relies on for functionality like analytics, customer support chat, advertising, or content delivery. Once the attackers gain control of the third-party service, they can modify the JavaScript files that the service provides. When a user visits the target website (in this case, Polymarket), their browser fetches and executes this now-malicious script. Because the script is loaded from a trusted domain, the browser runs it with the full permissions of the website itself. In this specific incident, the script was engineered to interact with users' web3 wallets, such as MetaMask, which were connected to the Polymarket platform. It likely initiated fraudulent transaction requests that, if approved by the user, would transfer their assets to the attacker's wallet. This technique is particularly insidious because it bypasses traditional server-side security measures and occurs entirely on the client-side, making it difficult to detect with standard monitoring tools.
While the targeting of cryptocurrency assets is a modern twist, the underlying attack pattern is well-established. This incident bears a strong resemblance to the Magecart attacks that have plagued the e-commerce industry for years. In those campaigns, attackers compromise third-party scripts on checkout pages to skim credit card information as customers enter it. The Polymarket hack demonstrates the evolution of this threat, adapting the same core strategy to the web3 ecosystem where the payload is not credit card data but direct control over digital assets. The broader trend is clear: as applications are increasingly assembled from a mosaic of external services and open-source libraries, their attack surface expands dramatically. Each dependency represents a potential point of failure and a target for attackers. Security teams can no longer afford to focus solely on their own infrastructure; they must also scrutinize the security practices of every vendor and library integrated into their product. This shift from a perimeter-based security model to one that acknowledges a distributed and often untrusted environment is one of the most significant challenges facing modern software development and cybersecurity. The incident underscores that even platforms in the supposedly decentralized world of web3 are still vulnerable to the centralized points of failure inherent in traditional web architecture.
For developers, CTOs, and security professionals, this attack serves as an urgent call to action to secure their frontend supply chain. A purely reactive stance is no longer sufficient. Proactive measures are essential to mitigate this risk. One of the most effective technical controls is Subresource Integrity (SRI), a security feature that allows browsers to verify that a fetched file has not been manipulated. By including a cryptographic hash of the expected script in the script tag, any modification by an attacker would cause a hash mismatch, and the browser would refuse to execute the script. Another critical tool is a robust Content Security Policy (CSP), which can be configured to whitelist specific, trusted domains from which scripts are allowed to be loaded, preventing the execution of unauthorized code. Beyond technical controls, organizations must implement rigorous vendor security assessment processes, treating third-party code with the same skepticism as internal code. As Polymarket conducts its post-mortem, the detailed findings will offer valuable lessons for the industry. In the meantime, every team should use this event as a catalyst to audit their own dependencies, implement stronger controls, and prepare for a threat landscape where any third-party integration could become the next entry point for a major breach.
Why it matters
This incident is a critical reminder for developers and security teams that any third-party script is a potential attack vector. A compromise in one external service can lead to a full breach of your application, bypassing your own security measures to directly steal user funds and data.
Business impact
The $2.5 million theft and resulting trading halt demonstrate the severe financial and operational risks of supply chain attacks. For businesses, this highlights the need for rigorous third-party vendor security vetting and incident response plans to mitigate reputational damage and protect customer assets.
⚡ Action needed
Teams should review their third-party script dependencies and security policies to prevent similar supply chain attacks.
Action checklist
- 1Audit all third-party scripts and dependencies loaded on your frontend.
- 2Implement Subresource Integrity (SRI) to block execution of modified scripts.
- 3Deploy a strict Content Security Policy (CSP) to whitelist trusted script sources.
- 4Review the security practices and incident response plans of all third-party vendors.
Related on Notifire
Related stories
Primary source: BleepingComputer