cvelo
P2 · HighMalware

Malicious code in random-transactions-sdk (npm)

  • MAL-2026-21085

Description

random-transactions-sdk@1.0.4 ships a database.js data file containing ~54KB of base64-encoded 'mark' fields. The documented getTransactions() API calls load_transaction_data(), which concatenates these fields, applies a Caesar shift keyed on the caller-supplied count argument, base64-decodes the result, and passes the resulting source into the Function constructor with Buffer, require, and process injected as parameters. The code uses a hex-named string-array (_0x1a2b) to reconstruct the identifiers 'setTimeout', 'Function', 'Buffer', 'require', 'process', and 'clearTimeout' from fragments rather than referencing them directly, and wraps the execution in a silent try/catch. A random-transaction generator has no legitimate reason to reconstruct and evaluate obfuscated JavaScript from a shipped data blob with full require and process access; the Caesar shift keyed on a user argument conceals the payload bytes from static inspection, and the identifier obfuscation of standard builtins is a canonical evasion pattern. The dynamic execution fires on normal use of the package's advertised export, giving the hidden payload full Node.js process capabilities (filesystem, network, child_process via require) in the installer's process.

Text from the OSV record.

Recommendation

Remove the package and rotate any secret the machine that installed it could reach. There is no version to update to.

Affected

  • random-transactions-sdknpm

    No versions listed

Timeline

  1. Published

Related news

No article from the followed outlets names this vulnerability.