Cyber Security News

MS-Agent Vulnerability Exposes AI Agents to Remote Hijacking, Granting Full System Control

A critical vulnerability has been discovered in the MS-Agent framework, a lightweight software tool used to build and run autonomous AI agents.

Tracked as CVE-2026-2256, this command injection flaw allows remote attackers to hijack these AI agents, potentially granting them full control over the underlying computer systems.

MS-Agent is designed to help developers create AI agents that can automatically perform tasks and use various digital tools. One of these built-in features is a “Shell tool.”

This tool allows the AI agent to run command-line instructions directly on the host operating system to complete its assigned tasks.

CategoryDetails
CVE IDCVE-2026-2256
Vulnerability TypeCommand Injection / Remote Code Execution (RCE)
Affected SoftwareModelScope MS-Agent Framework
Flawed ComponentShell tool (check_safe() method)

While this feature makes the AI agent very capable, it also creates a significant security risk if the commands are not properly checked before they are executed.

How the Command Injection Flaw Works

Researchers from Carnegie Mellon University told that the vulnerability stems from how the MS-Agent framework handles untrusted input. The software relies on a method called check_safe() to examine commands before they are sent to the Shell tool.

This method uses a “denylist” (a list of forbidden words or symbols) to block dangerous commands.

However, security researchers discovered that this denylist is insufficient. Attackers can use a technique called “prompt injection” to trick the AI agent.

By hiding malicious commands inside harmless-looking text, such as a document the agent is asked to summarize or code it is asked to analyze, attackers can bypass the check_safe() filter.

Because denylists can easily be tricked using different spelling, encoding, or alternative command formats, the malicious instructions slip past the defenses and are executed by the Shell tool.

If successfully exploited, an attacker can execute arbitrary operating system commands on the target machine. The attacker would gain the same level of access as the MS-Agent process itself.

This means a hacker could:

  • Modify or delete important system files.
  • Steal sensitive data that the AI agent has access to.
  • Install malware or backdoors for long-term access.
  • Use the compromised machine to attack other computers on the same network.

Mitigation and Defense Strategies

During the coordination process, the vendor (ModelScope) did not provide a patch or official statement.

Without an official fix, organizations using MS-Agent must take immediate protective measures.

Security experts strongly recommend deploying MS-Agent only in strictly controlled environments where all input data is verified and trusted.

Agents that require shell execution abilities should be placed in secure “sandboxes” or run with the absolute minimum permissions necessary (least-privilege).

Furthermore, developers should consider replacing fragile denylist filters with strict allowlists, which only permit specifically approved commands to run.

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

1 day ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

2 days ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

2 days ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

2 days ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

2 days ago