MCP07
- Location
dist/gateway/screen.js:45- Finding
Read-Scoped Gateway Method Allows Deletion of SIL Account Data ## Remediation Suggestions 1. **Separate read and destructive gateway operations.** Remove `shopping_user_forget` from the read-scoped dispatcher and expose deletion through a separate method requiring the host's write scope, such as `operator.write`. 2. **Enforce authorization server-side.** If a shared dispatcher is retained, verify the authenticated caller's write authorization before dispatching any mutation. Do not rely on tool descriptions, model behavior, or UI confirmation. 3. **Bind destructive requests to the intended account.** Verify that the authorized caller is allowed to act on the locally signed-in SIL account. Reject the operation if the account changes between authorization and dispatch. 4. **Validate deletion arguments against the committed schema.** Enforce nonempty string identifiers, identifier length limits, the 50-item maximum, and rejection of additional properties. Treat validation as defense in depth, not a replacement for authorization. 5. **Add authorization regression tests.** Verify that: - A read-only caller can perform intended reads but cannot delete rows. - A direct WebSocket request cannot bypass deletion authorization. - An appropriately write-authorized caller can delete only valid, explicitly named rows. - Read-scoped calls cannot use the `all: true` form. - Account changes invalidate pending destructive actions. 6. **Record destructive actions safely.** Audit the authenticated gateway actor, target account, operation, and outcome without logging tokens or sensitive profile contents.
- Content
View full analysis
Vulnerability Details
File Location:
plugin/dist/gateway/screen.js:22–30, 45–52, 114–148plugin/dist/tools/catalog.js:37–42plugin/dist/lib/shopping-call.js:23–28
Vulnerability Type: Improper Authorization / Read-to-Write Privilege Escalation (CWE-862)
Risk Level: Medium
Vulnerable Code
The gateway permits the destructive tool alongside read operations and registers the shared dispatcher with read-only scope:
js const SCREEN_TOOLS = new Set([ "shopping_product_get", "shopping_offers", "shopping_seller_get", "shopping_domain_get", "shopping_content", "shopping_user_read", "shopping_user_forget", ]);js export function registerScreenMethods(api) { const openclawVersion = readHostVersion(api); const run = { pluginVersion: readInstalledVersion(), ...(openclawVersion !== null ? { openclawVersion } : {}), }; api.registerGatewayMethod(ANSWER_METHOD, ({ params, respond }) => guarded(api, respond, () => answer(api, params, respond)), { scope: "operator.read" }); api.registerGatewayMethod(CALL_METHOD, ({ params, respond }) => guarded(api, respond, () => call(api, run, params, respond)), { scope: "operator.read" }); }The parser restricts deletion to named rows but performs no additional authorization check:
js function parseCall(params) { const { tool: name, args, requestId, sessionId } = params; const tool = SHOPPING_TOOLS.find((t) => t.name === name && SCREEN_TOOLS.has(t.name)); if (tool === undefined) return { invalid: `sil.call runs only ${[...SCREEN_TOOLS].join(", ")}.` }; if (args === null || typeof args !== "object" || Array.isArray(args)) { return { invalid: "sil.call takes `args`, the tool's arguments as an object." }; } if (typeof requestId !== "string" || !REQUEST_ID.test(requestId)) { return { invalid: "sil.call takes `requestId`, 1–256 printable characters, no spaces." }; } if (sessionId ! ...[truncated 4602 chars]
