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.

Chance that every write route carries the guard, by number of routes and per-route guard rate

What does the Omnigent advisory actually say?

Everything in this section comes from the public advisory text on GitHub (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).

The setup has three pieces:

  1. Shared (template) agents. These are agents with no owning session. In the data model this shows up as agent.session_id is None. Many users create sessions from the same template.
  2. A guarded route. The direct MCP edit endpoint contains a check equivalent to "if the agent has no session, raise: built-in agents are read-only through this endpoint." The session API also reports mcp_servers_editable as false for these agents, so the UI treats them as locked.
  3. An unguarded route. PUT /sessions/{session_id}/agent accepts a full agent bundle. It checks that the caller has edit permission on the session. It does not check whether the agent bound to that session is a shared template. It then stores the bundle and updates the agent row. For a shared agent, that row is the template itself, not a per-session copy.

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.

Notice 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.

Why do per-route guards fail even when each one is correct?

A 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:

  • Paths multiply. A single field can be changed by a field-level endpoint, a bulk or bundle endpoint, an import, a clone, a restore, a migration job, or a background sync. Each is written at a different time by a different person, often for a different feature.
  • The guard lives in the first path's author's head. The person who wrote the MCP edit endpoint knew about the read-only rule and encoded it locally. The person who later wrote the bundle upload had a different goal (let users replace their agent wholesale) and a permission check that was correct for that goal, namely "can this user edit this session."

The 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.

There 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.

How can you reproduce the bug class in 60 lines?

The 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.

class Agent: def __init__(self, aid, session_id=None, mcp=None): self.id, self.session_id, self.mcp = aid, session_id, list(mcp or []) @property def shared(self): return self.session_id is None class Store: def __init__(self): self.agents = {"tmpl": Agent("tmpl"), "mine": Agent("mine", session_id="s1")} def update(self, agent, mcp): agent.mcp = list(mcp) def can_edit(user, session): return session in user["sessions"] def route_mcp_edit(st, user, session, agent, mcp): if not can_edit(user, session): raise PermissionError("edit") if agent.shared: raise PermissionError("read-only") # the guard st.update(agent, mcp) def route_bundle_upload(st, user, session, agent, mcp): if not can_edit(user, session): raise PermissionError("edit") st.update(agent, mcp) # no record-level guard 

An 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:

route | shared agent poisoned | own agent still editable mcp_edit (guarded) | False | True bundle_upload (no guard) | True | True bundle_upload (guard added) | False | True parity violations: ['bundle_upload (no guard)'] after fix: [] 

Three 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.

What does a route-parity test look like?

Functional 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:

def attack(route): st = Store(); user = {"sessions": {"s1"}} try: route(st, user, "s1", st.agents["tmpl"], ["stdio:attacker-cmd"]) except PermissionError: pass return "stdio:attacker-cmd" in st.agents["tmpl"].mcp def parity(routes): return [name for name, route in routes.items() if attack(route)] assert parity(WRITE_ROUTES) == [], "routes that mutate shared agents" 

The test has two properties worth copying into a real suite:

  • It is driven by a registry, not a hand-picked list. In a real service you can build 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.
  • It attacks with a legitimate low-privilege identity. The attacker is not anonymous and not an admin. They hold exactly the permission the vulnerable route checks. That is the realistic threat: a customer on a multi-tenant deployment.

To 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.

Where should the rule live so a new route cannot forget it?

The most durable fix moves the check from the handler to the layer that owns the record. Three options, from weakest to strongest:

  1. Shared helper called by each handler. Better than copy-pasted if statements, still depends on each author calling it. Add the parity test above or this regresses.
  2. Store-level invariant. The store's 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.
  3. Separate types. Model shared templates as a read-only type with no update method for MCP configuration at all. Session-owned agents are a different type. A route that tries to write the template does not type-check. This costs the most refactoring and gives the strongest guarantee.

For 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.

Which agent-platform features create this bug class?

If you run or build an agent platform, these are the places where "one rule, many writers" tends to hide:

  • Templates and marketplace agents that many sessions inherit from, where editing the parent changes everyone's behavior.
  • Bundle, import, and restore endpoints that replace a whole configuration object in one call and therefore bypass field-level validation.
  • Clone and fork flows that copy a locked record into an editable one and carry configuration along.
  • Sync jobs and migrations that write the same tables as user-facing routes with different code.
  • Config files in the workspace that the agent itself can edit and that the runner reloads, which turns an agent write into an executable-configuration write.

For 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.

Checklist: closing the gap in your own service

  1. List every field that can become code execution or a credential-bearing call (MCP server commands, tool definitions, webhook URLs, environment variables).
  2. For each field, enumerate all writers by searching for every call that persists the containing record. Include background jobs.
  3. State the record-level rule in one sentence ("shared agents are read-only to non-admins") and put it in the store or type layer.
  4. Write a parity test that uses a low-privilege legitimate identity against a registry of writers. Add a failing-build check for writers missing from the registry.
  5. Run a mutation check: delete each guard once and confirm a test fails.
  6. Gate the launch of any stored command at the runner, independent of how the record was written.
  7. Return the lock state in the API (as mcp_servers_editable did here) and test that the UI and every write route agree with it. A disagreement between what the API advertises and what routes enforce is a bug signal on its own.
  8. When you patch one route, search for its siblings in the same change. The advisory's fix was a single guard, and the same search would find any other route with the same omission.

FAQ

Is this the same as an authorization bypass?
Close, 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.

Does it matter that the attacker must be authenticated?
Yes 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.

Which version fixes it?
According 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.

Why not just block stdio MCP servers entirely?
Many 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.

How do I find unguarded siblings quickly?
Grep 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.

Is the probability chart a real measurement?
No. 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.

Further reading

See the earlier posts in the Agent Safety Engineering series on this profile.

Sources: GitHub Advisory Database entry GHSA-jrrm-9hc7-2v3h (https://github.com/advisories/GHSA-jrrm-9hc7-2v3h), retrieved 2026-12-06.