Back to Blog

#7 Trust Wallet Incident: A Stolen API Key Turns the Official Update Channel into a Backdoor

Code Auditing
February 12, 2026

On December 25, 2025, Trust Wallet suffered a critical security breach in its Chrome extension (v2.68), resulting in the theft of approximately $8.5 million in user funds.

The root cause was a malicious backdoor injected into the extension, originating from a supply chain attack that compromised the project’s standard release process. The injected backdoor method uploads user seed phrases to an attacker-controlled server, compromising any wallets generated or imported using this specific version of the extension. The attacker subsequently drained user funds on multiple chains and routed them to non-KYC exchanges.

Background

Trust Wallet‘s Chrome extension is designed as a typical self-custody wallet, allowing users to create or import existing wallets. At the heart of any cryptocurrency wallet is the seed phrase, also known as a mnemonic. It is a human-readable representation of the wallet's private key. This seed phrase can deterministically derive all private keys associated with the wallet, making it the most critical secret a user possesses. Anyone with access to a seed phrase gains complete control over all wallet funds.

To ensure seed phrases are safely self-custodied, Trust Wallet’s extension stores them locally in encrypted form using cryptography algorithms. They can only be decrypted upon a legitimate user request with proper authentication. This process requires users to authenticate with their biometric or password, depending on the method they configure. In a properly functioning self-custody wallet, decrypted seed phrases are used exclusively within the local extension environment and are never transmitted to external servers.

Vulnerability Analysis

The vulnerability originates from the wallet unlock flow, specifically via both biometric and password means. Upon an unlock operation, seed phrases are collected as analytics data and sent to an attacker-controlled domain masquerading as a legitimate endpoint. Since the exploit mechanism is identical for the two means, we will take the biometric pathway as an example to illustrate the vulnerability.

The following analysis and screenshots are based on the de-obfuscated source code.

Retrieval of decrypted seed phrases

The malicious code was injected into the unlock function in file 8423.js, which handles wallet unlocking and seed phrase decryption following user authentication. In the unlock logic, the attacker embedded a seemingly benign analytics collection mechanism. As highlighted in the following code snippet, the retrieval of seed phrases was placed immediately after the normal authentication flow. It traverses all wallets, extracting decrypted seed phrases and storing them in a deceptively named variable errorMessage . This data is then embedded within an error property in analytics event objects.

The same malicious pattern appears in the password unlock flow (lines 485-527), replacing biometric authentication with password-based decryption.

Transmission of sensitive data

Once the seed phrases were collected and packaged as analytics data, they were routed through a PostHog analytics infrastructure. The infrastructure was deliberately introduced by the attacker in v2.68 for data transmission. Through this pathway, analytics data containing seed phrases is sent to an analytics service wrapper, which invokes PostHog's capture() method to generate event objects. The events are queued and batched together, then serialized into JSON format. The JSON payload is compressed and transmitted via HTTP POST request to the attacker's server.

The file 4482.js reveals a PostHog configuration that routes analytics data to api.metrics-trustwallet.com. This domain was specifically registered by the attacker to mimic a legitimate Trust Wallet analytics endpoint.

Testing with extension v2.68, we captured and analyzed a suspicious request triggered during wallet unlock operations. The request sends GZIP-compressed data to the attacker-controlled endpoint, which can be decompressed to extract the seed phrases in plaintext.

Attack Analysis

The attack process spanned approximately one month from initial preparation to the final exploit, unfolding across three stages:

  1. Compromise the Chrome Web Store (CWS) API key

  2. Deploy the extension containing malicious code

  3. Steal funds from compromised user wallets

Stage 1: Compromise the CWS API key

The story started from a widespread supply chain attack in November, known as “Shai-Hulud 2.0” [2]. This campaign targeted developer environments through NPM (Node Package Manager), backdooring numerous legitimate NPM packages. When developers installed these compromised packages, malicious code executed on their systems to steal sensitive credentials and authentication tokens.

Through this supply chain attack, the attacker obtained Trust Wallet’s Chrome Web Store (CWS) API key. This key is particularly critical because it enabled direct uploading of extension builds to the Chrome Web Store, completely circumventing Trust Wallet's internal approvals and reviews under standard release process.

Stage 2: Release the extension with malicious code

On December 2025, with the stolen CWS API key in hand, the attacker implemented their attack infrastructure:

  1. Register the malicious domain metrics-trustwallet.com (and subdomain api.metrics-trustwallet.com) to host the data collection endpoint.

  2. Inject backdoor code into the wallet unlock flows and modified the PostHog analytics configuration to direct data to their server.

  3. Upload the malicious extension directly to the Chrome Web Store using the stolen API key, circumventing the standard release process.

The malicious version 2.68 successfully passed Chrome’s automatic review and was published to the store, appearing as a legitimate update from the official developer account.

Stage 3: Steal funds from compromised user wallets

When users unlocked their wallets using this vulnerable extension, their seed phrases were silently transmitted to api.metrics-trustwallet.com, the attacker-controlled server. With complete access to these seed phrases, the attackers gained full control over victim wallets.

Rather than immediately draining funds—which would have triggered rapid detection—the attackers exercised patience, allowing the victim pool to expand while maintaining stealth.

Starting December 25, the attacker initiated systematic fund extraction from compromised wallets. The operation impacted approximately 2,520 distinct wallet addresses spanning 10 distinct blockchains.

Summary

This breach serves as a stark reminder that security must encompass the entire protocol life cycle, including development and deployment. In 2025, supply chain attacks emerged as the most destructive threat to cryptocurrency infrastructure, with just two incidents (including the $1.5 billion Bybit hack in February) causing significant losses. Beyond smart contract audits, protocols must secure their build pipelines, protect developer credentials, and maintain continuous monitoring to safeguard user assets.

References

  1. Official post-mortem
  2. Shai-Hulud 2.0

About BlockSec

BlockSec is a full-stack blockchain security and crypto compliance provider. We build products and services that help customers to perform code audit (including smart contracts, blockchain and wallets), intercept attacks in real time, analyze incidents, trace illicit funds, and meet AML/CFT obligations, across the full lifecycle of protocols and platforms.

BlockSec has published multiple blockchain security papers in prestigious conferences, reported several zero-day attacks of DeFi applications, blocked multiple hacks to rescue more than 20 million dollars, and secured billions of cryptocurrencies.

Sign up for the latest updates
~$1.35M Lost: BarnBridge, DeFiTuna | BlockSec Weekly
Security Insights

~$1.35M Lost: BarnBridge, DeFiTuna | BlockSec Weekly

This weekly report covers 2 security incidents from July 13 to July 19, 2026, with approximately $1.35M in total losses on Ethereum and Solana. DeFiTuna, a Solana lending protocol, lost ~$570K because the position health check treated a zero-value position as healthy regardless of outstanding debt; the attacker used controlled swap routing and a separate low-liquidity pool to trigger this defect. BarnBridge lost ~$776K after an attacker exploited the protocol's deprecated but still-active governance system on Ethereum to pass a malicious proposal and drain user-approved USDC.

~$800K Lost: Hinkal Double-Spend | BlockSec Weekly
Security Insights

~$800K Lost: Hinkal Double-Spend | BlockSec Weekly

This weekly security report covers 1 notable incident from June 29 to July 5, 2026, with approximately $800K in total losses on Ethereum. The Hinkal shielded-pool protocol was drained through a double-spend attack that likely exploited a flaw in the legacy note format, allowing the attacker to derive multiple nullifiers from a single deposit. The report analyzes the probable circuit-level vulnerability, the attack flow, and broader implications for nullifier-based privacy protocols.

Newsletter - June 2026
Security Insights

Newsletter - June 2026

This monthly report covers the three largest security incidents in June 2026, totaling approximately $22M in confirmed losses. A sophisticated honeypot attack drained ~$15M from JaredFromSubway's MEV bot by exploiting unchecked token allowances. Two legacy Aztec rollup deployments lost ~$4.35M through proof-settlement boundary gaps. SecondFi's Ed25519 implementation flaw exposed wallet private keys, resulting in ~$2.4M drained from 374 wallets. All three incidents share a common pattern: security guarantees that appeared intact on the surface but were never actually enforced.

Best Security Auditor for Web3

Validate design, code, and business logic before launch. Aligned with the highest industry security standards.

BlockSec Audit