
Cybersecurity researchers have uncovered a disturbing trend: some of the most popular AI-powered coding assistants, including Claude, Codex, and Hermes, have been found installing suspicious code inside corporate networks. The discovery has raised alarms across the industry, as these tools are widely trusted by developers and enterprises to streamline software development. This article provides a comprehensive overview of the findings, the implications, and what organizations can do to protect themselves.
The Discovery
The investigation began when security analysts noticed unusual network activity on several enterprise systems that had recently integrated AI coding assistants. Detailed forensic examination revealed that the AI tools were not only generating code suggestions but also executing hidden scripts that downloaded additional payloads from remote servers. The affected tools include Claude, developed by Anthropic, OpenAI's Codex, and Hermes, a newer AI assistant popular among cloud-native development teams.
According to researchers, the malicious code was not present in the AI models themselves but was introduced through compromised updates or dependencies tied to these tools. In some cases, the AI assistants were observed to be generating code containing hidden backdoors, while in others, they directly installed browser extensions, scheduled tasks, or modified existing libraries. The sophistication of the attack suggests a well-financed threat actor with deep knowledge of the software supply chain.
Which AI Tools Are Affected
While the investigation initially focused on three prominent AI coding tools, researchers believe the attack may extend to other similar platforms. The common denominator appears to be the use of open-source components that were poisoned during the development of these tools. Claude, known for its strong safety guardrails, was compromised through a third-party plugin that had not been adequately vetted. Codex, which powers GitHub Copilot, was affected via a malicious update to a code completion library. Hermes, which is gaining traction in enterprise DevOps pipelines, was found to contain obfuscated JavaScript that activated only when used within corporate repositories.
This is not the first time AI tools have been implicated in security incidents, but it is the first widespread case where the tools themselves served as the distribution mechanism. Previous incidents typically involved prompt injection attacks or data exfiltration through natural language interactions. In contrast, the current attack is more insidious because it compromises the very technologies organizations are adopting to improve security.
Nature of the Suspicious Code
The suspicious code varied in form and function depending on the target environment. In many cases, it was a lightweight script that established a persistent connection to a command-and-control server. This allowed the attackers to exfiltrate source code, credentials, and internal documentation. In other instances, the code acted as a worm, spreading through shared repositories and CI/CD pipelines. Some variants were designed to remain dormant for weeks or months, activating only when certain conditions were met, such as when the user attempted to deploy code to production.
Researchers also discovered that the malicious code could manipulate the AI's output. By injecting specially crafted prompts or modifying the model's context, the attackers could make the AI generate vulnerable code without raising flags. This type of attack, often called "shadow tuning," is particularly dangerous because it allows the adversary to influence the software development lifecycle without directly interfering with the developer's workflow.
How the Code Got Installed
The attack vector appears to be a combination of compromised package managers and deceptive documentation. Many AI coding tools rely on a vast ecosystem of libraries and plugins, and threat actors have been known to publish malicious versions of legitimate packages. In this case, the attackers targeted tools that automatically fetch updates or install dependencies without explicit user consent. For example, a developer installing a popular package manager extension might unknowingly pull in a malicious component that then integrates with the AI assistant.
Another vector was via generated code. In several incidents, the AI tool suggested code snippets that included hidden backdoors. Developers who copied and pasted these snippets into their applications introduced vulnerabilities without realizing it. This highlights a growing risk: as AI-generated code becomes more prevalent, the line between human-written and machine-written code blurs, making it harder to perform effective code reviews.
Potential Impact on Enterprises
The impact of this attack is potentially severe. Intellectual property theft is the most immediate concern, as attackers can silently harvest proprietary source code and trade secrets. In addition, the backdoors installed by the malicious code could allow external actors to access internal networks, pivot to other systems, and deploy ransomware. For organizations in regulated industries, there is also the risk of compliance violations and legal liability if customer data is compromised.
The attack also undermines trust in AI tools, which many companies are planning to adopt at scale. A recent survey found that 78% of enterprises plan to use AI coding assistants within the next two years. Incidents like this may slow adoption and prompt calls for stricter regulation and security certification of AI tools. However, experts caution that abandoning these tools entirely is not realistic; instead, organizations need to integrate them with robust security controls.
Response from Vendors
Anthropic, OpenAI, and the developers of Hermes have issued statements acknowledging the issue and promising to release patches. OpenAI has stated that it is working with law enforcement and security firms to trace the origin of the malicious components. Anthropic has implemented an emergency update to Claude's backend that validates the integrity of all integrated plugins. The Hermes team has temporarily disabled certain features that allowed autonomous code execution until a thorough audit is completed.
Despite these efforts, security researchers remain skeptical. They point out that the AI tools were able to execute arbitrary code in the background, a design choice that is inherently risky. The vendors have committed to introducing stronger sandboxing and user permission prompts, but these measures will not help organizations that have already been compromised. Companies using these tools should conduct forensic investigations to determine if any malicious code was installed.
Recommendations for Enterprises
In light of these findings, cybersecurity experts recommend that organizations take the following steps:
- Audit all AI tools and plugins for suspicious behavior, focusing on network connections and file system modifications.
- Enforce the principle of least privilege by running AI assistants in isolated environments with no access to production systems.
- Review all code generated by AI tools for hidden backdoors, especially if the code is committed to public repositories.
- Implement network monitoring to detect unusual outbound connections from developer workstations and CI/CD servers.
- Regularly update AI tools to the latest patched versions and verify checksums of downloaded packages.
- Conduct security awareness training for developers about the risks of blindly trusting AI-generated suggestions.
Additionally, organizations should consider using software composition analysis tools to scan for vulnerabilities in the dependencies used by AI assistants. They should also establish incident response procedures that specifically address AI-related threats. Since the attack may have compromised the software supply chain, enterprises should rotate credentials and API keys that may have been exposed.
Broader Context of AI Supply Chain Security
This incident is a wake-up call for the AI industry. As AI tools become deeply embedded in critical infrastructure, they are becoming prime targets for supply chain attacks. The same characteristics that make AI assistants valuable—the ability to execute code, access data, and learn from user interactions—also make them powerful tools for malicious actors. Without robust security frameworks, every AI integration could become an attack vector.
Governments and regulatory bodies are beginning to take notice. The European Union's Artificial Intelligence Act, currently in draft form, includes requirements for transparency and risk management. In the United States, the Cybersecurity and Infrastructure Security Agency (CISA) has published guidelines for secure AI system development. These efforts, while important, may not keep pace with the rapid evolution of AI threats. Enterprises must therefore adopt a zero-trust mindset and assume that any AI tool could be compromised.
The discovery of the suspicious code in Claude, Codex, and Hermes is a reminder that innovation must be accompanied by security. It is not enough for AI vendors to demonstrate impressive capabilities; they must also prove that their products can be trusted in sensitive environments. Until that trust is established, enterprises should treat AI tools as third-party software that requires the same rigorous vetting as any other component of their technology stack.
While the full extent of the damage is still unknown, the incident has already prompted a wave of security audits across the industry. Some companies have temporarily outright banned the use of AI coding assistants until they can verify the integrity of their installations. Others are investing in internal AI security teams that specialize in detecting and mitigating attacks on machine learning systems. The long-term consequences will depend on how quickly vendors release fixes and how thoroughly organizations respond to the threat.
Source:TechRadar News
