Malicious NuGet Packages Hide Time-Delayed Sabotage Code | eSecurity Planet

Malicious NuGet Packages Hide Time-Delayed Sabotage Code

Researchers found nine NuGet packages hiding time-delayed code that can crash apps or corrupt industrial systems.

Written By
Ken Underhill
Ken Underhill
Nov 7, 2025
3 minute read
eSecurity Planet content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Researchers at Socket have identified a sophisticated supply-chain attack campaign in which nine malicious NuGet packages embed time-delayed, probabilistic sabotage routines into otherwise legitimate .NET libraries. 

The packages, downloaded 9,488 times before disclosure, use hidden triggers to kill host processes and, in one case, corrupt industrial control system write operations. 

From Library to Liability

The malicious packages were published under the alias shanhai666 between 2023 and 2024.

Each malicious package delivers genuine, working functionality to establish trust and evade cursory review, while burying ~20 lines of malicious code. 

The actor weaponizes C# extension methods (e.g., .Exec() for database commands and .BeginTran() for S7 PLC clients) so that every database query or PLC operation implicitly executes the injected logic. 

After hardcoded (or encrypted) trigger dates, the payload computes a random number and calls Process.GetCurrentProcess().Kill(), abruptly terminating the application. 

Trigger dates are staggered — some packages activate in 2027 or 2028 — extending the actor’s window to harvest victims before detection.

Sharp7Extend, the campaign’s most dangerous package, combines two sabotage modes.

  • An immediate probabilistic process-kill on every PLC operation (active until June 6, 2028) 
  • A deferred write-failure mechanism that silently returns failed results for up to 80% of write attempts after a 30–90 minute grace period. 

The latter behavior corrupts PLC writes without obvious error messages, risking actuator non-response, failed safety engagements, and undetected production drift — effects that mimic intermittent hardware problems rather than a deliberate attack.

Why Detection is Difficult

Several factors make these packages difficult to detect: 

  • The bulk of the code is legitimate and useful, which passes functional testing and code review.
  • Typosquatting (Sharp7 → Sharp7Extend) increases accidental installs in OT environments.
  • Bundled legitimate libraries remove obvious red flags during integration testing.
  • Randomized, probabilistic activation disguises systematic interference as random failures.
  • Long delays between install and activation break forensic timelines by the time impacts are observed. 

The attacker intentionally varied author metadata and forged signature artifacts to frustrate automated heuristics.

Advertisement

Building Supply Chain Resilience

Defending against the NuGet campaign requires immediate action and long-term supply chain resilience.

  • Audit dependencies now: Inventory .NET packages and remove or replace any of the nine identified packages immediately.
  • Enforce dependency hygiene: Require verified publisher metadata, deny typosquatted names, and restrict package sources to approved registries.
  • Scan at build and pre-merge: Integrate SBOM checks and static analysis in CI/CD pipelines to flag time-based logic, unusual extension methods, or obfuscated trigger code.
  • Monitor for probabilistic/time-based logic: Alert on date checks, randomized control flows, or unusual use of Process.Kill() and extension methods in dependencies.
  • Validate ICS integrity: For industrial environments, implement write-verification for PLC commands, baseline PLC success rates, and monitor for sudden drops in write confirmation.
  • Harden supply-chain policies: Enforce least privilege for package installation, require code reviews for third-party libraries, and apply strict change control for OT components.

By integrating these practices, organizations can strengthen their software supply chain and reduce exposure to hidden malicious logic.

This campaign demonstrates how supply-chain attacks can weaponize trusted code and time delays to achieve destructive effects while evading detection.  

Ken Underhill

Ken Underhill is an award-winning cybersecurity professional, bestselling author, and technology leader with more than 25 years of experience in IT, cybersecurity, and risk management. His career spans network administration, incident response, penetration testing, and entrepreneurship, giving him firsthand experience helping organizations reduce risk and ensure compliance. Ken is also a former nurse and combat medic and he uses this background to break down complex cybersecurity topics into digestible content for a broad, global audience. A multi-exit cybersecurity founder, Ken has spent decades helping organizations strengthen their security posture, manage risk, and navigate complex technology challenges. His expertise includes overall cybersecurity strategy, cloud security, incident response, risk management, security awareness, and emerging threats affecting businesses. Ken is also an advisor to multiple startups on AI security and risk. In addition to his hands-on industry experience, Ken is a cybersecurity newsletter writer for TechnologyAdvice, where he covers cybersecurity news/trends and actionable best practices for business and IT professionals. Ken is also an educator with over 2 million people going through his courses over the years. He has won the Global Cybersecurity 40 under 40 (2x winner), the Cyber Champion award from Women's Society of Cyberjutsu, and the 2019 SC Media award for Outstanding Educator. Ken is also a volunteer with organizations like Minorities in Cybersecurity, Black Girls Hack, and the Whole Cyber Human Initiative, which helps veterans transition into security careers. Ken holds a Master of Science in Cybersecurity and Information Assurance from Western Governors University and a Bachelor of Science in Information Systems, with a major in Cybersecurity Management, from Strayer University. His certifications include the Certificate of Cloud Security Knowledge (CCSK), Certified Ethical Hacker (CEH), and Computer Hacking Forensic Investigator (CHFI) and he is a former adjunct professor of Digital Forensics. Ken also had a streaming cybersecurity television show from 2020-2022 that reached over 200K monthly viewers around the world. His work and expertise have been featured in Forbes, Reader's Digest, Medium, TechRepublic, Fox, NBC, CBS, Dark Reading, MSN Money, and other leading publications and media outlets, making him a trusted voice on cybersecurity, election security, and privacy.

eSecurity Planet Logo

eSecurity Planet is a leading resource for IT professionals at large enterprises who are actively researching cybersecurity vendors and latest trends. eSecurity Planet focuses on providing instruction for how to approach common security challenges, as well as informational deep-dives about advanced cybersecurity topics.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.