Malicious code in rand-txs-sdk (npm)
Description
The npm package rand-txs-sdk version 1.0.3 contains malicious code hidden within its getTransactions API. This API executes a concealed payload by decoding and dynamically running obfuscated code with full Node.js privileges, including filesystem and network access. The malicious behavior is disguised through string-splicing and runtime reconstruction of critical global identifiers to evade static analysis. This loader-in-benign-wrapper attack deviates from the package's advertised functionality as a random-transaction generator.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The rand-txs-sdk npm package (version 1.0.3) exports a getTransactions API that triggers execution of a hidden payload. This payload is constructed by reading 'mark' strings from a bundled data file, applying a shift cipher keyed by a caller-supplied argument, base64-decoding the result, and passing the decoded bytes to the Function constructor. The Function constructor is accessed indirectly via constructor.constructor on a global object, and critical identifiers such as Function, require, process, and Buffer are reconstructed at runtime from fragments of a hidden character array to evade static detection. This technique enables the execution of arbitrary code with full Node.js privileges, including filesystem, network, and child process capabilities. The attack pattern is a loader-in-benign-wrapper, where the malicious payload is hidden inside an otherwise legitimate-looking package.
Potential Impact
An attacker or user invoking the getTransactions API in rand-txs-sdk version 1.0.3 will cause execution of arbitrary code with full Node.js privileges. This includes access to the filesystem, network, and ability to spawn child processes, which can lead to system compromise, data exfiltration, or further malicious activity. The obfuscation and dynamic code execution make detection difficult through static analysis.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid using rand-txs-sdk version 1.0.3 and remove it from your environment if present. Monitor for updates from the package maintainer or npm security advisories regarding remediation or removal.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14273
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a85b4b4acd9273b4925157c
Added to database: 08/19/2026, 13:50:44 UTC
Last enriched: 08/19/2026, 14:19:19 UTC
Last updated: 10/02/2026, 13:51:51 UTC
Views: 23
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.