Summary
Omnigent contains a path traversal vulnerability in session-scoped agent bundles, where an authenticated user can supply an absolute or traversal-containing working-directory value. On affected runners, this may let agent tools read, modify, or execute commands against files and environment secrets outside the intended workspace.
Affected context
The issue occurs in Omnigent runner environments that accept user-controlled agent bundles and do not constrain the os_env.cwd value to an approved workspace. Risk is higher when OMNIGENT_RUNNER_WORKSPACE is unset, because the supplied path may become the trusted environment root used by file and shell tools.
Exploit preconditions
- Attack surface: Authenticated agent-bundle upload or session creation
- Required access: A valid account with permission to upload or configure a session-scoped agent bundle
- Trigger point: Runner initialization and subsequent use of file or shell tools
- Why exploitation is possible: The working-directory value is preserved without confinement, and later boundary checks trust the attacker-selected path as the workspace root
Why this happens
The vulnerability results from inadequate canonicalization and validation of a user-controlled filesystem path. Omnigent stores os_env.cwd verbatim, permits absolute or traversal-containing values, and may use the resolved path as both the environment root and copy source. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because filesystem operations intended to remain within a workspace can be redirected outside that directory.
Potential impact
- Sensitive files and environment secrets could be disclosed
- Runner files could be overwritten or deleted
- Shell tools could execute commands in an unintended directory
- Agent sessions could affect other tenants or workloads, depending on runner privileges
- Compromised runner credentials could enable further lateral movement
General mitigation guidance
Mitigation generally focuses on enforcing the workspace boundary independently of user-provided paths.
Common defensive patterns include:
- Resolve and canonicalize paths before authorization checks
- Reject absolute paths and traversal components in untrusted working-directory values
- Bind agent sessions to a server-selected, per-session workspace
- Verify that every resolved path remains beneath an immutable trusted root
- Avoid using attacker-controlled paths as both validation roots and operation targets
- Run runners with least-privilege identities and minimal filesystem and secret access
- Keep sensitive credentials outside directories reachable by agent tools
How teams detect issues like this
Organizations can look for:
- Static analysis rules identifying unsanitized path values passed to
chdir,copytree, file APIs, or shell environments - Code review signals where user-controlled paths define validation roots or filesystem boundaries
- Tests covering absolute paths, parent-directory traversal, symlinks, and path canonicalization
- Runtime policy enforcement that restricts runner filesystem access to per-session workspaces
- Audit events for agent bundles containing suspicious working-directory values or access outside approved roots
Automated security review tools may help identify path-flow and boundary-validation weaknesses during development.

