Researchers at Socket have uncovered a highly sophisticated and patient supply-chain attack targeting developers via the official NuGet package repository. Nine malicious packages, published by an actor using the alias "shanhai666" and downloaded nearly 9,500 times, were found to contain dormant sabotage code. The packages provided legitimate functionality to avoid suspicion, but included hidden logic set to activate on specific future dates, some as late as 2027 and 2028. The most alarming of these, Sharp7Extend, contained a payload specifically designed to disrupt Industrial Control Systems (ICS). After a delay, this code would cause write operations to Programmable Logic Controllers (PLCs) to fail silently, potentially leading to catastrophic physical process failures. This attack represents a dangerous evolution in supply chain threats, blending stealth, patience, and the potential for physical-world impact.
The attack was carried out by publishing nine seemingly useful packages to the NuGet repository. The threat actor, "shanhai666," leveraged C# extension methods to weaponize the code. This technique is particularly insidious because the malicious logic is implicitly executed whenever a developer uses a standard function, such as writing to a database or a PLC, without any explicit call to the malicious code visible in their own source.
The payload had two main components:
Process.GetCurrentProcess().Kill(), causing the application to crash intermittently and making debugging extremely difficult.T1195.001 - Compromise Software Dependencies and Development Tools.Sharp7Extend points to a clear intent to sabotage industrial processes. This is a form of T1499 - Endpoint Denial of Service at the application level and, more critically, T0886 - Impair Process Control in the ICS context.T1484 - Domain Policy Modification (in a broader sense of time-based triggers) and is a powerful method to bypass security checks that analyze package behavior at install time.The potential impact of this attack is critical, especially for the industrial sector. The Sharp7Extend package could cause:
D3-FA: File Analysis.Process.GetCurrentProcess().Kill()) or discrepancies between command execution and expected outcomes (e.g., a PLC write command that doesn't result in a state change).D3-SCA: Static Code Analysis.D3-EAL: Executable Allowlisting (applied to software libraries).Enforce policies that only allow dependencies signed by trusted publishers, though this can be bypassed if a legitimate publisher is compromised.
Mapped D3FEND Techniques:
Run applications in a sandboxed environment to observe their behavior and detect malicious actions like process killing.
Mapped D3FEND Techniques:
Implement a mandatory Static Code Analysis (SCA) or Software Composition Analysis (SCA) step in your CI/CD pipeline. This process should automatically scan all third-party dependencies, like the malicious NuGet packages, before they are compiled into production software. Configure the scanner to specifically look for high-risk indicators such as calls to Process.GetCurrentProcess().Kill(), the use of hardcoded future dates as logic triggers, or obfuscated code within extension methods. A tool like Socket (which found this threat) or others can identify packages with these characteristics, as well as those published by known malicious actors like 'shanhai666'. This automated check acts as a critical gate, preventing such time bombs from ever entering the software supply chain.
Establish a policy of dependency allowlisting, moving away from pulling packages directly from public repositories like NuGet. Instead, create a private, internal artifact repository (e.g., JFrog Artifactory, Sonatype Nexus). This repository should only contain a curated list of third-party packages that have been vetted and approved by a security team. Developers would then configure their environments to pull dependencies exclusively from this internal source. This prevents a developer from accidentally downloading a malicious or typosquatted package like 'Sharp7Extend' and ensures that only known-good components are used in the development of critical applications, especially those controlling ICS environments.
For critical ICS environments, deploy runtime monitoring and process analysis on the host machines running the control software. This defense-in-depth layer is designed to catch malicious behavior that slips past static checks. Configure monitoring to alert on any self-termination of the main application process, as seen with the Process.GetCurrentProcess().Kill() call. Additionally, for the PLC write-failure scenario, the monitoring system should correlate the software's write commands with the actual state feedback from the PLC. If the software logs a successful write but the PLC state does not change, it should trigger a high-severity alert for silent failure, allowing operators to intervene before physical processes are dangerously corrupted.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats