CVE-2026-113663: AG2: shell filter bypass via newline enables RCE
HIGHAG2's SandboxShellTool allowlist and readonly filters fail to block newline and carriage-return separators, so an attacker who can influence an agent's shell command can append arbitrary statements that run through sh -c. With the default LocalEnvironment backend, the injected code runs as a host subprocess with the agent process's privileges, which gives full confidentiality, integrity and availability impact (CVSS 8.8). The vulnerability is not in CISA KEV, has no public exploit or Nuclei template, and EPSS and downstream dependent data are unavailable, so exploitation likelihood is unquantified. Even so, the bypass is trivial once an attacker can steer agent commands (for example through prompt injection), and teams that rely on allowed=[...] or readonly=True as a security boundary are exposed. Upgrade ag2 to 1.1.1 (or autogen beyond 0.14.1), and move agent shell execution to an isolated sandbox backend instead of the host.
What is the risk?
High. CVSS 8.8 (network, low complexity, low privileges, no user interaction). The filter omits \n and \r, a well-known CWE-184 incomplete denylist, so the bypass is easy to craft. Real-world risk depends on whether untrusted input (user prompts, retrieved documents, tool output) can influence agent commands, which is common in agentic deployments. No known in-the-wild exploitation, no public PoC, and not in KEV, so the near-term likelihood is moderate. Impact is high because the default LocalEnvironment runs commands on the host with the agent process's privileges.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| AutoGen | pip | — | No patch |
Do you use AutoGen? You're affected.
How severe is it?
What is the attack surface?
What should I do?
1 step1) Upgrade ag2 to 1.1.1 or later and autogen to a fixed release past 0.14.1. 2) Until patched, do not rely on allowed=[...] or readonly=True as a security control; disable SandboxShellTool or run agents in containers or VMs with no secrets, a read-only filesystem, a non-root user and restricted egress. 3) Avoid the default LocalEnvironment for untrusted workloads. 4) Reject or sanitize commands containing newline (\n) and carriage-return (\r) characters in a wrapper before they reach the tool. 5) Detection: log and alert on agent-issued shell commands containing newlines or unexpected secondary commands, and on child processes spawned by the agent process that are not in the allowlist. 6) Rotate credentials accessible to any agent host that may have run untrusted input on affected versions. Review the GHSA-2h4w-29cv-2cmv advisory and the fix commit.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-113663?
AG2's SandboxShellTool allowlist and readonly filters fail to block newline and carriage-return separators, so an attacker who can influence an agent's shell command can append arbitrary statements that run through sh -c. With the default LocalEnvironment backend, the injected code runs as a host subprocess with the agent process's privileges, which gives full confidentiality, integrity and availability impact (CVSS 8.8). The vulnerability is not in CISA KEV, has no public exploit or Nuclei template, and EPSS and downstream dependent data are unavailable, so exploitation likelihood is unquantified. Even so, the bypass is trivial once an attacker can steer agent commands (for example through prompt injection), and teams that rely on allowed=[...] or readonly=True as a security boundary are exposed. Upgrade ag2 to 1.1.1 (or autogen beyond 0.14.1), and move agent shell execution to an isolated sandbox backend instead of the host.
Is CVE-2026-113663 actively exploited?
No confirmed active exploitation of CVE-2026-113663 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-113663?
1) Upgrade ag2 to 1.1.1 or later and autogen to a fixed release past 0.14.1. 2) Until patched, do not rely on allowed=[...] or readonly=True as a security control; disable SandboxShellTool or run agents in containers or VMs with no secrets, a read-only filesystem, a non-root user and restricted egress. 3) Avoid the default LocalEnvironment for untrusted workloads. 4) Reject or sanitize commands containing newline (\n) and carriage-return (\r) characters in a wrapper before they reach the tool. 5) Detection: log and alert on agent-issued shell commands containing newlines or unexpected secondary commands, and on child processes spawned by the agent process that are not in the allowlist. 6) Rotate credentials accessible to any agent host that may have run untrusted input on affected versions. Review the GHSA-2h4w-29cv-2cmv advisory and the fix commit.
What systems are affected by CVE-2026-113663?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, multi-agent systems, tool-using LLM agents, code execution sandboxes.
What is the CVSS score for CVE-2026-113663?
CVE-2026-113663 has a CVSS v3.1 base score of 8.8 (HIGH).
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0050Command and Scripting InterpreterAML.T0051LLM Prompt InjectionAML.T0053AI Agent Tool InvocationAML.T0112.000Local AI AgentCompliance Controls Affected
What are the technical details?
Original Advisory
AG2 is an open-source AgentOS. From 0.13.2 until ag2 1.1.1, and from autogen 0.13.2 to 0.14.1, SandboxShellTool configurations using allowed=[...] or readonly=True rely on ShellAdapter._filter and contains_shell_operator in ag2/tools/sandbox/filter.py and ag2/tools/sandbox/adapter/shell.py to validate a command prefix and reject selected shell syntax. The filter omits newline and carriage-return separators, while the accepted raw string is passed to sh -c, allowing an attacker-influenced agent command to execute an additional arbitrary statement. With the default LocalEnvironment backend, the injected statement runs as a host subprocess with the privileges of the agent process and can affect confidentiality, integrity, and availability. This issue is fixed in ag2 version 1.1.1.
Exploitation Scenario
An attacker plants a malicious instruction in a document, web page or ticket that an AG2 agent ingests, steering it to run an allowlisted command such as 'ls' followed by a newline and a second statement. The filter validates only the prefix and rejects listed operators, but misses the newline, so the whole string is passed to sh -c. The injected statement executes on the host and exfiltrates environment variables and API keys to an attacker server, or installs a persistent reverse shell. Even if readonly=True was intended to prevent writes, the attacker can modify files and pivot into connected systems.
Weaknesses (CWE)
CWE-184Incomplete List of Disallowed InputsPrimaryCWE-78Improper Neutralization of Special Elements used in an OS CommandPrimaryCWE-184Incomplete List of Disallowed InputsCWE-78Improper Neutralization of Special Elements used in an OS CommandCWE-184 — Incomplete List of Disallowed Inputs: The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are not allowed by policy or otherwise require other action to neutralize before additional processing takes place, but the list is incomplete.
- [Implementation] Do not rely exclusively on detecting disallowed inputs. There are too many variants to encode a character, especially when different environments are used, so there is a high likelihood of missing some variants. Only use detection of disallowed inputs as a mechanism for detecting suspicious activity. Ensure that you are using other protection mechanisms that only identify "good" input - such as lists of allowed inputs - and ensure that you are properly encoding your outputs.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HReferences
Timeline
Related Vulnerabilities
CVE-2024-291210.0BentoML: RCE via insecure deserialization (CVSS 10)
Same attack type: Code ExecutionCVE-2026-2185810.0n8n: Input Validation flaw enables exploitation
Same attack type: Code ExecutionCVE-2025-512010.0smolagents: sandbox escape enables unauthenticated RCE
Same attack type: Code ExecutionCVE-2025-5952810.0Flowise: Unauthenticated RCE via MCP config injection
Same attack type: Code ExecutionGHSA-vvpj-8cmc-gx3910.0picklescan: security flaw enables exploitation
Same attack type: Code Execution