#11123·zeroclaw

[Bug]: SOP execution accepts wildcard tool selectors without tools:execute

Author: Audacity88Created Sep 25, 2026Updated Sep 30, 2026
Labelsbugruntimetoolsecurity:policydomain:securitypriority:p1tool:soprisk:high

Affected component

security/sandbox

Severity

S0 - data loss / security risk

Conditional authorization-policy mismatch affecting an authenticated principal that already holds SOP execution permission. The agent's own security policy and SOP approval gates still apply.

Current behavior

A non-admin principal with sops = ["execute"], an allowed agent alias, and allowed_tools = ["*"] passes the SOP execution guard even when tools = ["execute"] is absent or has been revoked. An existing headless procedure can then run with its agent's tools. The same grant set produces an empty tool ceiling for an interactive session.

This is a source-confirmed finding at 73e2a4a15ddbdb01ffb4a044dc6c5c8dd7835110; no runtime reproduction was performed.

Found during retrospective review of merged #10263. The omission existed in its predecessor's wildcard check and remains after #10265; this report is a follow-up, not a claim that #10263 introduced a new privilege escalation. Related #8289 and #7141.

Expected behavior

SOP execution and approval should reject this grant combination. The authentication contract says SOP execution uses the same tool-selector rule as sessions; the session rule requires the coarse tool grant even with a wildcard.

Reuse principal_tool_ceiling(&auth.grants).is_none() for the SOP guard. Preserve the existing refusal of constrained SOP callers until the executor can carry their ceiling. Add focused run/decision coverage for wildcard without Tools:Execute, including revocation, and retain permitted-wildcard and admin controls. This does not require a new principal-propagation mechanism through the SOP engine.

Steps to reproduce

bash
# Source inspection, from a checkout containing this revision:
git show 73e2a4a15ddbdb01ffb4a044dc6c5c8dd7835110:crates/zeroclaw-runtime/src/rpc/dispatch.rs | sed -n '490,508p;8167,8181p'

# Runtime regression scenario to implement; not executed for this report:
# 1. Bind a non-admin synthetic principal whose profile has:
#    allowed_agents = ["test-agent"]
#    allowed_tools = ["*"]
#    [permission_profiles.sop_runner.grants]
#    sops = ["execute"]
#    No tools = ["execute"] grant.
# 2. Provide an existing SOP for test-agent with a permitted tool-using step.
# 3. Invoke sops/run for that SOP through authenticated RPC.
# 4. Verify refusal before dispatch; the current guard instead accepts it.
# 5. Cover the same grant combination for an approving sops/decide call.
# 6. Repeat after revoking only Tools:Execute from a previously permitted
#    profile, leaving the wildcard selector and Sops:Execute intact.

Impact

Deployments using separate SOP and tool grants cannot rely on removing Tools:Execute to stop this SOP execution route. An authenticated caller still needs Sops:Execute, access to every relevant agent, an existing procedure, and any procedure-specific approval requirements. This is not an unauthenticated route. The existing warning about daemon-account execution remains relevant; this report concerns the narrower documented grant check.

Logs / stack traces

No runtime execution or logs collected; evidence is the source path linked above.

ZeroClaw version

master at 73e2a4a15ddbdb01ffb4a044dc6c5c8dd7835110; also present at #10263's final head 2b5f38118c15ffd4ef277ffcf4ea8651f00c8398.

Rust version

No response — source review only; no build performed.

Operating system

Platform-independent RPC authorization logic; no operating-system runtime reproduction performed.

Regression?

Unknown. The omission is inherited from the earlier SOP wildcard check; no previously correct release has been established.

Pre-flight checks

  • I reproduced this on the latest master branch or latest release.
  • I redacted secrets, tokens, and personal data from all submitted content.

The first item remains unchecked because current-master source was inspected, but no runtime reproduction was performed.