[Bug]: Queued session operations retain revoked administrator ownership bypass
Current status — 2026-09-28
Still open; #10412 is a partial implementation. #10412 extracts the shared atomic session-ownership claim and removes one stale-admin exception. Its stated scope leaves other stale-grant paths in this issue unresolved. Landing that PR alone must not be treated as full issue completion.
The remaining acceptance is still the queued-operation/current-authority behavior described below. #11197 remains a separate resume/environment follow-up. The issue should close only after the complete acceptance is implemented and verified.
Affected component
security/sandbox
Severity
S0 - data loss / security risk
Current behavior
Source review of the landed #10265 commit found that queued session operations can retain an administrator's ownership bypass after that administrator is demoted. I have not executed a runtime reproduction.
The caller must initially be a named local administrator, target another principal's session, and lose administrator status while waiting for admission. Ordinary method and target-agent/root permissions remain. The live target session need not change.
scoped_principal_id derives the ownership bypass from the connection's stamped self.auth.grants.admin. recheck_authority_after_admission returns fresh grants without updating that stamp. In the prompt path, ownership is revalidated before this refresh, and the later agent/root/tool checks do not repeat the owner decision.
Close, kill, and delete also revalidate after admission without refreshing authority. In particular, delete chooses between owner-predicated and unpredicated storage deletion using the stale administrator scope. The demoted caller can therefore still delete another principal's durable session.
This is a post-merge repair for #10265 under the current-authority and session-ownership contracts in #7141 and #8290.
Expected behavior
Resolve current authority and derive the owner scope together after admission, before any post-wait effect. Apply this consistently to prompt, destructive operations, and queued resume paths. Removing administrator status must remove cross-principal access even if ordinary method and agent/root permissions remain.
A focused admission test should demote a queued administrator, verify denial against a foreign-owned session without modifying its durable data, and retain an own-session positive control. Cover the destructive path as well as prompt if they use separate authorization logic.
Steps to reproduce
# Source-derived regression scenario; not executed.
# 1. Create a live session owned by zeroclaw_user.
# 2. Connect zeroclaw_operator as a named local administrator.
# 3. Hold the session's admission permit and queue a foreign-session delete.
# 4. Remove administrator status while retaining the ordinary delete method
# permission and applicable target-agent/root grants.
# 5. Release admission without replacing the target's live incarnation.
# Expected: deny the foreign-owner operation and preserve durable data.
# Source path: the stamped admin bypass selects unpredicated deletion.
# Positive control: a permitted operation on the caller's own session succeeds.Impact
Deployments that use named principals, live grant changes, and queued session operations can retain revoked cross-principal privileges. The destructive variant risks another principal's session data. This is not a claim that an ordinary never-administrator caller can acquire admin privileges.
Logs / stack traces
No runtime logs captured. Evidence is the linked source at the landed commit.ZeroClaw version
73e2a4a15ddbdb01ffb4a044dc6c5c8dd7835110 (landed #10265).
Rust version
Not built locally for this report; source inspection only.
Operating system
No runtime reproduction on a specific OS. The identified authorization path is platform-independent Rust code.
Regression?
Unknown
The defect is in the newly landed principal-ownership boundary; no before/after runtime comparison was performed.
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 reproduction checkbox is intentionally unchecked because this is a source-review finding.
Source: zeroclaw-labs/zeroclaw