Summary
Omnigent allows an authenticated user with session edit access to replace a shared or template agent without confirming that the agent is session-bound. By attaching an attacker-controlled stdio MCP server, the user may cause later sessions to execute commands with the permissions of the Omnigent runner.
Affected context
The vulnerability occurs in Omnigent deployments that use shared or template agents and expose the session agent replacement endpoint to authenticated users with edit permissions. The authorization check verifies session-level edit access but may not enforce ownership or binding requirements for the selected agent, allowing a shared agent bundle to be modified and reused by subsequent sessions.
Exploit preconditions
- Attack surface: Authenticated HTTP API for session agent management
- Required access: A valid account with edit permission for a target session
- Trigger point: Assignment or replacement of an agent through the session endpoint, followed by use of that shared agent
- Why exploitation is possible: Authorization does not sufficiently distinguish session-bound agents from shared or template agents whose
agent.session_idis unset, allowing an executable MCP configuration to persist into later sessions
Why this happens
The underlying bug is an authorization and object-scope validation failure. The endpoint checks whether the caller can edit a session but does not verify that the selected agent is appropriately bound to that session before allowing replacement of a shared agent bundle. Because stdio MCP server configuration can launch external commands, attacker-controlled configuration is treated as executable behavior, mapping to CWE-94, Improper Control of Generation of Code.
Potential impact
- The attacker may execute commands with the Omnigent runner process permissions.
- The attacker could read workspace files, credentials, and other accessible data.
- Internal services or connected environments may be probed or accessed.
- Agent workflows and generated results may be manipulated or poisoned.
- Runner availability could be disrupted.
- Compromise could spread through shared agent configurations or connected tooling.
General mitigation guidance
Mitigation generally focuses on enforcing object-level authorization and
preventing shared configuration from becoming an untrusted execution path.
Common defensive patterns include:
- Require explicit ownership and scope validation for every agent assignment.
- Reject shared or template agents when their binding state is ambiguous.
- Separate editable session configuration from globally reusable agent definitions.
- Permit only approved MCP server types and commands through an allowlist.
- Treat stdio command configuration as privileged executable content.
- Run agent processes with least privilege, isolated workspaces, and restricted network access.
- Avoid exposing credentials or sensitive files to runner processes.
- Require review or controlled publication before shared agent bundles become available to later sessions.
How teams detect issues like this
Organizations can detect this class of issue through:
- Static analysis and code review checks for authorization decisions that omit object ownership or scope.
- Tests covering shared, template, unset, and session-bound agent identifiers.
- Policy checks that flag user-controlled MCP server command or stdio configuration.
- Runtime auditing of agent replacements, shared-bundle changes, and external process launches.
- Alerts for unexpected commands, child processes, or network connections created by runner processes.
- Automated security review tools that identify missing authorization predicates and unsafe command execution paths.

