AG2: SandboxShellTool command injection (CVE-2026-113663)
The SandboxShellTool in AG2 and AutoGen fails to filter newline characters, allowing attackers to bypass command allowlists and read-only restrictions to execute arbitrary shell commands via CVE-2026-113663.
CVE search metadata
CVE search record: CVE-2026-113663. Severity: high. CVSS: 8.8. EPSS: 0.35%. KEV: no. Product: ag2 (>= 0.13.2, < 1.1.1), autogen (>= 0.13.2, <= 0.14.1). Brief: AG2: SandboxShellTool command injection (CVE-2026-113663). Brief link: https://feed.craftedsignal.io/briefs/2026-11-ag2-shell-injection/
Triage facts
Revision 1- Applicability
- ag2 (>= 0.13.2, < 1.1.1), autogen (>= 0.13.2, <= 0.14.1)
- Evidence
- Unknown
- Severity
- High
- Action
- Elevated
- Sources
- 1 public source
- Freshness
- Revision 1Nov 10, 16:37 UTC
- Vulnerabilities
- 1 CVE
- Source quality
- A1Likely
The SandboxShellTool within the AG2 and AutoGen frameworks contains a command injection vulnerability (CVE-2026-113663) due to insufficient input validation. The tool relies on a denylist of shell operators (e.g., ;, &&, |) to enforce allowed command allowlists and readonly=True modes. Because newline characters (\n, \r) are not included in this denylist, an attacker can embed newlines to chain arbitrary commands. When the tool executes the input using sh -c, the shell treats the newline as a command separator, successfully executing subsequent malicious instructions. This issue is particularly critical when using the LocalEnvironment() backend, which executes commands directly on the host process without containerized isolation.
Impact
Successful exploitation allows for full command execution on the host machine running the agent. This is reachable through indirect prompt injection where an LLM is coerced into providing a command string containing a newline, bypassing intended security boundaries of the sandbox tool.
Recommendation
- Update
ag2to version 1.1.1 or later. - Update
autogento version 0.14.2 or later. - For deployments currently unable to patch, ensure that agents using
SandboxShellTooloperate within strictly isolated environments (e.g., containerized sandboxes) rather than the defaultLocalEnvironment(). - Review agent logs for shell commands containing unexpected newline characters if the underlying application telemetry captures raw tool inputs.
Immediate actions
Patch ag2 to 1.1.1 or later
Threat Hunt
Identify processes spawned by the agent framework containing newline characters in command-line arguments.
Data: Process creation logs (Event ID 1 or equivalent) capturing full CommandLine.
Mitigations
Transition from LocalEnvironment() to containerized sandbox environments for all untrusted agent executions.
CVE-2026-113663