Summary
OpenClaw versions prior to 2026.5.18 contain an authorization bypass caused by unsafe path and glob matching in an execution allowlist feature.
By crafting input paths that traverse or evade allowlist glob patterns, lower‑trust callers may execute or persist actions beyond their intended authorization when the feature is enabled.
Affected context
The vulnerability arises in deployments of OpenClaw that rely on an execution allowlist implemented using glob pattern matching on paths.
It becomes relevant when:
- The exec allowlist feature is enabled
- Authorization decisions are tied directly to glob evaluation on user‑controlled paths
- Callers with restricted roles can supply or influence execution paths
In such contexts, incorrectly constrained glob logic can be traversed or bypassed, expanding effective permissions beyond what policy authors intended.
Exploit preconditions
- Attack surface: Interfaces that accept execution paths or resource identifiers filtered through the exec allowlist (CLI, API, job runners, plugins).
- Required access: Ability to invoke OpenClaw operations as a lower‑trust or partially authorized caller and provide path-like input parameters.
- Trigger point: Submission of carefully crafted paths that interact with the glob patterns used in the allowlist, such as nested segments, traversal‑like constructs, or pattern overlaps.
- Why exploitation is possible: The glob‑based matching is applied to user‑influenced paths without robust normalization and constraint checking, allowing path structures that still match allowlist patterns while semantically referencing resources or actions outside the intended authorized scope.
Why this happens
This issue is fundamentally a path validation and authorization flaw consistent with CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
The system assumes that glob patterns over paths are sufficient to restrict which actions can be executed, but the matching logic does not rigorously constrain the resolved targets to a truly restricted set.
Without comprehensive normalization (e.g., resolving "..", symbolic constructs, and ambiguous segments) and strong bounds enforcement, glob allowlists can be abused so that user‑controlled paths still appear "allowed" while actually pointing to unintended execution targets or policy scopes.
In effect, authorization is delegated to a fragile pattern‑matching mechanism rather than tightly bound to canonical resource identifiers and explicit permissions.
Potential impact
- Lower‑trust users may execute actions that are meant only for higher‑privilege roles.
- Unauthorized persistence or scheduling of tasks in sensitive environments can occur.
- Modification or access to resources outside the intended allowlisted scope may be possible.
- Escalation from limited operational roles to broader system control can happen.
- Policy authors may believe restrictions are enforced while silently granting broader access.
General mitigation guidance
Effective mitigation focuses on strengthening path handling and decoupling authorization from fragile glob assumptions.
Useful general patterns include:
- Canonically normalizing all path inputs before policy evaluation, ensuring removal or resolution of traversal constructs and ambiguous segments.
- Enforcing strict restrictions on resolved targets rather than relying solely on glob patterns; for example, binding operations to well‑defined base directories or resource namespaces.
- Designing allowlists around explicit resource identifiers or capability sets rather than user‑controlled paths wherever possible.
- Applying least‑privilege principles so that execution features exposed to lower‑trust callers are scoped to minimal and clearly enumerated actions.
- Treating any path‑based filters as defense‑in‑depth, not the primary enforcement mechanism, and layering additional authorization checks.
How teams detect issues like this
Organizations can identify and monitor this class of vulnerability through several complementary strategies:
- Static analysis or custom linting rules that flag authorization checks implemented purely via glob or pattern matching on user‑controlled paths.
- Code review practices that require canonical path resolution and explicit bounds checking for any feature that restricts execution or resource access by path.
- Policy validation frameworks that test allowlists with adversarial and edge‑case paths to surface pattern overlaps or unexpected matches.
- Configuration and CI/CD checks that highlight overly broad glob patterns in security‑sensitive allowlists, prompting manual inspection.
- Runtime monitoring for unusual execution requests, such as lower‑trust roles invoking actions from unexpected directories or namespaces.

