Skip to content

CVE-2026-113663 AG2: Newline injection in SandboxShellTool bypasses allowed=[...] and readonly=True, enabling arbitrary command execution

HighCVSS 8.8 EPSS 0.56%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: total

Description

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.

Upgrade path

4 packages: 2 fixed.

PackageAffectedFixed inStatus
pypi ag2(PyPI) = 0.13.2; = 0.13.3; = 0.13.4; = 0.14.0 +10 more 1.1.1 Fixed
pypi autogen(PyPI) = 0.13.2; = 0.13.3; = 0.13.4; = 0.14.0 +3 more after 0.14.1 Fixed
ag2ai ag2 = >= 0.13.2, < 1.1.1 No fix listed Versions listed
ag2ai autogen = >= 0.13.2, <= 0.14.1 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
pypi ag2(PyPI) >= 0.13.2, < 1.1.1 1.1.1
pypi ag2(PyPI) = 0.13.2 No fix listed
pypi ag2(PyPI) = 0.13.3 No fix listed
pypi ag2(PyPI) = 0.13.4 No fix listed
pypi ag2(PyPI) = 0.14.0 No fix listed
pypi ag2(PyPI) = 1.0.0 No fix listed
pypi ag2(PyPI) = 1.0.0b0 No fix listed
pypi ag2(PyPI) = 1.0.1 No fix listed
pypi ag2(PyPI) = 1.0.2 No fix listed
pypi ag2(PyPI) = 1.0.3 No fix listed
pypi ag2(PyPI) = 1.0.4 No fix listed
pypi ag2(PyPI) = 1.0.5 No fix listed
pypi ag2(PyPI) = 1.0.6 No fix listed
pypi ag2(PyPI) = 1.1.0 No fix listed
pypi autogen(PyPI) >= 0.13.2, <= 0.14.1 No fix listed
pypi autogen(PyPI) = 0.13.2 No fix listed
pypi autogen(PyPI) = 0.13.3 No fix listed
pypi autogen(PyPI) = 0.13.4 No fix listed
pypi autogen(PyPI) = 0.14.0 No fix listed
pypi autogen(PyPI) = 0.14.1 No fix listed
pypi autogen(PyPI) = 0.14.1rc1 No fix listed
ag2ai ag2 = >= 0.13.2, < 1.1.1 No fix listed
ag2ai autogen = >= 0.13.2, <= 0.14.1 No fix listed

References