@lottiefiles/lottie-player 2.0.5, 2.0.6 and 2.0.7 on npm showed a Connect Wallet prompt to site visitors on 30 October 2024.
Cycode reports about 100,000 weekly downloads for the package. Sites that loaded it from a CDN with the latest tag served the bad code to their visitors.
What happened
An attacker published three malicious releases straight to npm, with no GitHub release or code review.
- LottieFiles states that the attacker phished an employee's npm account. Snyk and Cycode describe a stolen or exposed npm token.
- Cycode lists the publish times as 20:12 GMT (2.0.5), 20:35 GMT (2.0.6) and 21:57 GMT (2.0.7).
- The added code showed a wallet connection menu with MetaMask, WalletConnect and Phantom as the options.
- It included Ethereum functions to run transactions. LottieFiles calls it a Bitcoin drainer.
- Developers who installed a bad version through npm and visitors to sites that loaded the package from unpkg, jsDelivr or a similar CDN were exposed.
Someone opened a public issue about the bad versions about four hours after the first one.
Affected versions
@lottiefiles/lottie-player2.0.5, 2.0.6 and 2.0.7. npm removed them.- Safe: 2.0.4 and earlier, and 2.0.8 and later (Snyk).
Indicators of compromise
- Package name and versions above in a lockfile, an npm cache or a CDN URL.
- A "Connect Wallet" menu on a page that only plays Lottie animations.
- CDN links to
unpkg.comorcdn.jsdelivr.netfor@lottiefiles/lottie-playerthat use@latestor no version. - Snyk vulnerability ID
SNYK-JS-LOTTIEFILESLOTTIEPLAYER-8310516.
How to check
Find the installed version in each project.
npm ls @lottiefiles/lottie-player
Search your source and templates for unpinned CDN links. A link with no version number possibly served the bad code on 30 and 31 October 2024.
grep -rn "lottie-player" --include=*.html --include=*.js --include=*.json . | grep -v node_modules
What to do now
- Upgrade to 2.0.8 or later, or go back to 2.0.4. Clear the npm cache and rebuild.
- Pin the version in every CDN link. Do not use
@latestin production. - If your site served a bad version, tell users who connected a wallet during the window to check their wallets.
- Publishers: protect npm accounts with strong two-factor sign-in and use npm provenance.
What Vigilance would show
These examples show an install hold and the corresponding owner report.
Example install message
Vigilance blocked `@lottiefiles/lottie-player` 2.0.5. This version is too new or changed in a way Vigilance must check first.
Example owner report
Bad update
@lottiefiles/lottie-player 2.0.5
An animation player gained code that popped up a wallet sign-in box and moved visitors' cryptocurrency out.
No security team? See who reads the alert.
Frequently asked questions
What did the malicious code do?
It tried to take funds from visitors who connected a wallet.
Was customer data taken from LottieFiles?
LottieFiles states that no customer data, infrastructure or other services were compromised.
Sources
Send this page to the person who looks after AI at your company.