Summary
OpenClaw versions before 2026.4.15 contain an authorization bypass in Matrix room control-command handling that incorrectly trusts DM pairing-store entries for access control.
An attacker with a DM-paired sender ID can trigger privileged room control commands from bot rooms without being present in the configured allowlists, enabling unintended privileged behavior by OpenClaw.
Affected context
This vulnerability appears in OpenClaw deployments integrated with Matrix where:
- Bots support "room control commands" (e.g., administrative or orchestration actions),
- Access control relies on per-room allowlists,
- A DM pairing-store is used to associate Matrix sender IDs with privileged identities or capabilities.
The issue manifests when the system reuses trust decisions derived from direct messages (DMs) to authorize control commands posted in other rooms (e.g., bot rooms), instead of re-evaluating per-room authorization policies.
Environments that heavily automate privileged workflows through Matrix bots are particularly exposed, as they may depend on those room-level allowlists to limit who can invoke sensitive OpenClaw behavior.
Exploit preconditions
- Attack surface: Matrix rooms where OpenClaw bots listen for room control commands.
- Required access: Ability to obtain or reuse a DM pairing with the bot such that the attacker's sender ID is stored in the DM pairing-store.
- Trigger point: Posting crafted control-command messages in a bot room or other monitored room where the bot processes commands.
- Why exploitation is possible: The authorization logic trusts the DM pairing-store entry as sufficient proof of privilege, and does not consistently enforce the configured room allowlists for control commands. This disconnect between the intended access control policy (room-based allowlists) and the implemented checks (DM pairing trust) allows a DM-paired attacker to bypass per-room authorization constraints.
Why this happens
The underlying defect is an authorization logic error, aligning with CWE-863: Incorrect Authorization.
Instead of enforcing room-level access policies at the point where control commands are processed, the implementation relies on DM pairing-store entries as a blanket indicator of trust. This creates a divergence between identity binding and authorization context:
- Identity/relationship (DM pairing) is treated as sufficient for all contexts.
- The specific resource and policy (room allowlists) are not consistently validated when handling commands.
In abstract terms, this reflects a flawed pattern where:
- An upstream trust decision (e.g., "this sender once had a privileged DM relationship") is reused across different resources and scopes without re-checking current policy.
- Authorization checks are performed against the wrong attribute (presence in pairing-store) rather than the intended control policy (membership in the room's allowlist).
Such patterns commonly arise when reusing shared authorization helpers or caches across multiple features without clearly separating identity binding from contextual authorization requirements.
Potential impact
- Attackers with DM-paired sender IDs could trigger privileged OpenClaw behaviors that should be restricted to allowlisted users.
- Bots may execute high-impact room control commands (e.g., configuration changes, workflow orchestration, or administrative actions) on behalf of unauthorized users.
- Existing governance controls based on Matrix room allowlists can be undermined, potentially allowing policy violations or misuse of operational automation.
- In multi-tenant or shared environments, one user's DM pairing could be leveraged to affect other rooms or projects if those rooms rely on allowlists for isolation.
- Logging and audit trails may incorrectly attribute actions to "trusted" identities, complicating incident response and masking abuse behind otherwise legitimate DM relationships.
General mitigation guidance
Effective mitigation focuses on aligning authorization checks explicitly with the intended policy and context:
- Enforce per-resource authorization at the command handler: Ensure that each room control command is checked against the configured room-level allowlists or equivalent policy mechanisms before execution, independent of DM pairing state.
- Separate identity binding from authorization decisions: Treat DM pairing-store entries as an identity assertion or relationship indicator (e.g., mapping a sender ID to a user or account), but require explicit policy checks per room and command.
- Implement contextual authorization scopes: Associate pairing information with specific rooms, projects, or roles, and verify that a given pairing is valid for the target context rather than applying it globally.
- Prefer least-privilege defaults: If policy information is missing, corrupted, or ambiguous, default to denying control commands until explicit authorization is configured.
- Harden cross-room behavior: Where bots operate across multiple rooms, introduce explicit constraints on which rooms may accept privileged commands from which identities, and avoid implicit trust propagation from DMs.
- Centralize authorization logic: Concentrate access control checks in a well-reviewed authorization layer instead of duplicating ad hoc checks in individual command handlers, reducing the chance of inconsistent enforcement.
These patterns help ensure that privileged behaviors are always gated by the correct, context-aware policies rather than by historical or indirect trust signals.
How teams detect issues like this
Detecting this class of authorization issues typically involves both design-level and code-level analysis:
- Code review focus on authorization boundaries:
- Identify all entry points where room control commands are processed.
- Verify that each path enforces room allowlists or equivalent access control, rather than relying solely on DM pairing or identity flags.
- Look for authorization checks that use shared "trusted" flags without confirming the current room or resource context.
- Static analysis patterns:
- Search for use of DM pairing-store or similar trust structures in authorization paths and confirm that they're combined with context-specific checks.
- Flag functions that execute high-privilege commands without clear references to allowlist or policy enforcement utilities.
- Architectural and threat modeling reviews:
- Examine how trust from DMs is mapped into room permissions, and identify any implicit trust propagation across rooms or scopes.
- Validate that authorization policies are enforced at the final decision point (where commands are executed), not just at earlier interaction stages.
- Runtime monitoring and policy validation:
- Instrument logging around control-command execution to record which checks passed (e.g., DM pairing, allowlist validation) and analyze for unexpected combinations (such as commands executed without allowlist confirmation).
- Use security tests or red-team style exercises to attempt control-command execution from non-allowlisted accounts that nonetheless have DM relationships with bots.
Automated code scanning tools, policy-as-code frameworks, and CI-integrated authorization tests can help surface these inconsistencies before deployment, especially when combined with explicit annotations for privileged endpoints.

