{"id":"MAL-2026-21085","summary":"Malicious code in random-transactions-sdk (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (425021c6510cafa34700a3f3e48030b56955aa3454bb39d9fb3d3341adad7513)\nrandom-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.\n","modified":"2026-12-03T20:45:10.162412536Z","published":"2026-12-03T20:37:07Z","database_specific":{"malicious-packages-origins":[{"import_time":"2026-12-03T20:41:50.106557232Z","modified_time":"2026-12-03T20:37:07Z","sha256":"425021c6510cafa34700a3f3e48030b56955aa3454bb39d9fb3d3341adad7513","source":"amazon-inspector","versions":["1.0.4"],"id":"IN-MAL-2026-023220"},{"import_time":"2026-12-03T20:41:50.184199400Z","modified_time":"2026-12-03T20:37:13Z","sha256":"c772fbb26078f89c012ffbd5cd2a9821742a79ef50b2784ec62e8104107aa92c","source":"amazon-inspector","versions":["1.0.1"],"id":"IN-MAL-2026-023221"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/random-transactions-sdk/v/1.0.4"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/random-transactions-sdk/v/1.0.1"}],"affected":[{"package":{"name":"random-transactions-sdk","ecosystem":"npm","purl":"pkg:npm/random-transactions-sdk"},"versions":["1.0.4","1.0.1"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"evidence_files":[{"tlsh":"0ef10f6839f930248857b07c67eb9449612de0576e9a6ca87f4d83101f7d13ce1f6ba8","path":"index.js","sha256":"c0a1a7e54e1c759e62e48cfa835d79494163da3b37b30c1bd55c5875d9dd24f0"}],"package_integrity":[{"filename":"random-transactions-sdk-1.0.4.tgz","hashes":{"sha512_sri":"sha512-PJMPVgbVEmqfErhkd296eSR4xVbQWnCpWZxin7eVY1dZlPNp0RQyc+6LHwemb1IUJkMXwiNTlsY/c/tEw1QxwQ==","sha1":"aa60d4cd1eba9dd099f47dc09961e540c483f4d6"}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/random-transactions-sdk/MAL-2026-21085.json"}}],"schema_version":"1.9.2","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}