Toutes les vulnérabilités
CRITICALWeb3exploited in the wildcurated

WEB3-LEDGER-CONNECT-KIT-2023

Web3 · Ethereum · Ledger Connect Kit

Résumé

On 14 December 2023, hundreds of popular crypto websites, including SushiSwap and Zapper, suddenly started trying to empty their visitors' wallets, all at once, and none of them had been hacked directly. The poison was in a shared ingredient: Ledger's Connect Kit, a tiny library that thousands of decentralized apps load to let users connect their wallets. An attacker who phished a former Ledger employee published a malicious version, and because most of those apps loaded the library live from a CDN rather than a pinned copy, the bad code reached every visitor within minutes. It is the lesson that loading code live from a third party means inheriting that third party's worst day, instantly and everywhere.

How it happened

It started with phishing and a forgotten offboarding. The attacker phished a former Ledger employee whose npm publishing access had never been revoked when they left the company, stealing an active session token that let them bypass 2FA entirely. With that access, they published malicious versions (1.1.5 through 1.1.7) of @ledgerhq/connect-kit, replacing the library's normal code with a wallet drainer: the off-the-shelf "Angel Drainer" malware-as-a-service kit, which split stolen funds 85% to the attacker and 15% to the kit's operators. The first two versions pulled the drainer from a secondary malicious npm package; the third embedded it directly.

The amplifier was how the library is loaded. Thousands of decentralized apps pull Connect Kit dynamically through a CDN <script> tag rather than bundling a pinned copy. So the poisoned version was served automatically to every visitor of every affected site, with no action by the site owners, injecting a fake wallet-connection popup that prompted users to sign transactions that drained their assets. One compromised dependency hit hundreds of front ends simultaneously: a supply-chain attack with an enormous reach.

The damage and response

The malicious code was live for roughly five hours, with active draining under two of those, and Ledger shipped a clean version about forty minutes after being notified. Around $600,000 was stolen, a small figure given the reach, kept low only by the short window and fast response; with hundreds of major DeFi front ends (SushiSwap, Zapper, Balancer, Revoke.cash, Kyber, and more) serving the drainer at once, it could have been catastrophic. Tether froze the attacker's stolen USDT, and Ledger committed to reimbursing affected users.

Why Ledger Connect Kit still matters

It teaches two lessons. First, the cost of loading code live from a third party: when you pull a library straight from a CDN at run time, you ship whatever they ship, including a compromise, to all your users at once, so pin versions, self-host, or lock assets with Subresource Integrity (SRI). Second, offboarding hygiene: a departed employee's publishing access should be revoked the day they leave (and their live sessions killed, not just their password), because here it was the entire foothold. And on the user side, clear-signing and transaction simulation matter, so a fake "approve" prompt reveals its true, malicious destination before anyone signs. It is the same drainer-through-the-supply-chain pattern as the Solana web3.js compromise a year later.

Comment le corriger

  • Pull the malicious package versions, publish a clean release, and tell downstream apps to update or pin immediately.
  • Revoke the compromised npm account and every other access the departed employee retained, kill live sessions, and rotate all publish tokens.
  • Reimburse and warn affected users, and work with chain analytics to flag the drainer's destination addresses.

Comment l’éviter

  • Pin exact dependency versions and self-host or SRI-lock CDN-loaded libraries instead of trusting floating CDN script tags.
  • Require signed, provenance-verified npm releases and enable npm 2FA plus publish protections on all maintainer accounts.
  • Revoke npm, registry, and session-token access immediately at employee offboarding and rotate credentials.
  • Enforce clear-signing and transaction simulation so users see real recipients and amounts before approving.
  • Monitor published package versions and CDN assets for unexpected releases or content changes.

Références

Vulnérabilités liées

Tout Web3 →