CyberSecurityNews

Malicious npm Campaign Steals SSH Keys, API Tokens, Cloud Credentials, and Wallet Secrets


A fresh wave of supply chain attacks is putting blockchain developers, Web3 teams, and cloud engineers at serious risk.

Researchers have uncovered a coordinated campaign involving multiple malicious packages on the npm registry, each designed to quietly steal sensitive secrets the moment a developer installs them.

From SSH private keys to cloud credentials, wallet phrases to API tokens, this campaign leaves almost no secret untouched.

What makes this effort particularly alarming is its scale. One package at the center of the investigation, moralis-sdk, had accumulated more than 2.7 million downloads by the time researchers flagged it.

That reach means the malicious code may have already touched thousands of developer workstations, CI/CD pipelines, and cloud environments without anyone realizing it.

Analysts at Cyfirma identified the campaign after spotting two suspicious packages, ethers-jss and coinbase-wallet-utils, both built to impersonate legitimate Ethereum development tools.

Through deeper investigation, they linked eleven highly suspicious npm packages to the same operation, as the researchers at Cyfirma said in a report shared with Cyber Security News (CSN).

The packages were not all built the same way. Cyfirma’s research revealed four distinct operational clusters, each targeting developers through a different method.

System Reconnaissance & Data Exfiltration (Source – Cyfirma)

Some abused npm lifecycle hooks to auto-execute malicious code during install, while others relied on obfuscated loaders and Ethereum smart contracts to retrieve command-and-control addresses without hard-coding anything obvious.

Together, these packages recorded more than 2.72 million combined downloads, making this one of the more impactful npm supply chain campaigns seen recently.

Active download activity during the investigation confirmed that several packages were still reaching new victims even after discovery.

Malicious npm Campaign

The infection method was deceptively simple. Each package used npm lifecycle scripts, either preinstall or postinstall hooks, to trigger malicious code the moment a developer ran an install command. No extra steps were needed on the victim’s side.

The ethers-jss package acted as a malicious wrapper around the real ethers library. Once installed, it intercepted wallet creation and recovery functions to capture private keys and mnemonic phrases, sending them to an attacker-controlled server on GitHub Codespaces.

It also included a Python script named docker_hunter.py, which performed OSINT-style lookups on Docker Hub repositories tied to blockchain tools.

Command-and-Control (C2) Configuration (Source - Cyfirma)
Command-and-Control (C2) Configuration (Source – Cyfirma)

The coinbase-wallet-utils package focused on reconnaissance, collecting the victim’s hostname, username, environment variables, and working directory, then exfiltrating everything silently using curl.

A separate cluster of five packages published by the npm user ethcompat went further, encrypting stolen credentials with AES-256-GCM and embedding them inside Ethereum blockchain transactions sent to an attacker-controlled wallet, turning the victim’s own wallet into the exfiltration channel.

The moralis-sdk package was particularly crafty. It started as a clean copy of the legitimate Moralis SDK in October 2025, then was weaponized through an update that added a heavily obfuscated postinstall.js file.

That file used a YouTube page as a remote activation switch and only delivered its payload if a hidden marker was found, giving the attacker remote control over when the malware activated.

Blockchain Infrastructure and Attribution Clues

Three typosquatting packages, ganach, solidty, and stelar-sdk, added another layer of innovation. Instead of hard-coding a server address, these packages queried an Ethereum smart contract to retrieve infrastructure details dynamically.

The malware then downloaded platform-specific binaries for Windows, Linux, or macOS depending on the victim’s system.

Researchers also found several attribution hints. The accounts used to publish the packages had randomly generated names, a common tactic to avoid being traced.

Deobfuscated code contained Russian-language comments and variable names, pointing to a financially motivated actor with experience in cryptocurrency-related cybercrime, though no specific group was formally named.

Cryptocurrency Wallet Hijacking Logic (Source - Cyfirma)
Cryptocurrency Wallet Hijacking Logic (Source – Cyfirma)

Cyfirma recommends running installs with the flag npm install –ignore-scripts to block automatic script execution.

Organizations should also deploy Software Composition Analysis tools, avoid storing private keys or seed phrases in plaintext, and rotate any exposed credentials immediately.

Developers in Web3 environments should verify publisher identity, download history, and repository ownership before adding any unfamiliar package to their project.

Indicators of Compromise (IoCs):-

#TypeIndicatorDescription
1SHA153b91117db931d3acbbfd15aa8400bb6691e023dethers-jss package archive
2SHA256d94a2444268b339dfda2615f7800322fb318e0a484414bb17016cfcd5eb07c44ethers-jss package archive
3SHA163154cd9c79f9d14eb9be6c4efc2a778d31646eccoinbase-wallet-utils package archive
4SHA2566585ca0d3e26c20ced638f46f4a89eea924d411b8753d3fcf434663593c7cf0bcoinbase-wallet-utils package archive
5SHA174d3d5ab6d0fa4c6a5860598231728a6a893ecf7moralis-sdk v1.0.1 package archive
6SHA25617bad5ae5b2ac262f5f18854853869840245c344105aa38c7f550ef51d2e5f26moralis-sdk v1.0.1 package archive
7SHA1fcc8a542aad41e758cf6c18571048890be53808eganach package archive
8SHA2567269c00a6164fd01dd516e0a72b2bd84c82e78feb552e06964e4992ff0479ddaganach package archive
9SHA170842cfc27b116d0db2fd7aa33d53a3faf510993solidty package archive
10SHA256e848d73a68e4e8aea00a6257552b5872907dfaf7cce3d94636d7e59d286edeabsolidty package archive
11SHA1e1bdcd1a7157f7d047a88ab4573723fe1e861951stelar-sdk package archive
12SHA2562fa5b0475c3b70a3ba14c6a3938baf441a08b11841493b85e087d1d5e01eba49stelar-sdk package archive
13SHA256d6abc7003b580472d808b338adef0b28eacc698cd4692f76cb2a91718ab78d88hardhat-deploy-utils package archive
14SHA256bab96257018df49ace8fe8adfadc74cf8327fcf9a9dc8a3a7c9ac8e18881df5fweb3-deploy-helper package archive
15SHA256d7ec660a2a29c1aabcbe9bff1ef29be9a9fab8c7fe7c40df4772dd2b5bdf9666defi-sdk-core package archive
16SHA2565c50f79038b31aa8a3a68b24d8b783dfbd2e15fff7586c5609e544a717ef7d05ethers-compat package archive
17SHA256feabf10c8a9ba2775bb0f7f9d0b20203112b7df8e6d333a44d5a11eae0e38e86ethereum-dev-utils package archive
18URLpastefy.app/RhPBKGli/rawBase64-encoded PowerShell payload hosting location
19IP:Port193[.]233[.]201[.]21:3001Remote payload distribution server retrieved via blockchain mechanism
20Ethereum Smart Contract0xa1b40044EBc2794f207D45143Bd82a1B86156c6bUsed by malware to retrieve dynamic infrastructure information
21Ethereum Wallet Address0x52221c293a21D8CA7AFD01Ac6bFAC7175D590A84Queried by the smart contract lookup mechanism to obtain C2 configuration
22Ethereum Wallet Address0xCBbecC5E5Eb88582e6305cF6ab688f03e02Ce16fAttacker-controlled wallet used to receive exfiltrated credential transactions

Note: IP addresses and domains are intentionally defanged (e.g., [.]) to prevent accidental resolution or hyperlinking. Re-fang only within controlled threat intelligence platforms such as MISP, VirusTotal, or your SIEM.

Follow us on Google News, LinkedIn, and X to Get More Instant UpdatesSet CSN as a Preferred Source in Google.



Source link