MAL-2026-21085: Malicious code in random-transactions-sdk (npm)
--- -= Per source details. Do not edit below this line.=-
Source: amazon-inspector (425021c6510cafa34700a3f3e48030b56955aa3454bb39d9fb3d3341adad7513) random-transactions-sdk@1.0.4 ships a database.js data file containing ~54KB of base64-encoded 'mark' fields. The documented getTransactions() API calls loadtransactiondata(), 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, childprocess via require) in the installer's process.
Affected Software
Event History
Frequently Asked Questions
What application behavior triggers execution of the embedded payload?
Calling the documented getTransactions() API triggers load_transaction_data(). That routine uses the caller-supplied count value to transform and decode the embedded data before passing it to the Function constructor.
What access is available to the dynamically evaluated code?
The evaluated source is given Buffer, require, and process as parameters. This provides the payload access to Node.js module loading and process functionality.
How can teams determine whether they have the identified package release?
Check dependency manifests and lockfiles for npm/random-transactions-sdk version 1.0.4. The available data specifically identifies version 1.0.4 as shipping the obfuscated database.js content.