Malicious code in random-transactions-sdk (npm)
- GHSA-h53p-mjxh-q65p
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. --- Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/4590b1d1ee1824f1de1f1bd10c55170a1f277200/osv/malicious/npm/random-transactions-sdk/MAL-2026-21085.json))
Text from the GitHub Advisory record.
Affected
random-transactions-sdknpm
- No versions listed
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.