2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
- Kush Pandya

Over the past year, the Socket Threat Research Team observed a steady rise in destructive and sabotage-oriented malware embedded in open source packages across multiple ecosystems. Unlike financially motivated campaigns that focus on credential theft, cryptomining, or wallet draining, these incidents were built to damage developer environments directly, deleting source code, breaking builds, or wiping repositories outright.
These packages were published through trusted registries including npm, PyPI, NuGet Gallery, and Go module indexes, and were typically presented as ordinary developer tooling or ecosystem-specific utilities. In many cases, the destructive behavior was not immediate. Payloads were delayed, gated behind environment checks, or controlled remotely through kill switches, allowing threat actors to decide when disruption would occur while minimizing early detection.
All cases referenced here were investigated and disclosed by Socket researchers and reported to the relevant registry maintainers.
Operational vs. Financial Impact
#One of the most consistent observations this year was that destructive malware in open source ecosystems looks very different from traditional ransomware or enterprise wipers. Rather than encrypting disks or indiscriminately destroying files, these packages tend to operate surgically.
They delete only what matters to developers: Git repositories, source directories, configuration files, and CI build outputs. They often blend this logic into otherwise functional code paths and rely on standard lifecycle hooks to execute, meaning the malware may never need to be explicitly imported or invoked by the application itself.
The impact is operational rather than financial. Builds fail. Repositories disappear. Developer machines require recovery. In CI/CD environments, the blast radius is often much larger, as a single malicious dependency can propagate destructive behavior across multiple pipelines before it is identified.
Across the incidents documented this year, destructive behavior appeared consistently across ecosystems, though the delivery mechanisms varied.

Destructive malware executing during dependency installation via lifecycle hooks. The payload runs both on local developer machines and across CI/CD runners at scale, without requiring the dependency to be imported by application code.
npm accounted for the majority of cases, particularly within frontend tooling and JavaScript utility ecosystems. PyPI packages often relied on typosquatting and dependency confusion, while NuGet campaigns demonstrated delayed-execution wipe logic targeting Windows developers. Go modules were frequently abused as loaders that fetched destructive shell scripts from remote infrastructure.
Despite these differences, the underlying assumption being exploited was the same: dependencies are trusted to execute code during installation. In several cases, intent was difficult to attribute with certainty. Some destructive payloads appeared opportunistic or experimental, while others showed deliberate coordination and timing, suggesting a higher degree of intent than simple vandalism.
Four Emerging Destructive Patterns
#Four destructive patterns surfaced repeatedly over the course of the year. These patterns were not isolated to a single ecosystem and often appeared in combination.
Pattern 1: Remote Kill Switches
#The first pattern involved remote kill switches. Several malicious packages remained dormant after installation, periodically polling attacker-controlled endpoints for instructions. The response, often a simple boolean flag or command string determined whether the package should continue functioning normally or execute destructive actions. Once activated, the payload typically issued recursive delete commands, poisoned environment state, or forcibly terminated processes.
This approach allowed threat actors to leave packages inactive for extended periods, reducing the likelihood of detection during short-lived analysis or testing. Developers affected by these packages often experienced sudden repository loss weeks after installation, with no obvious trigger.

Remote kill-switch execution flow. After installation, the malicious package remains idle while periodically polling attacker-controlled infrastructure. Destructive logic executes only after a remote activation signal is received.
Pattern 2: Time-Delayed Execution
#A second recurring pattern was time-delayed execution without any remote communication. Several malicious NuGet packages published this year embedded destructive payloads that executed only after a fixed delay; sometimes days after installation. Others triggered after a specific number of runtime invocations or on hardcoded calendar dates.
These delays were effective at evading sandbox analysis and automated scanning, which often focuses on immediate post-install behavior. When destruction finally occurred, it was frequently misattributed to local developer error or environmental issues rather than a dependency compromise.
Pattern 3: Targeted Codebase Wiping
#The third pattern involved targeted codebase and repository wiping. Rather than attempting full disk destruction, most packages focused narrowly on developer assets. Git repositories, framework-specific directories, configuration files, and build artifacts were common targets.
In npm ecosystems, multiple campaigns explicitly targeted React, Vue, and Vite project structures. The malicious packages were positioned as helpers or plugins that developers commonly install early in a project. Once executed, they issued rm -rf against known framework paths while leaving the host operating system intact. This selective approach maximizes disruption while minimizing the likelihood of triggering endpoint defenses that might detect broader destructive behavior.

Selective destruction behavior observed in open source sabotage campaigns. Rather than wiping the host operating system, malicious packages target high-value developer assets such as source code, repositories, configuration files, and build outputs.
Pattern 4: Remote Payload Fetching
#The fourth pattern involved remote payload fetch and execution. In these cases, the published package contained minimal malicious logic itself and instead acted as a loader. At runtime, it fetched destructive scripts or executable code from a remote server using standard tools such as wget, curl, or HTTP client libraries.
This separation allowed threat actors to modify destructive behavior after publication and significantly reduced the effectiveness of static analysis. A package could appear benign initially, then later begin fetching wipe payloads once adoption increased or conditions were met.
Notable Campaigns
#Throughout the year, Socket disclosed multiple campaigns illustrating these techniques in practice:
Time-delayed NuGet packagesthat specifically wiped developer directories.Remote kill-switchesin npm packages targeting WhatsApp-related tooling.Typosquatted Python packagemimicking popular authentication libraries.Ecosystem-specific npm attacksexplicitly targeting React, Vue, and Vite developers.Remote-triggered codebase wipeswhere npm packages erased project directories after receiving attacker-controlled signals.System-wide destructive npm packagesenabling broad environment deletion through embedded kill logic.Go modules fetching destructive shell scriptsfrom remote infrastructure.Kill-switch-enabled typosquatsabusing names similar tochalkandchokidar.
While implementation details varied, the theme was consistent: malicious packages that resembled trusted developer tools, were used as sabotage vectors.
Outlook and Recommendations
#Destructive supply chain attacks do not always result in data theft or direct financial loss, but their impact can still be severe. Loss of proprietary source code, CI/CD outages, developer downtime, and erosion of trust in open source tooling were common outcomes across the incidents we investigated. In some cases, destructive payloads appeared retaliatory or ideological rather than profit-driven. In others, destruction may have served as cover for parallel intrusion activity. Regardless of motivation, destructive behavior in dependencies should be treated as a high-confidence indicator of supply chain compromise.
Across incidents analyzed this year, several defensive gaps repeatedly surfaced. Developers implicitly trusted low-reputation or newly published packages. Install-time scripts executed without restriction. Dependency provenance was rarely verified, meaning the code published to the registry frequently did not match the code visible in the associated GitHub repository, blinding developers to the true nature of the package.
Looking ahead, destructive supply chain malware is likely to persist as a low-cost, high-impact tactic. We expect continued use of remote kill switches for coordinated sabotage, increased targeting of framework-specific ecosystems, greater reliance on multi-stage loaders, and broader abuse of CI/CD environments as amplification vectors.
To reduce exposure, development teams should disable unnecessary lifecycle scripts in CI, enforce strict dependency pinning with provenance checks, monitor for unexpected file-system deletion during builds, and treat any dependency performing recursive delete operations as suspicious. Established packages with transparent maintainers and clear histories should be preferred over newly published or lightly maintained alternatives. Earlier this year, the Socket Threat Research Team also published the 2025 Blockchain and Cryptocurrency Threat Report, led by Kirill Boychenko, which examined financially motivated malware targeting blockchain and crypto development ecosystems. That work complements the findings in this report by highlighting a parallel set of supply chain threats driven by direct financial incentives.
Socket continues to monitor and disclose destructive malware across open source ecosystems. Socket’s GitHub App, CLI, and browser extension are designed to detect and block packages exhibiting destructive, remote-triggered, or sabotage-oriented behavior before they reach production environments. Socket MCP extends these protections into AI-assisted development workflows by detecting and flagging malicious, typosquatted, or hallucinated package references generated by large language models, helping prevent destructive dependencies from being introduced during code generation and review.




