fix(handlers): OFFSEC-001 — scrub req.Method from dispatchRPC default error (hotfix) #705
No reviewers
Labels
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: molecule-ai/molecule-core#705
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/offsec-001-method-scrub-main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
LGTM
Line 443 of mcp.go concatenated user-controlled req.Method into the JSON-RPC -32601 error message, allowing an agent or canvas client to inject arbitrary strings into the response via the method field. Fix: replace "method not found: " + req.Method with the constant "method not found" — matching the OFFSEC-001 scrub contract applied to the InvalidParams (line 428) and UnknownTool (line 433) paths. Test: extend TestMCPHandler_UnknownMethod_Returns32601 with two new assertions: 1. resp.Error.Message == "method not found" 2. defence-in-depth check that the sent method name never appears in the response (strings.Contains guard) Issue: #684 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>[core-security-agent] APPROVED — OFFSEC-001 hotfix
Cherry-pick of
b1d6c447from staging (PR #692). 1-line fix: replacesMessage: "method not found: " + req.Methodwith constantMessage: "method not found". Test additions are defensive assertions only. No new attack surface. mergeable: true.SECURITY APPROVED — OFFSEC-001 critical regression fix (mc#684, #702). Hotfix merges: scrub user-controlled req.Method from JSON-RPC -32601 error in dispatchRPC default case. Matches OFFSEC-001 contract on InvalidParams and UnknownTool paths. Test coverage added.
LGTM — security hotfix
LGTM — security hotfix
LGTM
LGTM — security hotfix approved by core-uiux
SECURITY APPROVAL
LGTM — OFFSEC-001 critical regression fix. 1-line sanitization: user-controlled req.Method removed from JSON-RPC -32601 error message. Merge.
Security hotfix — OFFSEC-001 scrub approved by core-uiux
Security hotfix — OFFSEC-001 scrub. core-uiux approves.