Summary
OpenClaw before 2026.3.25 exposes an improper access control flaw in the /sessions/:sessionKey/kill HTTP route, allowing any bearer-authenticated user to call admin-level session termination logic.
By invoking killSubagentRunAdmin without correct scope checks, an attacker can terminate arbitrary subagent sessions they do not own, bypassing normal ownership and operator restrictions.
Affected context
This vulnerability arises in OpenClaw deployments that:
- Expose the
/sessions/:sessionKey/killHTTP endpoint, - Use bearer authentication without enforcing granular authorization scopes on this route, and
- Allow subagent sessions to be controlled via admin-level functions such as
killSubagentRunAdmin.
In such environments, any authenticated bearer token holder may be able to issue kill commands against sessions they do not control, depending on how tokens are distributed and used.
Exploit preconditions
- Attack surface: HTTP API endpoint
/sessions/:sessionKey/kill - Required access: Possession of any valid bearer token (not necessarily admin or operator scoped)
- Trigger point: Sending an authenticated request to the kill route with a chosen
sessionKey - Why exploitation is possible: The route delegates to
killSubagentRunAdminwithout verifying that the caller has appropriate admin/operator scopes or ownership of the target session, resulting in missing or incorrect authorization checks.
Why this happens
The bug is a classic case of improper access control mapped to CWE-863, where the application authenticates the caller but fails to properly authorize the action being requested.
The /sessions/:sessionKey/kill endpoint relies on bearer authentication alone and invokes an administrative function (killSubagentRunAdmin) without validating:
- Whether the caller has an admin role or specific scope permitting cross-session termination, and
- Whether the caller owns the target session or is within the correct operator context.
Abstractly, this reflects an insecure pattern where sensitive operations are exposed behind coarse-grained "is logged in" checks instead of explicit permissions and resource-level authorization.
Potential impact
- Attackers could terminate arbitrary subagent sessions owned by other users or teams.
- Disruption of ongoing runs, jobs, or orchestrated workflows that depend on those subagents.
- Potential denial of service conditions for targeted users or system components.
- Loss of operational visibility or interruption of monitoring, automation, or analysis pipelines relying on these sessions.
General mitigation guidance
Effective mitigation centers on tightening authorization around sensitive administrative routes and ensuring that session control operations are scope-aware:
- Enforce role- and scope-based authorization for all session-kill operations, requiring explicit admin or operator scopes before allowing cross-user or cross-tenant termination.
- Implement ownership checks on session resources so that non-admin users can only terminate sessions they created or that are explicitly delegated to them.
- Centralize authorization decisions via a dedicated policy layer or middleware, rather than embedding ad-hoc checks in controller logic.
- Apply least privilege principles when designing bearer tokens and API clients, minimizing the default scopes available to non-admin users.
- Log all session termination events with caller identity and target session details to support monitoring and incident response.
How teams detect issues like this
Organizations can approach detection and assurance through multiple layers:
- Static analysis & code review:
- Flag controller or route handlers that perform sensitive actions (e.g., kill, delete, admin operations) but lack explicit authorization checks or scope validation.
- Look for direct calls to admin-level functions like
killSubagentRunAdminthat are guarded only by generic "is authenticated" checks. - Policy enforcement:
- Use centralized authorization middleware or policy engines to enforce consistent RBAC/ABAC rules for high-impact operations.
- Define policies that require resource ownership or admin roles for cross-session operations.
- Runtime monitoring:
- Monitor logs for unusual patterns of session kills, such as many terminations initiated by the same low-privilege account or cross-tenant activity.
- Integrate with SIEM systems to alert on anomalies related to session termination endpoints.
- Automated tools:
- Apply API security testing tools or dynamic scanners that attempt privilege escalation by reusing low-privilege tokens on admin-capable endpoints.

