Malicious code in rand-txs-sdk (npm)
The npm package rand-txs-sdk contains malicious code that executes a hidden payload when the getTransactions API is called. The payload uses obfuscated string reconstruction and base64 decoding to execute arbitrary Node.js code with full system privileges.
- Disclosed
- Last updated
- Blast radius
- Any Node.js application that imports and calls the getTransactions API from rand-txs-sdk
- Ecosystems
- Attack vectors
- Affected entities
- rand-txs-sdknpm package advertising as random-transaction generator
The npm package rand-txs-sdk was found to contain malicious code disguised within its advertised random-transaction generator functionality. When the exported getTransactions API is invoked, it triggers execution of a hidden code payload.\n\nThe attack mechanism uses a loader-in-benign-wrapper pattern. The load_transaction_data function reads 'mark' strings from a bundled database.js file, applies a shift-cipher transformation keyed by a caller-supplied count argument, base64-decodes the result, and passes the decoded bytes to the Function constructor. This grants the decoded code full Node.js privileges including filesystem access, network operations, and child process execution.\n\nTo evade static analysis detection, the code reconstructs sensitive identifiers (Function, require, process, Buffer, setTimeout, clearTimeout) at runtime by index-selecting fragments from a hidden character array rather than using plain strings. The Function constructor itself is retrieved indirectly through constructor.constructor on a global object. This obfuscation pattern combined with execution of data from a bundled file is characteristic of supply chain attacks rather than legitimate functionality.\n\nThe vulnerability was identified by the OpenSSF malicious-packages project and reported via GitHub Advisory GHSA-27g5-wp43-2h3q.
Indicators of compromise
- Packages
- rand-txs-sdk
Remediation
- Remove rand-txs-sdk from all projects immediately
- Audit all Node.js applications that have imported rand-txs-sdk for signs of compromise (unexpected network connections, filesystem modifications, process spawning)
- Review application logs and system audit trails for suspicious activity during the period rand-txs-sdk was installed
- Regenerate any credentials or secrets that may have been exposed to systems running code with rand-txs-sdk
- Update dependency manifests (package.json, package-lock.json) to remove rand-txs-sdk and verify no other malicious packages are present
Sources
- GitHub Advisory GHSA-27g5-wp43-2h3q · GitHub Advisory Database
Cite this entry
"Malicious code in rand-txs-sdk (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 19, 2026; last updated August 19, 2026. https://supplychainattack.org/incident/malicious-code-in-rand-txs-sdk-npm-lq3xg6
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in 3-buildsight-web (npm)
The npm package 3-buildsight-web contains malicious code that fetches and executes arbitrary JavaScript from a remote Bitbucket URL on module load, granting full page privileges to an unverified third party.
npmCompromised package - resolvedcritical
Malicious code in @usaa-grp-personal-profile/personal-profile-common (npm)
Malicious package @usaa-grp-personal-profile/personal-profile-common version 999.0.0 published to public npm as a dependency-confusion attack targeting an organization's internal registry. The package contains preinstall and postinstall hooks that exfiltrate hostname, username, and working directory to an attacker-controlled OAST endpoint on every install.
npmDependency confusionCompromised package - resolvedcritical
Malicious code in create-coin (npm)
create-coin@20.1.1 on npm contained malicious postinstall code that collected sensitive environment variables, credentials, and host reconnaissance data. The package impersonated an esbuild platform build and exfiltrated data to a hardcoded endpoint.
npmCompromised packageTyposquatting - resolvedcritical
Malicious code in @syncraft-labs/vue (npm)
The npm package @syncraft-labs/vue version 0.4.1 contained malicious obfuscated code in its ESM build that implements a blockchain-hosted C2 dropper (EtherHiding pattern), enabling remote code execution on any consumer importing the package.
npmCompromised package