MAL-2026-19143: Malicious code in mock-data-sdk (npm)
- Source:
- OSV.dev
- Published:
- Fetched:
- Updated:
- Affects:
- mock-data-sdk
https://osv.dev/vulnerability/MAL-2026-19143 ↗
Malicious code in mock-data-sdk (npm) --- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (f6f3367976e89b052e26e44ddc41d0352391f24336e41a8d41687a0d4c7010e0) The package presents itself as a mock-data generator but hides a base64-encoded JavaScript payload across the `mark` fields of data/products_*.js. The library entrypoint (index.js) concatenates those fields, decodes the result with Buffer.from(..., 'base64').toString('utf-8'), and executes it via the Function() constructor with Buffer, require, and process passed in as arguments. The identifiers 'Buffer', 'require', 'process', and 'new Function' are reconstructed at runtime from an XOR-obfuscated table keyed by a derived 4-byte seed, which conceals the eval sink from string-based scanners. The exported getTransactions() API triggers this execution on every call. The decoded payload loads python-shell and https, writes a Python script to /tmp/targets, and recursively walks the filesystem (pathlib.Path(root).rglob('*')) for file names containing 'password', 'wallet', 'seed', 'privatekey', or '.env'. The advertised purpose (mock data) has no legitimate need to enumerate credential-, wallet-, and dotenv-shaped files on the installer's host or to run arbitrary code reconstructed from pseudo-data files. ## Source: ghsa-malware (31ab62d9fa070d7e1f0ee2b3e7222a6d071c7f3a75a9b3cbb61981adcc5aabe8) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it. Affected: npm:mock-data-sdk No fixed version published yet References: https://www.npmjs.com/package/mock-data-sdk/v/1.0.1 https://github.com/advisories/GHSA-6r85-j4v5-27rf