{"slug": "one-route-had-the-guard-its-sibling-did-not-what-the-omnigent-shared-agent-about", "title": "One Route Had the Guard, Its Sibling Did Not: What the Omnigent Shared-Agent Advisory Teaches About Write-Path Parity", "summary": "A critical vulnerability in Omnigent versions before 0.3.0 (CVE-2026-62674, GHSA-jrrm-9hc7-2v3h) let any authenticated user overwrite a shared template agent via the full-bundle upload route and plant a stdio MCP server that runner sessions would later launch as a subprocess. The dedicated edit endpoint and the mcp_servers_editable flag already blocked MCP changes on shared agents, but the sibling upload route never applied the same session_id guard; version 0.3.0 adds it. The advisory's lesson, per the writeup, is that a protection on one write path protects nothing if another path writes the same record.", "body_md": "**TL;DR:** GitHub advisory GHSA-jrrm-9hc7-2v3h (CVE-2026-62674, critical, published 2026-09-02) describes Omnigent versions before 0.3.0, where a normal authenticated user could overwrite a *shared template agent* and plant a `stdio` MCP server that later runner sessions would start as a subprocess. The interesting part is not the RCE. It is that the product already knew the shared agent must not be MCP-editable: the dedicated edit endpoint refused it, the API reported `mcp_servers_editable` as false, and the sibling full-bundle upload route simply never asked the question. The lesson for anyone building agent platforms is guard parity: a protection on one write path protects nothing if another path writes the same record. Below: what the advisory says, a runnable toy model, a route-parity test that fails before the fix and passes after, and a checklist.\n\nEverything in this section comes from the public advisory text on GitHub ([https://github.com/advisories/GHSA-jrrm-9hc7-2v3h](https://github.com/advisories/GHSA-jrrm-9hc7-2v3h)). The affected package is `omnigent` on pip, vulnerable range `< 0.3.0`, first patched version `0.3.0`, classified CWE-94 (improper control of generation of code).\n\nThe setup has three pieces:\n\n`agent.session_id is None`. Many users create sessions from the same template.` mcp_servers_editable` as false for these agents, so the UI treats them as locked.`PUT /sessions/{session_id}/agent` accepts a full agent bundle. It checks that the caller has edit permission on The attacker needs only a normal account with edit access to one of their own sessions. They upload a bundle whose MCP configuration contains a `stdio` server. A `stdio` MCP server is, by design, a command the runner launches as a local subprocess. The next session created from the poisoned template starts that command with the permissions of the runner process. The advisory lists the consequences you would expect: reading runner-accessible files and credentials, modifying workspace data, pivoting to internal services reachable from the runner, or opening a remote shell if outbound networking is allowed. The suggested fix in the advisory is one line of intent: add the same `session_id is None` guard to the upload route.\n\nNotice what is *not* broken here. Authentication worked. The session permission check worked. The direct edit route worked. Each individual control did its job. The failure is in the relationship between routes.\n\nA guard is attached to a handler, but the rule it enforces is about a *record*. \"Shared agents are not MCP-editable\" is a property of the agent row, and every code path that can change MCP configuration on that row is subject to it. Two things make this hard to keep true over time:\n\nThe permission question and the record question are different questions. The first asks who is calling. The second asks what is being touched. Authorization frameworks that only answer the first leave the second to hand-written checks scattered across handlers.\n\nThere is also a simple probability argument. If each write route carries the guard with probability `p` independently, the chance that all `n` routes carry it is `p^n`. The chart at the top uses that formula. At `p = 0.99` a platform with 12 write routes has all of them guarded only 88.6% of the time. At `p = 0.95` it drops to 54.0%. The numbers are an illustration of compounding, not a measurement of any real codebase, but the direction is reliable: the more ways a record can be written, the less you can rely on remembering the rule each time.\n\nThe following toy model is not Omnigent code. It reproduces the shape of the bug: a shared agent, a guarded edit route, and a sibling upload route that checks only session permission.\n\n``` python\nclass Agent:\n    def __init__(self, aid, session_id=None, mcp=None):\n        self.id, self.session_id, self.mcp = aid, session_id, list(mcp or [])\n    @property\n    def shared(self):\n        return self.session_id is None\n\nclass Store:\n    def __init__(self):\n        self.agents = {\"tmpl\": Agent(\"tmpl\"), \"mine\": Agent(\"mine\", session_id=\"s1\")}\n    def update(self, agent, mcp):\n        agent.mcp = list(mcp)\n\ndef can_edit(user, session):\n    return session in user[\"sessions\"]\n\ndef route_mcp_edit(st, user, session, agent, mcp):\n    if not can_edit(user, session): raise PermissionError(\"edit\")\n    if agent.shared: raise PermissionError(\"read-only\")   # the guard\n    st.update(agent, mcp)\n\ndef route_bundle_upload(st, user, session, agent, mcp):\n    if not can_edit(user, session): raise PermissionError(\"edit\")\n    st.update(agent, mcp)                                   # no record-level guard\n```\n\nAn attack helper calls a route with the attacker's own session `s1` but targets the shared `tmpl` agent, then checks whether the template now contains `stdio:attacker-cmd`. A legitimacy helper checks that the user can still edit their own agent. Running the model produces this output:\n\n```\nroute | shared agent poisoned | own agent still editable\nmcp_edit (guarded) | False | True\nbundle_upload (no guard) | True | True\nbundle_upload (guard added) | False | True\nparity violations: ['bundle_upload (no guard)']\nafter fix: []\n```\n\nThree observations. The guarded route blocks the attack and still lets users edit their own agents. The unguarded route lets the attack through while looking perfectly normal to a functional test, because the legitimate case also passes. And adding the guard fixes the attack without breaking legitimate use, which is why this class of fix is cheap once someone spots it. The hard part is spotting it, because every existing test is green.\n\nFunctional tests ask \"does the feature work.\" A parity test asks \"does every path that can write this field enforce the same rule.\" In the toy model it is a loop over a registry of write routes:\n\n``` python\ndef attack(route):\n    st = Store(); user = {\"sessions\": {\"s1\"}}\n    try:\n        route(st, user, \"s1\", st.agents[\"tmpl\"], [\"stdio:attacker-cmd\"])\n    except PermissionError:\n        pass\n    return \"stdio:attacker-cmd\" in st.agents[\"tmpl\"].mcp\n\ndef parity(routes):\n    return [name for name, route in routes.items() if attack(route)]\n\nassert parity(WRITE_ROUTES) == [], \"routes that mutate shared agents\"\n```\n\nThe test has two properties worth copying into a real suite:\n\n`WRITE_ROUTES` by introspecting the router: every route whose handler reaches the store's update, create, or replace functions. If a new route appears and is not in the registry, a second test fails the build (\"unregistered writer\"). That is what turns the guard from a habit into a property.\nTo check that the test has teeth, do a mutation run: remove the guard from `route_mcp_edit` and confirm `parity` reports it. If your suite stays green with a guard deleted, the suite is not testing the rule.\n\nThe most durable fix moves the check from the handler to the layer that owns the record. Three options, from weakest to strongest:\n\n`if` statements, still depends on each author calling it. Add the parity test above or this regresses.`update` refuses to change MCP configuration on a shared agent unless the caller passes an explicit capability, such as `as_template_admin=True`. A new route that forgets the check now fails loudly in testing instead of silently succeeding.\nFor the specific data in this advisory, there is also a second line of defense that does not depend on route logic: treat any `stdio` MCP entry as executable code and gate its *launch*. A runner that starts a subprocess from stored configuration should compare the command against an allowlist maintained outside the user-writable agent record, or require that the record was signed by an admin flow. Then even a successful write to a template cannot become command execution on its own. This is the same principle as checking at the sink, not just at the entry: validation at the place where the dangerous action happens does not care which route wrote the data.\n\nIf you run or build an agent platform, these are the places where \"one rule, many writers\" tends to hide:\n\nFor each, ask the same two questions. Which fields are executable, meaning they eventually become a command, a URL fetched with credentials, or a tool grant? And how many code paths can write them? If the second number is larger than the number of tests that attack each path, you have the same gap this advisory describes.\n\n**Is this the same as an authorization bypass?**\n\nClose, but narrower. Authentication and session authorization worked as written. The missing piece was an object-level rule (shared agents are read-only) that existed on one route and not another. Security folks often file this under broken object-level authorization or inconsistent enforcement.\n\n**Does it matter that the attacker must be authenticated?**\n\nYes for severity scoring, less for risk. In shared or company-hosted deployments, any employee or tenant with their own session meets the precondition, and the payload runs on infrastructure used by other people's sessions.\n\n**Which version fixes it?**\n\nAccording to the advisory, `omnigent` 0.3.0 is the first patched version for the pip package, and the vulnerable range is everything below it. Check the advisory page for the current state before relying on this.\n\n**Why not just block `stdio` MCP servers entirely?**\n\nMany legitimate tools are local processes. A blanket ban breaks real workflows. Gating launch with an allowlist or signed configuration keeps them while removing the ability of a stray write to become execution.\n\n**How do I find unguarded siblings quickly?**\n\nGrep for every call to the persistence function that your guarded route uses. Each caller either has the same guard, calls a shared helper that does, or is a finding. Then encode that list as the registry in your parity test.\n\n**Is the probability chart a real measurement?**\n\nNo. It is the arithmetic of `p^n` under an independence assumption, included to show how risk compounds with the number of write paths. Real guard rates are not independent and are unknown for any given codebase.\n\nSee the earlier posts in the Agent Safety Engineering series on this profile.\n\nSources: GitHub Advisory Database entry GHSA-jrrm-9hc7-2v3h ([https://github.com/advisories/GHSA-jrrm-9hc7-2v3h](https://github.com/advisories/GHSA-jrrm-9hc7-2v3h)), retrieved 2026-12-06.", "url": "https://wpnews.pro/news/one-route-had-the-guard-its-sibling-did-not-what-the-omnigent-shared-agent-about", "canonical_source": "https://dev.to/ginigenai_hp_0ae441ead91f/one-route-had-the-guard-its-sibling-did-not-what-the-omnigent-shared-agent-advisory-teaches-about-4039", "published_at": "2026-12-06 08:42:56+00:00", "updated_at": "2026-12-06 08:44:14.444005+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "agent-protocols", "ai-tools"], "entities": ["Omnigent", "GitHub", "CVE-2026-62674", "GHSA-jrrm-9hc7-2v3h", "Model Context Protocol"], "also_reported_by": [], "takeaway": "A shared-agent MCP guard enforced only on the dedicated edit route was bypassed by the full-bundle upload route, so apply record-level rules like 'shared agents are not MCP-editable' to every write path, not per handler.", "recommendation": {"advice": "Enforce record-level rules such as 'shared agents are not MCP-editable' on every route that writes the record, and add a route-parity test that fails before the fix and passes after.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/one-route-had-the-guard-its-sibling-did-not-what-the-omnigent-shared-agent-about", "markdown": "https://wpnews.pro/news/one-route-had-the-guard-its-sibling-did-not-what-the-omnigent-shared-agent-about.md", "text": "https://wpnews.pro/news/one-route-had-the-guard-its-sibling-did-not-what-the-omnigent-shared-agent-about.txt", "jsonld": "https://wpnews.pro/news/one-route-had-the-guard-its-sibling-did-not-what-the-omnigent-shared-agent-about.jsonld"}}