14 Trojanized npm Packages Deliver RedC2 4.0 Linux Backdoor With AI-Assisted C2
Cybersecurity researchers have uncovered 14 trojanized npm packages that appear to provide legitimate calendar and streak-related utilities while secretly delivering a Linux backdoor called RedC2 4.0. The discovery highlights a growing supply-chain threat: malicious code can execute simply when a compromised dependency is imported, including indirectly through another package.
Malicious Code Activated at Import Time
According to the researchers, the affected packages contain working functionality, making them more difficult to identify as malicious at first glance.
The danger is hidden inside the package structure. When the module is loaded, the malicious code can locate a bundled binary, make it executable and launch it as a detached background process. This means execution does not necessarily depend on a traditional installation hook. In some cases, importing the package anywhere in the dependency chain may be enough to trigger the payload.
The identified packages include names such as:
streak-metrics-mathkit-map-vimstreak-map-cachestreak-map-kitmap-streak-kitstreak-cache-mapstreak-calc-metrics
The full campaign includes 14 packages designed to disguise the malicious payload behind apparently harmless utility functions.
RedC2 4.0 Targets Linux Systems
The hidden component is a Linux implant associated with RedC2 4.0, a command-and-control framework designed for post-exploitation activities.
Once deployed, the Linux component can provide attackers with capabilities including:
- remote shell access,
- system discovery,
- file operations,
- data collection,
- credential theft,
- payload execution,
- persistence,
- network tunneling and proxying.
The malware can also collect sensitive information such as SSH keys and browser credentials before communicating with its command-and-control infrastructure.
AI Is Now Part of the Command-and-Control Layer
One of the most interesting aspects of RedC2 4.0 is its AI-assisted component called Red Agent.
The framework includes an LLM-backed layer intended to translate natural-language requests into commands that can be executed through the RedC2 infrastructure. This can lower the technical barrier for operators by allowing more complex post-exploitation tasks to be orchestrated through higher-level instructions rather than manually building every command sequence.
This is another example of how artificial intelligence is becoming part of the offensive cybersecurity ecosystem.
AI is no longer used only to generate phishing emails or automate simple tasks. It is increasingly being integrated into tooling that can support reconnaissance, command execution and post-compromise operations.
Why npm Supply-Chain Attacks Are So Dangerous
Modern applications rely heavily on open-source dependencies.
A single project may directly depend on dozens of packages, while those packages themselves may pull in hundreds or even thousands of additional dependencies.
This creates a significant attack surface.
Developers may carefully review the code they write themselves while having little visibility into every dependency further down the software supply chain.
The current RedC2 campaign is particularly concerning because the malicious payload can execute when the affected module is loaded. A developer or organization may therefore be exposed through a dependency they never intentionally selected.
Recent npm incidents show that supply-chain attacks are becoming increasingly sophisticated. Researchers have also documented self-propagating malware campaigns affecting hundreds of npm packages, demonstrating how compromised publishing ecosystems can rapidly spread malicious code across the developer community.
The Real Problem: Trust
Open-source software depends heavily on trust.
Developers trust:
- package maintainers,
- publishing accounts,
- package registries,
- dependencies,
- transitive dependencies,
- automated CI/CD pipelines.
Attackers understand this.
Instead of attacking a well-protected organization directly, compromising a widely used dependency can provide access to a much larger number of potential targets.
The npm ecosystem has already experienced multiple supply-chain compromises in which malicious code was introduced through compromised packages or publishing credentials.

How Organizations Can Reduce the Risk
There is no single solution that completely eliminates supply-chain attacks, but several practices can significantly reduce exposure.
1. Audit dependencies
Organizations should regularly review both direct and transitive dependencies.
Unused packages should be removed, and unnecessary dependencies should not be introduced simply for small convenience functions.
2. Pin and review versions
Automatically accepting new versions of every dependency increases risk.
Critical production environments should use controlled dependency updates and testing before deployment.
3. Monitor package behavior
Security teams should pay attention to unusual lifecycle scripts, unexpected binaries, suspicious network activity and dependencies that suddenly change behavior.
4. Protect developer credentials
Compromised maintainer accounts remain a major supply-chain risk.
Multi-factor authentication, short-lived credentials and secure publishing workflows can reduce the chance of unauthorized package releases.
5. Treat dependencies as code
Third-party packages should be considered part of the organization’s attack surface.
A dependency is not automatically trustworthy simply because it is popular or has existed for years.
AI and Supply-Chain Attacks: A New Stage of the Threat
The RedC2 4.0 campaign is notable because it combines two important cybersecurity trends.
The first is the continued growth of software supply-chain attacks.
The second is the integration of AI into offensive tooling.
Together, they create a potentially dangerous combination.
A compromised package can provide the initial access, while AI-assisted command-and-control capabilities may help operators automate or simplify activities after a system has been compromised.
The result is a reminder that the attack surface of modern software development extends far beyond the code written by an organization’s own developers.
Final Thoughts
The discovery of 14 trojanized npm packages delivering the RedC2 4.0 Linux backdoor demonstrates how software supply-chain attacks continue to evolve.
The packages were designed to appear useful and functional while hiding a malicious component capable of providing attackers with extensive access to compromised Linux systems. The addition of an AI-assisted command layer makes the campaign particularly interesting from a cybersecurity perspective.
For developers and organizations, the lesson is clear: trust in the software supply chain can no longer be automatic.
Every dependency is potentially part of the security perimeter.
And as attackers begin combining compromised open-source packages with AI-powered offensive frameworks, dependency security is becoming just as important as securing the application code itself.






