ProductAboutBlogContact
Get Started
May 7, 2025

Inside the XRPL.js Seed‑Theft Supply‑Chain Attack

Inside the XRPL.js Seed‑Theft Supply‑Chain Attack

‍

‍TLDR: A critical supply chain attack has compromised five versions of the popular JavaScript library xrpl.js, introducing a backdoor that silently exfiltrates private keys. Almanax flags this threat at both the code‑analysis and dependency‑scanning stages—helping teams detect malicious changes in real time and prevent wallet compromise.

Supply Chain Threats

‍Software supply chains have become a prime target for sophisticated attackers. As developers increasingly rely on third‑party packages, a single compromised dependency can jeopardize millions of users. The recent backdooring of Ripple’s xrpl.js library is a reminder even blockchain ecosystems aren’t immune.

‍

‍

Bug Breakdown

On April 21, 2025, unknown threat actors leveraged a hacked npm account belonging to a Ripple employee to publish malicious versions of xrpl.js. Five releases—2.14.2, 4.2.1, 4.2.2, 4.2.3, and 4.2.4—were found to include a nefarious function: checkValidityOfSeed, which intercepts users’ secret seeds and transmits them to an external domain (0x9c[.]xyz). 

The .xyz top-level domain (TLD) is extremely cheap and requires minimal verification to register, making it attractive for attackers who want disposable infrastructure: a common choice in illicit campaigns—typosquatting, spam, and backdoors.

‍The compromised code was specifically added to the file: /src/index.js where the malicious function checkValidityOfSeed sends sensitive data such as seeds, private keys, and mnemonics to the attacker’s server via an HTTP POST request, disguising itself as an ad referral request.

This Almanax scan shows the following vulnerability: 

The U.S. National Vulnerability Database (NVD) on NIST’s website assigned CVE‑2025‑32965 a CVSS 9.3 rating, underscoring its critical severity.

Almanax classifies the xrpl.js backdoor as a high‑severity issue and delivers concrete remediation guidance—flagging the malicious function and recommending a precise fix. By integrating Almanax directly into CI/CD pipelines and dependency‑monitoring processes, teams can catch poisoned releases in pull requests. 

If this issue had gone unnoticed longer, developers would unwittingly face the risk of silent seed theft—potentially draining millions of dollars—because the backdoor can easily slip past traditional CI checks.

And this isn’t an isolated incident. Recall the recent typosquatting of the BoltDB module in Go, where github.com/boltdb-go/bolt masqueraded as the legitimate boltdb/bolt, embedding a remote‑execution backdoor that persisted for years. Supply chain attacks span languages and ecosystems—and the XRPL.js breach proves npm is equally vulnerable.

Why Traditional Scanners Missed It

Conventional static-analysis engines focus on known CWE/CVE patterns. Their rulesets flag obvious sinks—SQL injection strings, hard-coded secrets, unsafe deserialization—but rarely treat a single new function that POSTs a seed to an unfamiliar domain as malicious.

Between 4.2.1 and 4.2.4 of xrpl.js, attackers inserted a 9-line helper checkValidityOfSeed() that exfiltrated private keys to https://0x9c.xyz. Five patch releases landed in under an hour, none mirrored in the public GitHub repo, diluting the signal across versions.

LLM‑powered tools like Almanax can spot these unusual code additions—flagging suspicious functions before they appear on the CVE list—stopping supply‑chain threats at pull‑request time. By ranking diffs semantically rather than matching static signatures, they surface a new network call inside cryptographic workflows as soon as it appears, even when the domain has no reputation history.

Almanax’s Layered Defense with LLM‑Powered Analysis

Almanax uses a multi‑stage approach to catch Supply Chain bugs, Malware and various security vulnerabilities:

  1. Code‑Level Auditing
    Our LLM engine reads JavaScript ASTs and flags suspicious new functions, like checkValidityOfSeed. Even subtle API misshapes or unexpected network calls trigger alerts.

  2. Dependency‑Chain Monitoring
    We are able to also scan package manifests for version drifts, typosquatting patterns, and account anomalies. In the case of xrpl.js, detecting that versions 4.2.1–4.2.4 deviated from prior release histories would have raised red flags.

  3. Remediation Guidance
    Once a compromise is detected, Almanax automatically suggests fixes that can be applied in the codebase.

The Path Forward for Software Security

As Web3 adoption grows, its frontends and toolchains increasingly mirror traditional Web2 applications—React or Vue‑based UIs, Node.js/Express backends, and npm/Yarn with Webpack or Vite builds—bringing the same dependency and supply chain risks. At Almanax, we expanded our LLM‑powered scan coverage to:

  • Cross‑Language Ecosystems: JavaScript, Go, Rust, Move and beyond—catching backdoors and logic flaws across the entire stack.

  • Behavioral Analysis: Profiling package behavior (network calls, cryptographic operations) to detect anomalies automatically.

  • Enterprise Integration: Plugging into existing security pipelines like GitHub Actions.

Our mission is to stop software hacks. By combining deep code understanding with sophisticated supply chain monitoring, Almanax ensures the next xrpl.js‑style backdoor doesn't slip through undetected.

Coding assistant tools like Cursor are changing the way engineers write code. We believe AI will change security the same way it’s changing software engineering.

An AI Security Engineer fixing your code issues

New York, New York

Quick Links
Product
About
Contact
Social

© 2025 Almanax

Privacy Policy
Terms of Service