As reported by The Hacker News, researchers at TrendAI have uncovered 14 trojanized npm packages that deliver RedC2 4.0, a cross-platform command-and-control framework with an AI-assisted Linux beacon. The campaign is a textbook example of why software supply chain security remains one of the most underdefended attack surfaces in modern development pipelines — and this iteration raises the bar in several concerning ways.
Why This Campaign Stands Out
Most malicious npm packages historically fall into one of two categories: typosquats that rely on developer misspelling a popular package, or install-script-based payloads that trigger during npm install. This campaign breaks both assumptions. The 14 identified packages — including streak-metrics-math, kit-map-vim, and streak-map-cache — are functional utilities that deliver their promised calendar and streak-tracking features. The malicious payload is a native binary disguised as a math accelerator (math-core.bin, calc.bin, etc.) that executes the moment the module is imported anywhere in the dependency graph. No install hook. No exported function call. Just import and you're compromised.
This design defeats several common supply chain defenses simultaneously. Package scanners that flag suspicious preinstall or postinstall scripts will find nothing. Developers who audit package source on npm's web interface will see legitimate date utility code. Even runtime sandboxing that hooks process spawning during installation won't catch a payload that activates at import time — potentially seconds before or long after install, depending on when the module is first loaded.
The AI-Assisted C2 Evolution
RedC2 has been under active development for at least a year, with version 2.0 appearing in August 2025, version 3.0 in January 2026, and version 4.0 advertised on Hack Forums in June 2026 by a threat actor using the handle "MarlboroMan." The introduction of the RedShell Linux beacon in version 4.0, combined with AI-assisted command-and-control, signals a shift toward automated post-exploitation. AI-assisted C2 can theoretically adapt communication patterns to evade traffic analysis, generate context-aware commands, and reduce the operator burden required to manage large fleets of compromised hosts. This lowers the barrier for mass-operation campaigns and makes behavioral detection significantly harder.
The fact that a single transitive import anywhere in the dependency graph is sufficient to execute the payload means any project pulling in these packages — directly or through a dependency of a dependency — is at risk.
Who Is Most Exposed
npm install and immediately execute test suites — the payload activates when tests import the moduleShield53 Recommendations
Immediate Actions
- Audit your dependency tree now: Run
npm lsor use tools likenpm-audit,socket, orosv-scannerto check whether any of the 14 identified packages appear in your lockfile — directly or transitively - Block known indicators: Search filesystems for the disguised binary names (
math-core.bin,math-calc.bin,calc-cache.bin,calc.bin,calc-mapping.bin,calc-math.dat) indist/ordist/internal/directories withinnode_modules - Inspect for running processes: Look for unexpected detached background processes originating from Node.js application directories, particularly on Linux hosts
- Review network logs: Hunt for outbound connections from Node.js processes to unfamiliar endpoints that could indicate beacon C2 traffic
Longer-Term Hardening
- Adopt dependency pinning with integrity hashes and enforce
npm ciin all environments to prevent unexpected package resolution - Implement egress allowlisting on production and CI/CD networks to prevent beacons from reaching C2 infrastructure
- Deploy runtime application self-protection (RASP) or eBPF-based process monitoring that flags child process spawning from Node.js runtimes
- Use private npm registries or caching proxies with allowlisting for production builds to prevent introduction of unvetted packages
- Treat transitive dependencies as first-class risks: The import-time execution model means a deep transitive dependency is just as dangerous as a direct one. Tools like Socket and Snyk that analyze package behavior — not just known vulnerability databases — are essential for catching novel malicious packages
The convergence of functional malicious packages, import-time execution, and AI-assisted C2 represents a meaningful escalation in supply chain threats. Defenders can no longer rely on install-script detection or package name scrutiny alone. The assumption that a package which works as advertised is safe has been formally invalidated.