One of the most downloaded XRP libraries on npm was backdoored to steal private keys — and most developers didn’t see it coming.
Ripple’s `xrpl.js` library was compromised in a sophisticated supply chain attack that inserted a malicious function to exfiltrate crypto wallet secrets to an external domain.
What happened:
- The backdoor was added in npm versions 4.2.1 through 4.2.4 and 2.14.2
- Malicious code was introduced via a compromised Ripple developer’s npm account
- The attacker used a function called `checkValidityOfSeed` to quietly steal private keys
- The GitHub repo was untouched — only the npm package was altered
- Updated safe versions: 4.2.5 and 2.14.3 
With nearly 3 million total downloads and 135K+ weekly users, this was a high-value target — and a clear reminder of just how fragile open-source dependencies can be in the Web3 ecosystem.
Security reminders for devs working in crypto or blockchain:
- Rotate secrets if you used affected versions
- Always lock package versions in production
- Set up alerts for unusual package versioning behavior
- Use 2FA and scoped tokens on npm accounts
- Treat libraries like any other third-party threat surface
This wasn’t a bug. It was a breach — inside the supply chain. And it could have quietly drained wallets at scale.
In Web3, your dependencies are your perimeter.