Block shared-agent overwrite via bundle upload
fix(server): block shared-agent overwrite via bundle upload (#1418)
Block shared-agent overwrite via bundle upload25a22d-fix-block-shared-agent-overwrite-via-bundle-upload-cve-2026-62674fixblock shared agent overwrite via bundle
Committed by PattaraS
commit message
fix(server): block shared-agent overwrite via bundle upload (#1418)
* fix(server): block shared-agent overwrite via bundle upload (GHSA-jrrm-9hc7-2v3h)
PUT /sessions/{session_id}/agent checked LEVEL_EDIT but not whether the bound
agent is a shared/template agent (session_id is None), so a user could
overwrite a shared agent's bundle (e.g. inject a stdio MCP server) and gain RCE
on future sessions using it. Add the same guard the per-server MCP-edit
endpoint already enforces (session_mcp_servers._editable_agent).
Co-authored-by: Isaac
* Apply suggestion from @PattaraSEditor assessment
This commit patches CVE-2026-62674. The subject states the fix, blocking shared-agent overwrite via bundle upload, with the server scope and PR reference. The body, formatted as a single squashed bullet, explains that PUT /sessions/{id}/agent checked LEVEL_EDIT but not whether the bound agent was shared or template, letting a user replace its bundle, for example injecting a stdio MCP server, and gain code execution on future sessions. It notes the guard reused from the per-server MCP edit endpoint, which makes the remedy concrete. A trailing apply-suggestion bullet from review adds nothing, and the advisory sits inside the body rather than the header.