This report shows the evidence for ts-rand-sdk@1.0.4. 2 of 3 known versions are blocked or flagged. The newest version, 0.0.1-security, is allowed.
Blocked by malware advisory
OpenSSF/OSV malware advisory MAL-2026-14193 identifies this version as malicious and supplies the Firewall block. LPM AI assessed this version as suspicious; the assessments disagree.
What to do: remove this version and, if it ran, rotate the credentials it could reach. Remediation↓
OpenSSF/OSV malicious advisory
published · by OpenSSF/OSV
OpenSSF/OSV advisory MAL-2026-14193 confirms this npm version as malicious.
Advisory
MAL-2026-14193
Source
OpenSSF Malicious Packages via OSV
Summary
Malicious code in ts-rand-sdk (npm)
Details
Package presents itself as a random transactions SDK exposing a single API, getTransactions(count). Following that documented usage triggers a hidden loader: load_transaction_data reads database.js (framed as a product catalog), takes each record's `mark` field, base64-decodes it, applies a per-record byte shift keyed on `count % 256`, concatenates the fragments in id order, base64-decodes the result again, and passes the resulting JavaScript source into a Function constructor obtained indirectly via globalThis.constructor.constructor. The constructed function is invoked with Buffer, require, and process passed in, giving the decoded payload full Node.js capabilities (arbitrary filesystem, process, and network access) on the caller's machine. Sensitive identifiers (setTimeout, Function, Buffer, require, process, clearTimeout) are stored as fragments in a string array and reassembled at runtime via an index-mapping helper, and execution is deferred through setTimeout, both patterns serving only to hide the payload path from reviewers. The ~54KB of `mark` shards inside database.js are the concealed code body; the product-catalog framing is cover. The package's advertised functionality is a facade over a runtime code-execution loader.
## Source: ghsa-malware (f1f9011f0abb7ca82ed6875b22587eeb4a46afca2285ce54ae90dc720bf9a53a) 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.
LPM's AI review found this version suspicious. That disagrees with the OpenSSF/OSV advisory, which supplies the block.
The package deliberately hides executable code in data and runs it when a normal exported API is used. There is no install hook or confirmed concrete attack, so a warning is proportionate.
Static reason
No blocking static signals were detected.
Trigger
Calling the exported getTransactions function triggers load_transaction_data.
Impact
The hidden code could execute with the importing application's Node.js privileges; its exact effects remain unresolved.
Mechanism
Marked data from database.js is decoded, converted to text, passed to a Function constructor, and invoked with Buffer, require, and process.
Evidence
index.jsdatabase.js
Independent scan evidence
public snapshot
AI called this Suspicious at 91.0% confidence as Dangerous Capability with low false-positive risk.
Evidence for AI warning decision
The manifest has no automatic install lifecycle hook and names index.js as the entrypoint.
The entrypoint decodes data from database.js through a reversible byte-shift routine.
A public transaction function invokes a delayed loader that converts decoded data to text and constructs a function with Buffer, require, and process.
The decoded payload is stored as opaque marked records in database.js, so its behavior cannot be established from transparent source.
Evidence against
No confirmed network, credential, file-harvesting, or destructive operation was found in the inspected entrypoint.
The opaque loader is reached only when the exported transaction function is called, not merely on installation or import.
The versions list below shows the verdict for each recorded version.
Avoid installing ts-rand-sdk@1.0.4. Remove it from direct dependencies and check your lockfile for transitive copies.
Choose an independently verified alternative or release. This report does not establish that other versions are safe.
If this version ran, investigate the affected machine and build environment. Rotate credentials it could access and rebuild from a trusted environment.