Malicious code in ts-rand-sdk (npm)
The ts-rand-sdk npm package contains malicious code that executes a hidden payload with full Node.js capabilities on the host machine. It disguises itself as a random transactions SDK but loads and executes obfuscated JavaScript code from a disguised data file. This code execution grants arbitrary filesystem, process, and network access, effectively compromising any system running the package. Immediate removal and secret/key rotation are strongly advised.
AI Analysis
Technical Summary
The ts-rand-sdk package (version 1.0.2) masquerades as a random transactions SDK exposing a getTransactions(count) API. However, invoking this API triggers a hidden loader that reads a disguised database.js file containing base64-encoded and byte-shifted code fragments. These fragments are decoded and concatenated, then executed dynamically via a Function constructor obtained indirectly through globalThis.constructor.constructor. The executed payload receives Buffer, require, and process objects, granting it full Node.js runtime capabilities, including arbitrary filesystem, process, and network access. The package uses obfuscation techniques such as storing sensitive identifiers in fragmented strings and deferring execution with setTimeout to evade detection. The ~54KB of concealed code in database.js is the actual malicious payload, making the advertised functionality a facade for runtime code execution.
Potential Impact
Any system with ts-rand-sdk version 1.0.2 installed or running is fully compromised, as the malicious payload can execute arbitrary code with full Node.js privileges. This includes unrestricted access to the filesystem, process control, and network operations. Consequently, all secrets, keys, and sensitive data stored on the compromised system should be considered exposed and must be rotated immediately. Removal of the package alone does not guarantee elimination of all malicious artifacts or backdoors introduced by the payload.
Mitigation Recommendations
Remove the ts-rand-sdk package version 1.0.2 immediately from all affected systems. Rotate all secrets, keys, and credentials that were stored or accessible on the compromised machines, using a separate, trusted environment. Because the malicious payload grants full control over the system, consider a full forensic investigation and system rebuild to ensure no persistent backdoors remain. Patch status is not confirmed; no official fix or vendor advisory is available. Monitor for updates from the package repository or security advisories for any remediation.
Malicious code in ts-rand-sdk (npm)
Description
The ts-rand-sdk npm package contains malicious code that executes a hidden payload with full Node.js capabilities on the host machine. It disguises itself as a random transactions SDK but loads and executes obfuscated JavaScript code from a disguised data file. This code execution grants arbitrary filesystem, process, and network access, effectively compromising any system running the package. Immediate removal and secret/key rotation are strongly advised.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The ts-rand-sdk package (version 1.0.2) masquerades as a random transactions SDK exposing a getTransactions(count) API. However, invoking this API triggers a hidden loader that reads a disguised database.js file containing base64-encoded and byte-shifted code fragments. These fragments are decoded and concatenated, then executed dynamically via a Function constructor obtained indirectly through globalThis.constructor.constructor. The executed payload receives Buffer, require, and process objects, granting it full Node.js runtime capabilities, including arbitrary filesystem, process, and network access. The package uses obfuscation techniques such as storing sensitive identifiers in fragmented strings and deferring execution with setTimeout to evade detection. The ~54KB of concealed code in database.js is the actual malicious payload, making the advertised functionality a facade for runtime code execution.
Potential Impact
Any system with ts-rand-sdk version 1.0.2 installed or running is fully compromised, as the malicious payload can execute arbitrary code with full Node.js privileges. This includes unrestricted access to the filesystem, process control, and network operations. Consequently, all secrets, keys, and sensitive data stored on the compromised system should be considered exposed and must be rotated immediately. Removal of the package alone does not guarantee elimination of all malicious artifacts or backdoors introduced by the payload.
Mitigation Recommendations
Remove the ts-rand-sdk package version 1.0.2 immediately from all affected systems. Rotate all secrets, keys, and credentials that were stored or accessible on the compromised machines, using a separate, trusted environment. Because the malicious payload grants full control over the system, consider a full forensic investigation and system rebuild to ensure no persistent backdoors remain. Patch status is not confirmed; no official fix or vendor advisory is available. Monitor for updates from the package repository or security advisories for any remediation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-14193
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a84fa66c6e8be0332ef1320
Added to database: 08/19/2026, 00:35:50 UTC
Last enriched: 09/29/2026, 21:37:32 UTC
Last updated: 10/02/2026, 16:02:33 UTC
Views: 98
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.