Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessInfluence agent via indirect prompt injection
-
DeliveryCraft allowed command with embedded newline
-
ExploitBypass allowlist/readonly filter check
-
Executionsh -c executes injected statement
-
ImpactArbitrary code runs on host as agent process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires an agent using SandboxShellTool in one of its restricted modes - allowed=[...] (explicit prefix allowlist) or readonly=True (implicit READONLY_COMMANDS allowlist) - on the default LocalEnvironment() backend, which runs commands as real host subprocesses with no isolation. The attacker must be able to influence the command argument the agent emits, either directly or through indirect prompt injection via content the model processes; the actual bypass is a single embedded newline (\n) or carriage return (\r), which ShellAdapter._filter / contains_shell_operator do not treat as a shell operator even though sh -c treats it as a statement separator. Limiting factors: only the allowed=/readonly= restricted modes are affected (the 'blocked' mode is explicitly not a security boundary), the SandboxShellTool must be enabled with a shell-invoking backend, and PR:L means some level of access to the configured agent is needed. Affected versions: ag2 0.13.2 up to (not including) 1.1.1 and autogen 0.13.2 through 0.14.1. The complete fix is upgrading to ag2 1.1.1, which runs restricted-mode commands as a checked argv without a shell; autogen is listed as not yet patched. |
| Impact | Signals mostly align toward meaningful priority but stop short of emergency. The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, base 8.8 HIGH) describes a low-complexity, low-privilege path to full confidentiality/integrity/availability loss, consistent with CWE-78/CWE-184 arbitrary command execution on the host. The vuln.today decision label is 'this_week', indicating near-term but not immediate (act_now/emergency) urgency. A public proof-of-concept is present in the GHSA advisory and was verified against the real filter module on the main branch, raising practical exploitability above a theoretical finding. Two key signals are MISSING from the input: there is no EPSS score provided and no CISA KEV entry, so this is NOT confirmed actively exploited - exploitation status is 'no public exploit identified as actively used in the wild, though a verified PoC reference exists.' The PR:L in the vector reflects that an attacker must reach an agent configured with SandboxShellTool restricted mode; however, because tool arguments are LLM-generated, indirect prompt injection via attacker-supplied content (a fetched document or tool output) can supply the malicious newline without the operator authoring it, which raises real-world reachability beyond what PR:L alone suggests. Net: a genuine high-severity issue for deployments using the affected feature, warranting prompt patching, but not a mass-exploitation emergency on current evidence. |
| Exploit ScenarioDerived | An AG2/AutoGen agent is configured with SandboxShellTool(readonly=True) or allowed=[...] on the default LocalEnvironment backend, believing those modes constrain it to safe commands. An attacker plants content the agent processes (e.g. a web page or document via indirect prompt injection) that steers the model to emit a command like 'cat report.txt\nrm -rf /data'; the newline passes the allowlist/operator filter and sh -c executes the injected second statement on the host. A public PoC in the GHSA advisory demonstrates the filter bypass and that sh -c runs both statements. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 05, 2026
Command injection in the AG2 agent framework's SandboxShellTool lets an embedded newline or carriage return slip past the allowed=[...] and readonly=True restrictions, so a command that passes the prefix check is still handed to sh -c and executed as a second, arbitrary statement. Affected are the ag2 package from 0.13.2 up to (but not including) 1.1.1 and the autogen package from 0.13.2 through 0.14.1, which the advisory lists as not yet patched; impact is highest with the default LocalEnvironment backend, where the injected statement runs as a host subprocess with the agent process's privileges. A proof-of-concept is published alongside the GitHub advisory (module-level reproduction of the filter bypass), but no CISA KEV listing or confirmed in-the-wild exploitation was reported at time of analysis.
RemediationAI
Upgrade the ag2 package to 1.1.1, the version named as the fix, which makes restricted mode run a checked argv without sh -c so newlines and other separators lose all meaning; see the release at https://github.com/ag2ai/ag2/releases/tag/v1.1.1, the fix commit https://github.com/ag2ai/ag2/commit/3cd86726bb731eb11d6270f0ef9e50e42b5abb39 and the advisory https://github.com/ag2ai/ag2/security/advisories/GHSA-2h4w-29cv-2cmv. No patched autogen release is listed, so autogen 0.13.2 through 0.14.1 deployments should migrate to ag2 1.1.1 rather than wait for a backport. Where upgrading cannot be done immediately, stop treating allowed=[...] or readonly=True as a security boundary on the LocalEnvironment backend: move the SandboxShellTool behind a containerized/remote sandbox backend so any injected statement is confined away from the host (trade-off: additional infrastructure and per-command latency), or keep the agent process running under a low-privilege account with restricted filesystem reach so a successful second statement gains little (trade-off: reduced functionality, does not prevent execution itself). Note that the 'blocked' list is explicitly documented as not a security boundary and is not a substitute for the fix.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is a shell metacharacter filtering gap (CWE-78 command injection, also classified CWE-184 incomplete denylist) in ag2/tools/sandbox/filter.py and ag2/tools/sandbox/adapter/shell.py. ShellAdapter._filter applies the same allowlist branch for both restricted modes: an explicit allowed=[...] prefix list and readonly=True, which simply substitutes the built-in READONLY_COMMANDS list. Validation has two parts - matches() checks only that the command string begins with an allowed pattern followed by a space or end-of-string, and contains_shell_operator() checks membership in _SHELL_OPERATORS, which enumerates ">", ">>", "|", ";", "&&", "||", "`" and "$(" but not newline or carriage return. Because the raw, unvalidated remainder of the string is then passed as ["sh", "-c", command], a POSIX shell treats an embedded \n exactly like a statement separator, executing both statements. The advisory notes that commands generated by the model can be steered by any text the agent processes (fetched documents, tool output), making the flaw reachable through indirect prompt injection rather than only by the agent's operator. The upstream fix (commit 3cd86726bb731eb11d6270f0ef9e50e42b5abb39) is structural rather than enumerative: restricted mode now parses the command with shlex.split (split_command), matches allowlist entries against the resulting argv (matches_argv), and executes that argv without invoking a shell, so redirection, chaining, substitution and statement separators are inert by construction; it also removes find, file and git from the default readonly list because of their write/exec options, and adds \n, \r, <, & to the rejected operator set for clearer error messages.
Know when Ag2 gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Network-reachable agent (AV:N), reliable newline bypass (AC:L), requires access to a configured restricted-mode tool so PR:L not PR:N, no user interaction, full host CIA impact in the agent's process scope.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Technical POC Analysis
CWE-78 (with CWE-184, incomplete denylist).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
The AG2 agent framework contains a high-severity command injection flaw that allows attackers to bypass sandbox restrictions and execute arbitrary commands on the host system. Organizations using this framework for AI agent development may face unauthorized access, data breaches, or system compromise, particularly if agents interact with untrusted inputs.
Apply vendor patch for ag2 (upgrade to 1.1.1+); for autogen, no patch is available-migrate to ag2 1.1.1+ or enforce strict input sanitization and run agents in isolated containers with minimal privileges.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
EUVD-2026-117877
GHSA-2h4w-29cv-2cmv
NVD
CVE.org
EPSS
Exploit-DB