{"answers":{"affected":"6 open source packages ship an affected version, including @grackle-ai/auth, @grackle-ai/mcp and @grackle-ai/plugin-core.","exploited":"There is no known exploitation of GHSA-f9ff-5x35-7gfw in the wild and no public exploit code.","fix":"No fix has been published for GHSA-f9ff-5x35-7gfw yet. Limit exposure of the affected software until one is available.","what":"GHSA-f9ff-5x35-7gfw is a missing authorization vulnerability in @grackle-ai/auth, published on 2 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-f9ff-5x35-7gfw and fix it if it is affected.\n\nWhat it is: GHSA-f9ff-5x35-7gfw is a missing authorization vulnerability in @grackle-ai/auth, published on 2 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-f9ff-5x35-7gfw in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @grackle-ai/auth (npm): affected all versions up to 0.132.1; no fix listed\n- @grackle-ai/auth (npm): affected all versions up to 0.132.1; no fix listed\n- @grackle-ai/mcp (npm): affected all versions up to 0.132.1; no fix listed\n- @grackle-ai/mcp (npm): affected all versions up to 0.132.1; no fix listed\n- @grackle-ai/plugin-core (npm): affected all versions up to 0.132.1; no fix listed\n- @grackle-ai/plugin-core (npm): affected all versions up to 0.132.1; no fix listed\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-f9ff-5x35-7gfw/ (Markdown: https://insights.sbomify.com/GHSA-f9ff-5x35-7gfw/index.md)","id":"GHSA-f9ff-5x35-7gfw","markdown":"https://insights.sbomify.com/GHSA-f9ff-5x35-7gfw/index.md","name":"GHSA-f9ff-5x35-7gfw","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["privilege_escalation","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"MCP AI agent library","requires_auth":"low_privilege","summary":"Scoped agents can bypass authorization checks to perform unauthorized cross-task and cross-session mutations due to missing ancestry validation in specific MCP tools.","user_interaction":"not_required","vuln_class":"missing_authorization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Summary\n\nAuthorization for scoped (agent) MCP callers is enforced **inline, per tool**, and is applied inconsistently — several mutating tools silently omit the ancestry/workspace check that their siblings perform. Because the MCP server authenticates all outbound gRPC with the full server API key and the backend gRPC handlers perform **no caller-based authorization**, the MCP tool layer is the *sole* authorization boundary. A malicious or prompt-injected scoped agent can therefore perform cross-task and cross-session operations it should not be allowed to (an IDOR / privilege-boundary bypass).\n\nThis advisory bundles the audit's **Systemic Pattern A** findings: **F2, F6, F7, F12** (and the duplicate F19).\n\n## Affected versions\n\n`@grackle-ai/mcp` (with `@grackle-ai/plugin-core` / `@grackle-ai/auth`) at **0.132.1** and earlier.\n\n## Root cause\n\n- `mcp-server.ts:111-127` (`createGrpcClients`) sets `Authorization: Bearer ${apiKey}` (the full server key) on every outbound gRPC call.\n- Backend handlers (`updateTask`, `deleteTask`, `resumeTask`, `killAgent`, `getTask` in `plugin-core`) take only the request message — no `AuthContext` — and act on whatever ID is passed.\n- Therefore scope must be enforced in each MCP tool handler. Some call `assertCallerIsAncestor` (`task_complete`, `task_start`, `session_attach`, `session_send_input`); their destructive siblings do not. New tools that forget the check **fail open**.\n\n## F2 — task_update / task_delete / task_resume bypass ancestry (High)\n\n**Location:** `packages/mcp/src/tools/task.ts:226` (task_update), `:393` (task_delete), `:465` (task_resume).\n\nThese accept an arbitrary `taskId` with only a `ROOT_TASK_ID` special-case and no `assertCallerIsAncestor`. The central dispatcher hardcodes its workspace gate to `name === \"task_show\"`, and these tools' Zod schemas have no `workspaceId` field (so the blanket injection is stripped). They are not in `DEFAULT_SCOPED_MCP_TOOLS` but **are** in the shipped `ORCHESTRATOR_MCP_TOOLS` / `ADMIN_MCP_TOOLS` presets.\n\n**Exploit:** a scoped agent under the orchestrator persona learns a sibling/parent/cross-workspace task ID (via `task_list`/`task_search`), then `task_delete {taskId: \u003cvictim\u003e}` (permanently destroys another agent's or the human parent's work) or `task_update` to flip a sibling to `complete`/`failed` or rewrite its dependency DAG and budgets.\n\n## F6 — session_kill / session_resume bypass ancestry (Medium)\n\n**Location:** `packages/mcp/src/tools/session.ts:95` (session_resume), `:178` (session_kill).\n\nCall `client.killAgent` / `client.resumeAgent` directly with no auth context, unlike `session_attach`/`session_send_input`. `session_kill` is in the orchestrator preset. **Exploit:** cross-session SIGKILL DoS against a sibling agent or the root orchestrator; foreign session resume.\n\n## F7 — Workspaceless scoped token fails open to all workspaces (Medium)\n\n**Location:** `packages/mcp/src/mcp-server.ts:565-600`.\n\nThe per-task cross-workspace check (`task_show` block) is gated on `authContext.workspaceId` being truthy. A task created without a workspace (a supported config) mints a scoped token with `pid: \"\"` → `workspaceId: undefined`, so the check is skipped and the injected `workspaceId` becomes `\"\"`, which the backend treats as \"all workspaces.\" **Exploit:** a malicious agent in a workspaceless session calls `task_list` (no args) → reads every task in every workspace, then `task_show {taskId}` cross-workspace (title/description/branch/review-notes). `schedule_show` (in the default scoped allowlist) resolves by ID with no workspace check. Read-only cross-workspace disclosure.\n\n## F12 — Scoped-token revocation is dead code (Low)\n\n**Location:** `packages/auth/src/scoped-token.ts:23,142-149`.\n\nThe consuming check is wired (`auth-middleware.ts:90-92`), but `revokeTask()` is **never called outside tests** — no task-abort/stop flow invokes it — and the backing `revokedTasks` Map is in-memory only (lost on restart). A compromised agent that exfiltrated its scoped token keeps authenticating for the full 24h TTL regardless of task lifecycle.\n\n## Remediation\n\n- **Systemic fix:** enforce scope **centrally** in the `CallToolRequest` dispatcher (`mcp-server.ts`) via a per-tool `targetTaskIdArg` / `targetSessionIdArg` descriptor so any tool that targets a task/session **fails closed** unless the caller is an ancestor (or self).\n- Immediately, add `assertCallerIsAncestor` (or self-or-ancestor) to `task_update`, `task_delete`, `task_resume`, `session_kill`, `session_resume`, mirroring `task_complete`/`task_start`.\n- F7: do **not** fail open on empty `workspaceId` — treat a scoped non-root caller with no workspace as having access to *no* workspace; apply the `task_show` membership check whenever the caller is scoped and not `ROOT_TASK_ID`; add a per-id membership check to `schedule_show`.\n- F12: wire `revokeTask()` into task-abort/stop flows with SQLite-backed persistence (like channel-grant revocation), or remove the dead API and document the 24h window.\n- Add regression tests mirroring the existing `task_complete` ancestor tests for each mutator.\n\n## CWEs\n\nCWE-862 (Missing Authorization), CWE-639 (Authorization Bypass Through User-Controlled Key / IDOR), CWE-613 (Insufficient Session Expiration).","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":false,"headline":"Authorization for scoped (agent) MCP callers is enforced **inline, per tool**, and is applied inconsistently — several mutating t","id":"GHSA-f9ff-5x35-7gfw","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"missing_authorization","year":"2026"},"n_packages":6,"n_references":null,"packages":[{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/auth","purl":null,"source":"GHSA-f9ff-5x35-7gfw"},{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/auth","purl":"pkg:npm/%40grackle-ai/auth","source":"GHSA-f9ff-5x35-7gfw"},{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/mcp","purl":null,"source":"GHSA-f9ff-5x35-7gfw"},{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/mcp","purl":"pkg:npm/%40grackle-ai/mcp","source":"GHSA-f9ff-5x35-7gfw"},{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/plugin-core","purl":null,"source":"GHSA-f9ff-5x35-7gfw"},{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/plugin-core","purl":"pkg:npm/%40grackle-ai/plugin-core","source":"GHSA-f9ff-5x35-7gfw"}],"products":null,"published":"2026-07-02","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Scoped agents can bypass authorization checks to perform unauthorized cross-task and cross-session mutations due to missing ancestry validation in specific MCP tools.","url":"https://insights.sbomify.com/GHSA-f9ff-5x35-7gfw/"}