Repository navigation
fix(plugin-security): a write's tenant options never reach past the caller's organization wall - #39779
fix(plugin-security): a write's tenant options never reach past the caller's organization wall#39779objectstack-fleet[bot] wants to merge 6 commits into
Conversation
…aller's organization wall Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-Authored-By: Claude <noreply@anthropic.com>
…r's organization wall Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4 Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 32 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin cc768e685ecdbb17286c8d74e49345989986034b && git checkout cc768e685ecdbb17286c8d74e49345989986034b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 124f1e08239109e040006d7deec81125b32c33ed 66053aed84bd68b999a8603fbc304be08c695e18 && git checkout -B drift-repro 124f1e08239109e040006d7deec81125b32c33ed && git merge --no-ff 66053aed84bd68b999a8603fbc304be08c695e18
node scripts/docs-audit/affected-docs.mjs --json 124f1e08239109e040006d7deec81125b32c33ed
|
|
security@os-mickey · os-mickey · session_01ASNY8XNef4ywkQio6S9ju4 Label · 2026-12-05T02:16Z. |
|
security@os-mickey · os-mickey · session_01ASNY8XNef4ywkQio6S9ju4 Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe narrowing makes the spec's own refusal real at the plain door and takes no declared capability away.
Implemented-by: VERDICT: FAIL |
|
security@os-mickey · os-mickey · session_01ASNY8XNef4ywkQio6S9ju4 Handover · 2026-12-05T13:10Z. This draft moves to the seat
|
…r's organization wall, whoever set its tenant options On an insert's landing, the plain write door's bound is asked about every explicit tenant key the option bag carries; for an on-behalf-of insert that bound is the caller's wall intersected with the delegator's. Updates, deletes, purges, reads and the app-automation elevation are unchanged. Pins on the real stack: the on-behalf-of insert (single and array, hook-set and in-process), an exempt operator acting for a walled delegator, a purge, a replaced bag and a denied caller, with their controls. Claude-Session: https://claude.ai/code/session_017xRBcV4xBHWbZEmo3HuvyX Co-authored-by: Claude <noreply@anthropic.com>
… are held to the caller's organization wall The bound's docblocks, the changeset and the system-context table say what holds: an insert's every tenant key is held to the caller's wall, an on-behalf-of insert's to the delegator's memberships too; other writes are held where a key asks beyond the caller's own organizations; and where no bound is installed. Claude-Session: https://claude.ai/code/session_017xRBcV4xBHWbZEmo3HuvyX Co-authored-by: Claude <noreply@anthropic.com>
Security-fix: seat-dispatched
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill or doc teaches setting a write's tenant options; the rule binds the security layer's write door
维护者速读
What changes
A write's tenant options never reach past the caller's organization wall (ADR-0095 D1).
OperationContext.driverTenantScopeCheck). The app-automation elevation's wall keeps its own, and a plain-door bound composes after any bound another layer installed.403 PERMISSION_DENIEDbefore any driver runs: refused, never narrowed.singleposture, the public-form grant door, and every write that sets no tenant option.@objectstack/objectql: thedriverTenantScopeCheckdocblock names the second installer. Text only.Files to read first, by risk:
packages/plugins/plugin-security/src/write-option-tenant-keys-wall.ts— the judge (what counts as outside the wall or a cleared scope) and where the verdict comes from.packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts— the one hunk before the finalnext(): which operations get the bound and with which principals.packages/plugins/plugin-security/src/write-option-tenant-keys-wall.test.ts— the refusal cells and the controls.Tests
New pins, real stack (head dfe2a17)
write-option-tenant-keys-wall.test.ts: a realObjectQLengine on driver-sql and driver-sqlite-wasm, the realSecurityPlugin, two organizations, the option bag set by abefore*hook. 26 cells per run (13 per driver family).groupposture outside the membership set. Each assertsPERMISSION_DENIED/403and the table unchanged.singleposture unaffected.node scripts/ablation-replace.mjs, anchor hit 1 to 0, restored blob equal to HEAD,git diff HEADempty): 16 failed, 10 passed. All 16 refusal cells red, all 10 controls green both ways.Affected package suites
pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2: 295 files passed, 7489 passed, 52 skipped.pnpm --filter @objectstack/plugin-security typecheckandpnpm --filter @objectstack/objectql typecheck: exit 0.Acceptance notes
Verification
Derived gate families (dispatch-gates --commands, 80 families)
--ran: 0 UNRUN.node scripts/ci/snapshot-next.mjs --self-testexited 1 on this tree. The diff does not touchscripts/ci/, so this self-test reads the same files as onmain. CI reads it.check:dual-build-cjs-loadsandcheck:i18n, reason: PREREQUISITE NOT MET (the whole workspacedist/is not built in this worktree). CI runs both.check:query-options-erasureandcheck:type-check-debt, reason: did not finish inside the local time box on the shared container (exit 124). CI runs both in Lint & Repo Gates.node scripts/check-nul-bytes.mjs: OK.Two-minute check:
pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/write-option-tenant-keys-wall.test.tsshould printTests 26 passed (26).Generated by Claude Code