{"id":"CVE-2026-62677","aliases":["CVE-2026-62677","GHSA-p8rw-8qj3-hf33","PYSEC-2026-3875"],"related":[],"kind":"vulnerability","state":"published","title":"Omnigent: Unvalidated os_env.cwd in agent bundle yields arbitrary host filesystem access on runners without OMNIGENT_RUNNER_WORKSPACE","summary":"Omnigent is an open-source AI agent framework and meta-harness for orchestrating coding agents. Prior to 0.3.0, an authenticated user can upload a session-scoped agent bundle with an absolute or traversal-containing os_env.cwd value because omnigent/spec/parser.py stores the value verbatim and omnigent/spec/validator.py does not constrain it. On a runner where OMNIGENT_RUNNER_WORKSPACE is unset, omnigent/runner/resource_registry.py preserves the attacker-controlled path and omnigent/inner/os_env.py uses the resolved path as the environment root and copytree source. The _assert_within_cwd check then treats that attacker-selected root as trusted, allowing sys_os_read, write, edit, and shell tools to access runner files and environment secrets outside the intended workspace. This issue is fixed in version 0.3.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Omnigent is an open-source AI agent framework and meta-harness for orchestrating coding agents. Prior to 0.3.0, an authenticated user can upload a session-scoped agent bundle with an absolute or traversal-containing os_env.cwd value because omnigent/spec/parser.py stores the value verbatim and omnigent/spec/validator.py does not constrain it. On a runner where OMNIGENT_RUNNER_WORKSPACE is unset, omnigent/runner/resource_registry.py preserves the attacker-controlled path and omnigent/inner/os_env.py uses the resolved path as the environment root and copytree source. The _assert_within_cwd check then treats that attacker-selected root as trusted, allowing sys_os_read, write, edit, and shell tools to access runner files and environment secrets outside the intended workspace. This issue is fixed in version 0.3.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nAn authenticated, non-admin user can obtain **arbitrary host-filesystem read/write** (and host environment-secret disclosure) on an Omnigent **runner** by uploading an agent bundle whose `os_env.cwd` points outside any intended workspace (e.g. `/` or `/home/<victim>`). The `cwd` field is taken **verbatim** from the bundle with no validation, normalization, or boundary check anywhere in the spec pipeline.\n\nThis is a **different sink** from GHSA-jrrm-9hc7-2v3h (CWE-94, shared-agent bundle overwrite -> stdio MCP RCE). It shares the bundle-upload *vector* but is reached through the user's **own** session-scoped agent and is **not** addressed by that advisory's proposed shared-agent guard.\n\n### Preconditions\n\n- Runner realizes a session-scoped uploaded bundle **without** `OMNIGENT_RUNNER_WORKSPACE` set. When that env var is set (CLI- and host-launched sessions set it), the spec `cwd` is overridden and the attack is neutralized — so this is deployment-gated, not universal.\n- Attacker is any authenticated user (no admin scope; `_require_user` only checks identity). No shared-agent overwrite needed.\n\n### Details (verified against code)\n\n1. **Parse — no validation.** `omnigent/spec/parser.py:696` stores `cwd=str(cwd_raw)` verbatim. Absolute paths (`/`, `/etc`), `../..`, etc. are all accepted. The `sandbox.type` is likewise author-chosen and `\"none\"` is legal.\n2. **Validate — cwd unconstrained.** `omnigent/spec/validator.py` `_validate_os_env` checks only fork/scratch/egress combinations; it never references `cwd` (the sole mention, line ~526, is a comment). No boundary is applied to the cwd itself. The boundary in `server/schemas.py` validates a *caller-supplied workspace against* the spec cwd (treating the author cwd as trusted) and only for host-launched sessions — it does not bound the cwd.\n3. **Sink.** `omnigent/inner/os_env.py:890` sets `cwd = Path(spec.cwd or os.getcwd()).resolve(strict=False)` as the environment root; `os_env.py:934` does `shutil.copytree(src=cwd, ...)` when `fork=true`. All agent file/shell tools are bounded by `_assert_within_cwd` (`os_env.py:1040`), which checks `resolved.relative_to(cwd)` — but since **cwd is attacker-controlled**, `cwd=/` makes the entire host filesystem in-bounds for read and write; `fork=true` with `cwd=/home/victim` copies that tree into the agent-readable workspace.\n4. **Decisive gate.** `omnigent/runner/resource_registry.py:648-654`: `cwd = default_cwd` only when `self._runner_workspace is not None or spec_os_env.cwd in (None, \".\", \"./\")`; otherwise `cwd = spec_os_env.cwd` (the attacker's absolute path). So `OMNIGENT_RUNNER_WORKSPACE` is the only thing standing between the spec and the host FS — and it is an operational control, not an in-code guard. A code comment at `tool_dispatch.py:~4207` claims cwd \"is treated as a boundary at session-create time,\" which is not true on this path.\n\n### Attack path\n\n1. Authenticated user sends `POST /v1/sessions` (multipart) with an agent bundle whose `config.yaml` contains:\n   ```yaml\n   os_env:\n     cwd: \"/\"            # or /home/<victim>, with fork: true for one-shot exfil\n     sandbox: { type: none }\n   ```\n2. On a runner without `OMNIGENT_RUNNER_WORKSPACE`, the agent's `sys_os_read`/`write`/`edit`/`shell` tools now operate over the whole host filesystem, and (sandbox inactive) inherit the runner's full environment — exposing host secrets via e.g. `sys_os_shell(\"env\")`.\n\n### Impact\n\nArbitrary host-filesystem read/write and runner-environment secret disclosure, available to any authenticated user on an affected deployment. High severity (deployment-conditional).\n\n### Suggested fix\n\nAdd a control on the `cwd` field itself in `omnigent/spec/_validate_os_env` (and/or at parse): reject absolute paths and `..` traversal, and require `cwd` to resolve within the runner workspace / an allow-listed root. Do not rely on `OMNIGENT_RUNNER_WORKSPACE` being set as the sole defense. Consider also disallowing bundle-author `sandbox.type: none` for server-realized (non-CLI) sessions.\n\n### Related\n\nGHSA-jrrm-9hc7-2v3h (same bundle-upload vector, different sink; that fix does not cover this).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Omnigent es un framework de agente de IA de código abierto y un meta-arnés para orquestar agentes de codificación. Antes de la versión 0.3.0, un usuario autenticado puede cargar un paquete de agente con ámbito de sesión con un valor os_env.cwd absoluto o que contiene una ruta de acceso transversal porque omnigent/spec/parser.py almacena el valor textualmente y omnigent/spec/validator.py no lo restringe. En un ejecutor donde OMNIGENT_RUNNER_WORKSPACE no está configurado, omnigent/runner/resource_registry.py preserva la ruta controlada por el atacante y omnigent/inner/os_env.py utiliza la ruta resuelta como la raíz del entorno y la fuente de copytree. La verificación _assert_within_cwd luego trata esa raíz seleccionada por el atacante como confiable, permitiendo que las herramientas sys_os_read, write, edit y shell accedan a los archivos del ejecutor y a los secretos del entorno fuera del espacio de trabajo previsto. Este problema se corrige en la versión 0.3.0.","source":"nvd"}],"published":"2026-08-21T17:44:37.312Z","modified":"2026-10-14T19:10:00.297Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 0.3.0","status":"affected"}],"vendor":"omnigent-ai","product":"omnigent","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.3.0"}],"ecosystem":"PyPI","package":"omnigent","purl":"pkg:pypi/omnigent","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.3.0"}],"ecosystem":"PyPI","package":"omnigent","purl":"pkg:pypi/omnigent","source":"pysec"}],"references":[{"url":"https://github.com/omnigent-ai/omnigent/security/advisories/GHSA-p8rw-8qj3-hf33","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/omnigent-ai/omnigent/pull/1417","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/omnigent-ai/omnigent/commit/7ca0cca3c9a65c04c489edf68f0e080424a26868","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/omnigent-ai/omnigent/releases/tag/v0.3.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62677","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/omnigent-ai/omnigent","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/omnigent","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-p8rw-8qj3-hf33","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-08-21T21:00:11.438Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-62677","url":"https://www.cve.org/CVERecord?id=CVE-2026-62677","licence":"CVE Terms of Use","modified":"2026-08-21T21:43:48.824Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p8rw-8qj3-hf33","url":"https://github.com/advisories/GHSA-p8rw-8qj3-hf33","licence":"CC-BY-4.0","modified":"2026-09-10T12:25:35.012Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-62677","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62677","licence":"Public domain","modified":"2026-10-14T19:10:00.297Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3875","url":"https://osv.dev/vulnerability/PYSEC-2026-3875","licence":"CC-BY-4.0","modified":"2026-09-10T12:15:10.115Z"}],"updatedAt":"2026-11-25T22:59:34.806Z","epss":{"score":0.00446,"percentile":0.40528,"date":"2026-12-01T12:00:22.000Z"}}