Skip to main content

Malicious code in @torbeck/heap (npm)

0
Critical
Published: 07/13/2026 (07/13/2026, 06:53:07 UTC)
Source: GCVE Database
Product: @torbeck/heap

Description

The @torbeck/heap npm package is a malicious typosquatting package impersonating the legitimate @datastructures-js/heap library. It contains heavily obfuscated code that executes at require-time to download and execute a hidden binary payload on the host system. This payload is platform-specific and runs detached, providing remote code execution (RCE). The package does not verify the downloaded binary's integrity or authenticity, making it a severe security risk. Any system with this package installed should be considered fully compromised.

Affected software

npmghsa
@torbeck/heap
Affected versions
=4.3.14=4.3.11=4.3.10

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/14/2026, 19:52:42 UTC

Technical Analysis

@torbeck/heap is a malicious npm package designed to impersonate the legitimate @datastructures-js/heap package by copying its README and metadata. It re-exports the genuine Heap class to appear functional but appends an obfuscated payload that triggers on require. This payload decrypts a concealed URL, downloads a binary to the OS temporary directory, sets execution permissions, and spawns the binary detached from the parent process. The binary is platform-specific (Windows, Linux, macOS) and unrelated to heap data structures. There is no signature or version verification on the downloaded payload. This results in an install-time remote code execution dropper, effectively compromising any system that installs or runs this package.

Potential Impact

Systems that have installed or run @torbeck/heap are fully compromised due to the remote code execution capability of the malicious payload. Attackers gain persistent, stealthy control by downloading and executing arbitrary binaries without user consent. All secrets, credentials, and keys stored on the compromised system should be considered exposed and require immediate rotation. Removing the package alone does not guarantee removal of all malicious artifacts or backdoors introduced by the payload.

Defensive Guidance

Immediate removal of the @torbeck/heap package is required. All secrets and credentials on affected systems must be rotated from a trusted environment. Due to the high likelihood of full system compromise, a complete forensic investigation and system rebuild are recommended. There is no official patch or fix for this malicious package; prevention relies on avoiding installation of typosquatting or untrusted packages and using package integrity verification tools.

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-10405
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a54ad9268715ace438f0510

Added to database: 07/13/2026, 09:19:14 UTC

Last enriched: 08/14/2026, 19:52:42 UTC

Last updated: 09/08/2026, 10:20:48 UTC

Views: 63

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