osec.one case analysis cover: LottieFiles 2024, a compromised npm token, unpinned CDN script tags and a wallet drainer

On 30 October 2024, attackers took over an npm publishing token for @lottiefiles/lottie-player—an animation library with roughly 94,000 weekly downloads—and pushed three poisoned releases (2.0.5, 2.0.6, and 2.0.7) in under two hours. Sites that loaded the script from public CDNs without a locked version or integrity hash started serving a crypto wallet drainer to visitors the same evening.

Attack flow: phishing email from notify.npmjs@pm.me captures maintainer token, versions 2.0.5 to 2.0.7 pushed to npm, unpinned CDN script tags serve Ace Drainer to live sites, 10 BTC stolen, clean 2.0.8 shipped

Timeline: two hours from stolen token to live sites

• March 2024: @lottiefiles/lottie-player 2.0.4 ships as the last clean release before the October incident.
• 30 October 2024 (before 20:12 UTC): a maintainer (Aidosmf) receives a phishing email from notify.npmjs@pm.me inviting them to collaborate on @lottiefiles/jlottie. Signing in hands over an active npm publishing token.
• 30 October 2024, 20:12 UTC: the attacker publishes version 2.0.5 directly to npm.
• 30 October 2024, 20:35 UTC: version 2.0.6 is pushed.
• 30 October 2024, 21:57 UTC: version 2.0.7 is pushed—three malicious builds in 1 hour and 45 minutes.
• 30–31 October 2024: sites using unpinned CDN links (such as unpkg.com/@lottiefiles/lottie-player@latest or cdn.jsdelivr.net/npm/@lottiefiles/lottie-player@2/...) automatically pull the new code. Web3 sites including 1inch and hundreds of other front ends display fake wallet-connection prompts.
• 31 October 2024: Blockaid and developers flag the pop-ups. LottieFiles, Exaforce, and npm revoke the token, remove 2.0.5–2.0.7 from the registry, and publish clean version 2.0.8 built from 2.0.4.

Which versions were affected—and what the payload did

Package / VersionStatusPublish window (UTC)What visitors saw
@lottiefiles/lottie-player@2.0.4CleanMarch 2024Normal Lottie animation playback
@lottiefiles/lottie-player@2.0.5Malicious30 Oct 2024, 20:12Injected Ace Drainer wallet-connect modal
@lottiefiles/lottie-player@2.0.6Malicious30 Oct 2024, 20:35Updated Ace Drainer payload
@lottiefiles/lottie-player@2.0.7Malicious30 Oct 2024, 21:57Final malicious iteration before takedown
@lottiefiles/lottie-player@2.0.8Clean31 Oct 2024Rebuilt strictly from clean 2.0.4 source
@lottiefiles/dotlottie-player & SaaSUnaffected—Separate package; not touched by the token

The injected code came from the Ace Drainer (Drainer-as-a-Service) toolkit. On any page that loaded the script, it popped up realistic connection modals for MetaMask, WalletConnect, Coinbase Wallet, Phantom, and Exodus. When a visitor approved the prompt, the script requested token approvals or transfers to attacker wallets. Security firm Scam Sniffer traced at least one loss of 10 BTC (roughly $723,000 USD) to the campaign.

Why unpinned CDN script tags turned an npm breach into a live website attack

An attacker who compromises an npm package usually has to wait for developers to run npm update and redeploy. Public npm-backed CDNs skip that wait. When a site embeds @latest or a major-version path without a Subresource Integrity (SRI) hash, the CDN serves the newest npm release to every visitor's browser automatically—the same client-side risk seen in the Polyfill.io supply chain attack and the Bybit 2025 JavaScript tampering incident.

Script tag patternWhat happened on 30 Oct 2024Why
.../lottie-player@latest/dist/lottie-player.jsServed malware immediatelyNo pinned version and no SRI hash; CDN resolved @latest to 2.0.5–2.0.7
.../lottie-player@2/dist/lottie-player.min.jsServed malware immediatelyFloating major tag auto-resolved to the newest 2.x release
.../lottie-player@2.0.4/... without integrityClean unless cache/CDN changedVersion pinned, but browser still trusts any file the CDN returns at that path
.../lottie-player@2.0.4/... with integrity="sha384-..." and crossorigin="anonymous"ProtectedBrowser verifies the SHA-384 hash before executing; any altered file is blocked

Five controls that break this chain

Weak pointControlHow to apply it
Unpinned third-party script tagsPin exact versions and add Subresource Integrity (SRI)Audit your live pages with the osec SRI check; it flags floating CDN URLs and outputs ready-to-paste integrity="sha384-..." attributes
Any external script can talk to arbitrary domainsLock down Content Security Policy (CSP)Restrict script-src and connect-src to known hosts and monitor violations with osec CSP Reports
Long-lived npm publish tokensRequire npm provenance and short-lived OIDC tokensPublish from CI with --provenance instead of keeping static tokens on developer laptops
Phishing emails spoofing npm notificationsUse phishing-resistant MFA (FIDO2 / WebAuthn)Hardware security keys refuse to sign into lookalike domains even if a maintainer clicks a convincing link
Surprise dependency bumps in CIUse lockfiles (npm ci) and a release cooldownPin exact versions in package-lock.json and wait before auto-merging minor/patch updates

Quick check for your own site right now

• Search your HTML templates and bundle configs for unpkg.com, cdn.jsdelivr.net, or cdnjs URLs that use @latest or a single major version like @2.
• Run your production URL through the osec SRI check to see every external script and stylesheet without an integrity hash—and copy the exact sha384- tag to lock it down.
• If you ship npm packages yourself, audit maintainer tokens, turn on hardware-key 2FA, and switch publishing to CI with provenance enabled.
• Protecting user logins as well? Add passwordless OTP, Google, and Apple sign-in without managing OAuth keys on osec.one.

Sources

• Wiz Threat Research — Lottie-Player Supply Chain Attack (October 2024)
• Sonatype — Malicious @lottiefiles/lottie-player npm packages 2.0.5–2.0.7 analysis
• Blockaid — 1inch and Web3 dApp supply chain compromise alert (30 Oct 2024)
• Exaforce & LottieFiles — Post-incident analysis and 2.0.8 remediation notice
• Snyk — Malware in @lottiefiles/lottie-player npm package