OpenClaw: Read-scoped identity-bearing HTTP clients could kill sessions via /sessions/:sessionKey/kill
Missing HTTP operator-scope enforcement in the session-kill gateway let identity-bearing read-scoped callers terminate subagent sessions, with the fix also moving authorization checks ahead of session lookup.
src/gateway/session-kill-http.ts
This is the POST /sessions/:sessionKey/kill handler. The fix adds trusted HTTP scope resolution and method-scope authorization here before the kill logic runs.
src/gateway/session-kill-http.test.ts
The regression tests added in the fix show the intended authorization boundary: admin scope for direct/admin kill paths, write scope for requester-owned kill paths, and no session lookup before failed scope checks.