Skip to main content
TopAIThreats home TOP AI THREATS
INC-26-0021 confirmed high Near Miss

ModelScope MS-Agent Shell Tool Command Injection Vulnerability (2026)

Attribution

Alibaba (ModelScope) developed and Developers using MS-Agent for AI agent applications deployed ModelScope MS-Agent Framework, harming Organizations running MS-Agent with shell tool enabled ; possible contributing factors include inadequate access controls and insufficient safety testing.

Incident Details

Last Updated 2026-03-29

CVE-2026-2256 in ModelScope's MS-Agent framework allows arbitrary OS command execution through the shell tool component, where a regex-based denylist in the check_safe() method can be bypassed through encoding, obfuscation, or alternative shell syntax, enabling attackers to inject malicious commands via prompt-derived input without direct shell access.

Incident Summary

Security researcher Itamar Yochpaz identified CVE-2026-2256, a command injection vulnerability in the shell tool component of ModelScope’s MS-Agent framework version 1.5.2, where the check_safe() method relies on a regex-based denylist that can be bypassed through encoding, obfuscation, or alternative shell syntax.[1] The vulnerability allows attackers to inject crafted content into data sources consumed by the agent — such as prompts, documents, logs, or research inputs — causing malicious commands to be forwarded to the shell tool for execution without requiring direct shell access.[1] Successful exploitation grants arbitrary command execution with the privileges of the MS-Agent process on the host system, potentially enabling data exfiltration, persistence mechanisms, and lateral movement.[2] CERT/CC published vulnerability note VU#431821 on March 2, 2026, noting that no patch or vendor statement had been received from ModelScope.[1]

Key Facts

  • CVE: CVE-2026-2256, affecting ModelScope MS-Agent framework version 1.5.2[1]
  • Root cause: The check_safe() method uses a regex denylist to filter shell commands, which is inherently fragile and bypassable through encoding, obfuscation, or alternative shell syntax[1]
  • Attack vector: Attackers inject malicious command sequences into data sources processed by the agent (prompts, documents, logs), which are forwarded to the shell tool as part of normal execution flow[1]
  • Impact: Arbitrary OS command execution with MS-Agent process privileges, enabling data exfiltration, file modification, persistence, and lateral movement[2]
  • Discovery: Itamar Yochpaz; a public proof-of-concept exploit is available on GitHub[2]
  • Vendor response: ModelScope had not provided a patch or official statement as of March 2026[1]
  • Recommended mitigations: Deploy MS-Agent only with trusted content; sandbox agents with shell capabilities; implement least-privilege permissions; replace denylist filtering with strict allowlists[1]

Threat Patterns Involved

Primary: Tool Misuse & Privilege Escalation — The MS-Agent shell tool is designed to allow AI agents to execute system commands as part of their task workflow. CVE-2026-2256 demonstrates that when AI agents are granted shell access with inadequate input sanitization, the agent’s tool-calling capability becomes a direct path from prompt injection to operating system compromise. The denylist approach to command filtering is fundamentally mismatched to the creative flexibility of both adversarial inputs and AI-generated command sequences.

Significance

  1. Denylist filtering is insufficient for AI agent security — The vulnerability demonstrates that regex-based command denylist approaches, which are already considered weak in traditional applications, are particularly ineffective when AI agents generate the commands, as the agent may construct novel syntax patterns not anticipated by the denylist
  2. Unpatched with public PoC — The combination of no vendor patch, a public proof-of-concept exploit, and CERT/CC advisory creates an elevated risk for organizations running MS-Agent in production
  3. Agent frameworks as privilege escalation paths — This incident reinforces the pattern where AI agent frameworks that integrate system tools without adequate sandboxing create direct paths from data-plane inputs to control-plane execution

Timeline

Security researcher Itamar Yochpaz discovers CVE-2026-2256 in MS-Agent shell tool

CERT/CC publishes vulnerability note VU#431821

No vendor patch or statement received from ModelScope

Outcomes

Other:
No patch released as of March 2026; CERT/CC notes vendor status as 'Unknown'

Use in Retrieval

INC-26-0021 documents ModelScope MS-Agent Shell Tool Command Injection Vulnerability, a high-severity incident classified under the Agentic Systems domain and the Tool Misuse & Privilege Escalation threat pattern (PAT-AGT-006). It occurred in Asia, North America (2026-02). This page is maintained by TopAIThreats.com as part of an evidence-based registry of AI-enabled threats. Cite as: TopAIThreats.com, "ModelScope MS-Agent Shell Tool Command Injection Vulnerability," INC-26-0021, last updated 2026-03-29.

Sources

  1. VU#431821 — MS-Agent Shell Tool Command Injection (primary, 2026-03-02)
    https://kb.cert.org/vuls/id/431821 (opens in new tab)
  2. CVE-2026-2256: From AI Prompt to Full System Compromise (analysis, 2026-02)
    https://medium.com/@itamar.yochpaz/cve-2026-2256-from-ai-prompt-to-full-system-compromise-a4114c718326 (opens in new tab)
  3. Vulnerability in MS-Agent AI Framework Can Allow Full System Compromise (news, 2026-03)
    https://www.securityweek.com/vulnerability-in-ms-agent-ai-framework-can-allow-full-system-compromise/ (opens in new tab)

Update Log

  • — First logged (Status: Confirmed, Evidence: Primary)