OpenSSF/OSV advisory MAL-2026-14273 confirms this npm version as malicious. The package advertises itself as a random-transaction generator but its exported getTransactions API triggers execution of a hidden code payload. load_transaction_data reads per-record 'mark' strings from database.js, applies a shift-cipher keyed by the caller-supplied count argument, base64-decodes the concatenated result, and passes the resulting bytes to the Function constructor invoked with Buffer, require, and...
Source
OpenSSF Malicious Packages via OSV
Summary
Malicious code in rand-txs-sdk (npm)
Details
The package advertises itself as a random-transaction generator but its exported getTransactions API triggers execution of a hidden code payload. load_transaction_data reads per-record 'mark' strings from database.js, applies a shift-cipher keyed by the caller-supplied count argument, base64-decodes the concatenated result, and passes the resulting bytes to the Function constructor invoked with Buffer, require, and process — granting the decoded code full Node.js privileges (filesystem, network, child process). The identifiers Function, require, process, Buffer, setTimeout, and clearTimeout are not present as plain strings; they are reconstructed at runtime by index-selecting fragments from a hidden character array and joined, and the Function constructor is retrieved indirectly through constructor.constructor on a global object. This string-splicing pattern is used specifically to hide the dynamic-execution sink from static analysis, and the combination of obfuscated global reconstruction plus execution of decoded data from a bundled data file is a loader-in-benign-wrapper attack shape rather than any behavior consistent with the stated purpose.
Decision reason
OpenSSF Malicious Packages via OSV confirms rand-txs-sdk@1.0.3 as malicious (MAL-2026-14273): Malicious code in rand-txs-sdk (npm)