Summary
OpenClaw contains an authorization bypass in the validation of allowedAgentIds for hooks, where blank agent IDs are incorrectly treated as valid or unrestrained.
A lower-trust caller or misconfigured input path can submit empty agent IDs to circumvent agent-specific restrictions, gaining access to actions that should require stronger authorization or stricter policy enforcement.
Affected context
This vulnerability arises in OpenClaw deployments that rely on hooks with allowedAgentIds to enforce which agents are permitted to perform certain actions.
It is most relevant when:
- Agent-level authorization is used to differentiate trust levels between callers
- Hooks or APIs accept agent identifiers from user-controlled or externally supplied input
- Business logic assumes that missing or blank agent IDs will be rejected or constrained, but they are instead treated as permissive or bypassing checks.
Exploit preconditions
- Attack surface: Hook endpoints and related APIs that use allowedAgentIds to gate agent-specific operations.
- Required access: Ability to invoke hooks or submit configuration/requests that include agent ID fields (e.g., authenticated but lower-trust roles, or delegated services).
- Trigger point: Submission of requests or configurations with blank, empty, or omitted agent IDs where validation logic should enforce restrictions.
- Why exploitation is possible: The authorization logic fails to correctly handle empty agent identifiers, allowing requests to proceed as if no restrictions applied or as if the caller is implicitly authorized, mapping to CWE-863 (Incorrect Authorization).
Why this happens
The root cause is an incorrect authorization pattern where agent-specific checks depend on allowedAgentIds but do not robustly validate the presence and correctness of those identifiers.
Instead of treating blank or missing agent IDs as invalid and denying access, the logic permits operations without confirming that the caller is associated with a permitted agent.
This aligns with CWE-863, where authorization decisions are made using incomplete or improperly validated information, causing enforcement gaps and unintended access.
Potential impact
- Lower-trust callers may execute actions reserved for higher-trust agents.
- Agent-specific policies can be bypassed, weakening enforcement of business rules.
- Sensitive operations may be performed without the intended level of authorization.
- Compliance and audit assumptions around agent-based access control can be invalidated.
General mitigation guidance
Mitigation generally focuses on strengthening authorization logic and agent identity validation rather than relying on implicit behavior.
Recommended patterns include:
- Treat blank, null, or missing agent IDs as invalid and explicitly deny such requests.
- Enforce strict validation that agent IDs are present, well-formed, and mapped to a known agent before any privileged action.
- Separate authentication of the caller from authorization tied to specific agents, ensuring both are independently verified.
- Centralize authorization checks so that hook logic cannot bypass standard policy enforcement.
- Design defaults so that absence of a valid agent context results in least privilege, not broad access.
How teams detect issues like this
Detection typically involves reviewing how agent-based authorization is implemented and tested:
- Use static analysis or manual code review to identify logic paths where allowedAgentIds are checked without explicit handling of empty or null values.
- Inspect conditional branches around agent validation to ensure they do not treat missing IDs as permissive conditions.
- Implement security-focused tests that send blank or malformed agent IDs to hooks and APIs, verifying expected denial of access.
- Apply policy enforcement tools or linters that flag authorization code relying on implicit defaults rather than explicit checks.

