Threat Advisory

Newline Injection in AG2 SandboxShellTool Enables Arbitrary Command Execution

Threat: Vulnerability
Targeted Region: Global
Targeted Sector: Technology & IT
Criticality: High
[subscribe_to_unlock_form]

EXECUTIVE SUMMARY:

CVE-2026-113663 with a CVSS score of 8.8 is a command injection vulnerability in the AG2 SandboxShellTool component, affecting ag2 (pip) versions >= 0.13.2, < 1.1.1 and autogen (pip) versions >= 0.13.2, <= 0.14.1. The flaw occurs in the tool's restricted modes, allowed=[...] and readonly=True, where the shell-operator filter inspects only a single-line set of metacharacters and omits newline and carriage return characters. Because the command string is executed through sh -c, an embedded newline functions as a statement separator, allowing an attacker to append additional commands after an allowed prefix. Exploitation requires a low-privilege network-based interaction with an agent that uses SandboxShellTool, and can be achieved when attacker-controlled content steers the agent through prompt injection or similar input manipulation. With the default LocalEnvironment backend, commands run as host subprocesses rather than in an isolated container, so successful exploitation yields arbitrary host command execution. Business impact includes unauthorized access to sensitive data, modification or destruction of files, installation of malicious software, lateral movement, and disruption of agent-driven operations, potentially leading to significant confidentiality, integrity, and availability losses.

RECOMMENDATION:

We recommend you to update ag2 to version 1.1.1.[/subscribe_to_unlock_form]

EXECUTIVE SUMMARY:

CVE-2026-113663 with a CVSS score of 8.8 is a command injection vulnerability in the AG2 SandboxShellTool component, affecting ag2 (pip) versions >= 0.13.2, < 1.1.1 and autogen (pip) versions >= 0.13.2, <= 0.14.1. The flaw occurs in the tool's restricted modes, allowed=[...] and readonly=True, where the shell-operator filter inspects only a single-line set of metacharacters and omits newline and carriage return characters. Because the command string is executed through sh -c, an embedded newline functions as a statement separator, allowing an attacker to append additional commands after an allowed prefix. Exploitation requires a low-privilege network-based interaction with an agent that uses SandboxShellTool, and can be achieved when attacker-controlled content steers the agent through prompt injection or similar input manipulation. With the default LocalEnvironment backend, commands run as host subprocesses rather than in an isolated container, so successful exploitation yields arbitrary host command execution. Business impact includes unauthorized access to sensitive data, modification or destruction of files, installation of malicious software, lateral movement, and disruption of agent-driven operations, potentially leading to significant confidentiality, integrity, and availability losses.

RECOMMENDATION:

We recommend you to update ag2 to version 1.1.1.[emaillocker id="1283"]

REFERENCES:

The following reports contain further technical details:

[/emaillocker]
crossmenu