Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Malicious code in ts-rand-sdk (npm)

0
Critical
Published: 08/19/2026 (08/19/2026, 00:04:55 UTC)
Source: GCVE Database
Product: ts-rand-sdk

Description

The npm package ts-rand-sdk version 1.0.2 contains malicious code hidden behind its advertised functionality. It exposes a getTransactions API that triggers a loader which reconstructs and executes obfuscated JavaScript code with full Node.js privileges. This allows arbitrary filesystem, process, and network access on the host machine. The malicious payload is concealed as base64-encoded shards in a database.js file, with execution delayed and obscured to evade detection.

Affected software

npmghsa
ts-rand-sdk
Affected versions
=1.0.2

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

AILast updated: 08/19/2026, 00:50:21 UTC

Technical Analysis

The ts-rand-sdk package (version 1.0.2) masquerades as a random transactions SDK exposing a single API, getTransactions(count). When used as documented, it triggers a hidden loader function that reads a file named database.js containing approximately 54KB of base64-encoded code fragments in a 'mark' field. These fragments are decoded and byte-shifted based on the count parameter, concatenated in order, and base64-decoded again to produce JavaScript source code. This source is then executed dynamically using a Function constructor obtained indirectly via globalThis.constructor.constructor. The executed code receives Buffer, require, and process objects, granting it full Node.js capabilities including arbitrary filesystem, process, and network access. The package uses string fragment reassembly and deferred execution via setTimeout to obfuscate the payload path and evade review. The advertised product catalog framing is a cover for this runtime code execution loader.

Potential Impact

Successful use of the ts-rand-sdk package version 1.0.2 results in execution of arbitrary JavaScript code with full Node.js privileges on the host system. This enables an attacker to perform any action available to the Node.js process, including reading and writing files, executing system commands, and network communication. The malicious code is concealed and dynamically reconstructed at runtime, making detection difficult. This poses a severe risk of system compromise, data theft, or further malware deployment.

Mitigation Recommendations

No official patch or remediation is currently available for ts-rand-sdk version 1.0.2. Users should immediately cease using this package and remove it from their environments. Avoid installing or running this package from untrusted sources. Monitor for any updates or advisories from the package maintainers or npm registry regarding remediation. Since this is a malicious package, do not attempt to run or debug it in production environments.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-14193
Osv Schema Version
1.7.4
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a84fa66c6e8be0332ef1320

Added to database: 08/19/2026, 00:35:50 UTC

Last enriched: 08/19/2026, 00:50:21 UTC

Last updated: 08/19/2026, 00:59:06 UTC

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses