AG2’s SandboxShellTool offered an allowlist and a read-only option, but its string filter checked only selected shell separators. A newline was still valid input to sh -c. An untrusted tool argument could therefore begin with an approved command and execute another command on the next line. The advisory confirms that the LocalEnvironment execution path can…
Inspect the ClaimsCase · DiggingBeagle record
A newline bypassed AG2 shell allowlists and read-only mode
AG2’s SandboxShellTool offered an allowlist and a read-only option, but its string filter checked only selected shell separators. A newline was still valid input to sh -c. An untrusted tool argument could therefore begin with an approved command and execute another command on the next line.
Public disclosure: Nov 10, 2026
Affected AG2 SandboxShellTool deployments where attacker-influenced text can reach the command argument; no known exploited victim.
Assessment profile
Assessment method- Setting
- research demonstration
- Exploitation
- demonstrated
- Evidence
- Grade B
- Remediation
- patch available
- AI role
- AGAINST AI
Basis and provenance
The upstream GHSA describes an executable newline bypass and fixed AG2 1.1.1; no identified production victim or demonstrated agent-origin prompt-injection campaign. An impact band is not assigned because the available Claims do not establish a comparable verified severity or quantified harm.
Assessed Nov 12, 2026 using diggingbeagle.assessment/1.
Evidence basis: CLM-R239-055-CORE · AG2 SandboxShellTool allowlist and read-only restriction bypassed through unfiltered newline before sh -c
At a glance
The observed effect is limited to the study or disclosed setting; deployment and independent impact remain unestablished.
Read the implicationsWhich downstream agent workflows exposed the argument and the safety of all legacy autogen distributions remain unresolved.
Limits and uncertaintyFull account
AG2’s SandboxShellTool offered an allowlist and a read-only option, but its string filter checked only selected shell separators. A newline was still valid input to sh -c. An untrusted tool argument could therefore begin with an approved command and execute another command on the next line.
The advisory confirms that the LocalEnvironment execution path can invoke a host subprocess rather than an isolated container. AG2 1.1.1 is listed as patched; the legacy package has separate status. A model being persuaded to supply the argument is a plausible route, not proof of a real prompt-injection incident. The security question is whether the executor constrains effects after the agent text has been accepted.
A filter that recognizes some shell metacharacters but misses a line separator does not bind the program that actually executes. Unlike ordinary prompt injection, the confirmed weakness is the deterministic executor parsing path, even though indirect injection is a plausible way to supply its input. Isolation and structured argument execution protect a different boundary than a model instruction to avoid unsafe commands.
Mechanism and trust boundary
- 01
An agent or caller supplies a command beginning with a permitted allowlist prefix.
- 02
An embedded newline survives the filter and becomes a second command when parsed by the shell.
- 03
The executor runs with the LocalEnvironment process privileges, possibly on the host.
Claims & evidence
CLM-R239-055-COREGHSA-2h4w-29cv-2cmv documents that CR/LF characters bypassed SandboxShellTool command filtering and allowed a second shell command despite configured allowlist or readonly mode.supported
Basis: reported finding
- supportsAG2 SandboxShellTool allowlist and read-only restriction bypassed through unfiltered newline before sh -cprimary disclosure
Security advisory description, shell-parser contrast and patched release
Implications
The observed effect is limited to the study or disclosed setting; deployment and independent impact remain unestablished.
Controls and mitigations
- Avoid sh -c string concatenation; use structured process arguments, independent allowlisted binaries, OS-level restrictions and patched AG2 builds.
Unknowns and contradictions
- Which downstream agent workflows exposed the argument and the safety of all legacy autogen distributions remain unresolved.
Sources and citation
Material revision history
- Nov 12, 2026 · Published version · first publication · revision 241