Skip to content

fix(plugin-security): a delegated administrator's refused assignment write answers the same for a row it cannot read as for a missing one - #29950

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/sec-hardening-l
Nov 3, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/sec-hardening-l

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:委派管理员(持有 adminScope 的调用者,包括同时持有 adminScope 的组织管理员)按 id 修改或删除授权行(sys_user_position、sys_user_permission_set)被拒时,对它读不到的行和根本不存在的 id 给出完全相同的回答(状态码、错误码、文案、details 全同);委派管理闸门先以调用者自己的读取取得这一行,读得到的行仍按存储行判定。
  • 为什么改:落实 ruling 5985885287(调用者读不到的行与不存在的 id 回答一致,对所有主体类别都适用);组织管理员分支已由 fix(plugin-security): an organization administrator's refused assignment write answers the same for a row it cannot read as for a missing one #29932 落地,本 PR 把这条规则落到委派分支,以及“组织管理员兼持 adminScope”这一类调用者。
  • 风险与回滚:只改委派分支判断“有没有这一行”的读取来源;读得到的行判定与提示不变,原本放行的写入仍放行(含对该表无读权限的委派者),插入、租户级管理员、不持 adminScope 的组织管理员都不经此改动;唯一可见变化是不存在的 id 的删除由引擎的 404 改为闸门的 403(一种拒绝换成另一种)。回滚即撤销本 PR。
  • 先看:packages/plugins/plugin-security/src/delegated-admin-gate.ts 的 delegatedTargets 与 hiddenFromCaller(风险 hunk:读取被拒绝不算“读不到”,仍按存储行判);security-plugin.ts 中 readAsCaller 的接线;org-admin-assignment-boundary.posture.test.ts 末尾新增的 describe。
  • 两分钟验证:pnpm --filter @objectstack/plugin-security exec vitest run src/org-admin-assignment-boundary.posture.test.ts,预期 70/70 通过(含 group / isolated 下三类委派调用者的新用例与 single 对照)。
  • 需要你做的:无,席位落地。

What changes

  • The delegated walk asks the caller first. DelegatedAdminGate (ADR-0090 D12) judges a delegate's by-id update or delete of an assignment row (sys_user_position, sys_user_permission_set) only once the caller's own by-id read of that row — the read door's answer to this caller, every read visibility and wall included — has returned it. The read is fix(plugin-security): an organization administrator's refused assignment write answers the same for a row it cannot read as for a missing one #29932's organization-branch read, now one method (callerRead) both branches use.
  • No row is one answer, given at the gate. When the caller's read returns no row — the id names no row, or the caller cannot read it — the write is refused there: 403 PERMISSION_DENIED, "the assignment row it addresses could not be read", details { operation, object }. Neither case reaches the engine, so a removal of an id that names no row now answers that refusal instead of 404 RECORD_NOT_FOUND.
  • A row the caller reads is judged on the stored row, as before, so its verdict and its guidance are unchanged. The caller's own read is served through its field-level security, and a judgement made on what a field rule hid would be made on less than the row; the posture rig pins this.
  • A read the read door refuses outright (a declared 4xx) hides no row. The stored row is judged as before, and a refusal the gate then answers for the by-id write the caller addressed is answered with that read refusal by the security middleware (readDoorAnswerForGateRefusal), for every id alike — the same reading the by-id write door gives such a caller. A store fault in either read propagates as raised.
  • One caller read per operation. The security plugin passes the gate its per-operation pre-image read (readAsCaller → getCallerPreImage), so the organization branch, the delegated walk and the read-door questions after them share one read of the row.
  • Changeset: @objectstack/plugin-security patch.

Tests

  • Engine level, real ObjectQL + SQL driver + SecurityPlugin (org-admin-assignment-boundary.posture.test.ts, new top-level describe; the harness now also registers the two business-unit objects):
    • under group and isolated, for three callers — a delegate, an organization administrator who also holds the scope, and a delegate refused the read of both tables — and both tables, the update and the delete of a row the caller cannot read answer exactly what the same write answers for an id that names no row, compared whole (status, code, sentence, details); the no-row answer is the gate's 403, never the engine's; the row stays;
    • control: a row inside the scope that the caller reads is admitted; a row of its own organization outside the scope keeps the guidance naming its unit or its holder and is not answered as no row, after one read of the row as the caller; an assignment whose position a field rule hides from the caller is still held to the allowlist;
    • control, single: a row the delegate reads keeps its guidance, and every in-scope update and delete lands — the delegate refused the read included — reading the row as the caller once.
  • HTTP door (packages/qa/dogfood/test/delegated-admin-assignment-write-unreadable-row.dogfood.test.ts, showcase behind a real isolated wall, the showcase's own showcase_field_ops_delegate set): for a delegate and for an organization owner who also holds the set, PATCH and DELETE of an assignment row the caller cannot read answer exactly what an id naming no row answers; the row stays. Controls: the wall is real, each caller reads no such row; a row inside the scope that the delegate wrote is admitted; a row outside it keeps the guidance naming its unit.
  • One-shot ablations, not kept (each restored blob == HEAD blob, git diff HEAD empty):
    • engine, the caller-visibility question removed (node scripts/ablation-replace.mjs, anchor hit 1 time, blob 78e3ddaf → 47eb74de): posture rig 2 failed | 68 passed — the two walled "answers exactly what an id naming no row answers" cases; every control green;
    • engine, the shared-read wiring removed (blob 4e1045f1 → e13d4015): 3 failed | 67 passed — the three cases that count the caller's reads of the row (2, not 1);
    • HTTP, the visibility question made to answer "readable" always (blob 78e3ddaf → 35c1210c), plugin-security rebuilt, node scripts/ablation-dist-preflight.mjs @objectstack/plugin-security PLANTED_TEXT exit 0 (hit dist/index.js, dist/index.mjs): dogfood pin 1 failed | 2 passed — the unreadable-row case; restored, rebuilt, preflight --absent exit 0, 3/3.

Acceptance notes

  • Why Clause-②: no. The writes this newly refuses are by-id updates and deletes whose row the caller's read does not return; each was refused before too. An id naming no row was refused by the gate or answered 404 by the engine. A row the caller cannot read was refused by the gate or answered 404 RECORD_NOT_FOUND by the by-id write door's own read question — measured on the real engine under group and isolated for rows whose stored image is inside the scope (before: 404, row untouched; after: the gate's 403, row untouched). Every admission stays: in-scope rows the caller reads are admitted under all three postures, and a delegate refused the read keeps its in-scope writes under single (pinned).
  • The posture rig's test-budget: 20 header was written at 60 cases; the file now holds 70, and its tests took 8.9 s here on a shared box, inside the budget.
  • delegated-admin-gate.test.ts's harness reads through a fake ql that ignores context, so its by-id cases stand for a caller who reads the row; their expectations are unchanged.

Verification

Final head d57b423 (main merged at 098261a, clean)
  • Every command node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives (5 paths vs merge base 21510bb): 65 commands, each exit 0, captured before any pipe; --ran reconciliation: 65 derived, 65 run, 0 NOT-MEASURED (derived from the recorded exit codes). check:dual-build-cjs-loads and check:type-check-debt ran with the lock held and the dist they read built.
  • pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/org-admin-assignment-boundary.posture.test.ts: 70/70.
  • pnpm --filter @objectstack/plugin-security typecheck: exit 0 (tsc, scripts tsc, test layer 0 errors).
  • pnpm --filter @objectstack/dogfood test (full battery, once, under the verify lock): 415 files passed, 3 skipped; 3430 tests passed, 28 skipped; command-exit 0.
At 098261a (the main merge; the one later commit types two test reads)
  • pnpm turbo run build --filter=@objectstack/dogfood --concurrency=2: exit 0, 68 tasks.
  • pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 (full suite): 242 files, 5266 passed, 45 skipped.
  • pnpm --filter @objectstack/plugin-security typecheck, pnpm --filter @objectstack/dogfood typecheck: exit 0 each.
  • pnpm --filter @objectstack/dogfood exec vitest run --project isolated on this PR's pin and the organization-branch pin beside it: 2 files, 6/6.
  • First gate pass here: check:query-options-erasure exit 1 (test surface 236 to 238, the two new reads cast to any; typed in d57b423, then exit 0) and check:dual-build-cjs-loads exit 3 (prerequisite: seven packages outside the dogfood closure unbuilt; built, then exit 0). The whole derived set was then re-run on d57b423 (above).

Authored in session session_01QSeKYn5CmmdShCJifm6WYj (security#1 dispatch, no card).

…write answers the same for a row it cannot read as for a missing one

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
… write answers the same for a row it cannot read as for a missing one

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
…question reuses it

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
…nswers the same at the HTTP door for a row it cannot read as for a missing one

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
…or's assignment write answer

Claude-Session: https://claude.ai/code/session_01QSeKYn5CmmdShCJifm6WYj
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 3, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-justin · session_01QSeKYn5CmmdShCJifm6WYj

Contract-review-claim: session_01QSeKYn5CmmdShCJifm6WYj · head d57b423 · 2026-11-03T17:01Z

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-security, touching 13 documentable anchor(s).

14 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/approvals.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/automation/hooks.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/data-modeling/objects.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/deployment/environment-variables.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/permissions/administrator-guide.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/permissions/authentication.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/permissions/authorization.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/permissions/delegated-administration.mdx (via DelegatedAdminGate (symbol, a top-level class), sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/permissions/permission-sets.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/permissions/positions.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/permissions/sharing-rules.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/permissions/system-context.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/protocol/kernel/http-protocol.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/ui/actions.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))

⛔ 13 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/implementation-status.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite))
  • content/docs/releases/v13.mdx (via DelegatedAdminGate (symbol, a top-level class), sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v14.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v15.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v16.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v17/17-0.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v17/17-1.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite))
  • content/docs/releases/v17/17-4.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v17/17-5.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v17/17-6.mdx (via sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v18/18-0.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite))
  • content/docs/releases/v18/18-1.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))
  • content/docs/releases/v18/18-2.mdx (via sys_user_permission_set (literal, a string literal in assertDirectGrantWrite), sys_user_position (literal, a string literal in assertAssignmentWrite))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 61 of 219 client-bound route-ledger rows — the other 158 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 158: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 103 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 17 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 6a4737abae46e1d6847d7abfe430e5d62cd927f0 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 3652020d8c0481e3cf394085a9e8ed3e388d7e71 — the merge of head d57b423215a1c113740b409110558096c29f69f2 into base 6a4737abae46e1d6847d7abfe430e5d62cd927f0, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3652020d8c0481e3cf394085a9e8ed3e388d7e71 && git checkout 3652020d8c0481e3cf394085a9e8ed3e388d7e71
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6a4737abae46e1d6847d7abfe430e5d62cd927f0 d57b423215a1c113740b409110558096c29f69f2 && git checkout -B drift-repro 6a4737abae46e1d6847d7abfe430e5d62cd927f0 && git merge --no-ff d57b423215a1c113740b409110558096c29f69f2

node scripts/docs-audit/affected-docs.mjs --json 6a4737abae46e1d6847d7abfe430e5d62cd927f0

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 6a4737abae46e1d6847d7abfe430e5d62cd927f0 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-justin · session_01QSeKYn5CmmdShCJifm6WYj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d57b423215a1c113740b409110558096c29f69f2
Local-runs: none
Scope: packages/plugins/plugin-security/src/delegated-admin-gate.ts, packages/plugins/plugin-security/src/security-plugin.ts, packages/plugins/plugin-security/src/org-admin-assignment-boundary.posture.test.ts, packages/qa/dogfood/test/delegated-admin-assignment-write-unreadable-row.dogfood.test.ts, .changeset/delegated-admin-unreadable-row.md + packages/plugins/plugin-security/src/security-plugin.ts (getCallerPreImage, readRowById, callerCannotReadAddressedRow, absentUnderCallerRead, readUnlessRefused, the gate's construction), packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts (the isSystem bypass, the gate call, readDoorAnswerForGateRefusal, step 2.7's re-read and its not-found answer, nestedInOperation), packages/plugins/plugin-security/src/security-plugin-addressed-writes.ts (addressedByIdWriteId, extractSingleId, readRowById), packages/plugins/plugin-security/src/security-plugin-object-admission.ts (canWriteObject's call into the gate), packages/plugins/plugin-security/src/errors.ts (PermissionDeniedError, DelegationScopeViolationError), packages/plugins/plugin-security/src/delegated-admin-gate.test.ts (the context-ignoring findOne double, the by-id update and delete cases), packages/plugins/plugin-security/src/objects/sys-user-position.object.ts, packages/plugins/plugin-security/src/objects/sys-user-permission-set.object.ts, packages/types/src/data-error-classification.ts (declaredHttpStatus), packages/metadata-core/src/engine-update-dispatch.ts (resolveEngineUpdateDispatch), the organization branch as landed by the sibling (organizationAdminFailure, organizationTargets, its contract-review record)

Reviewed on the net diff against main at the merge base (5 files, +513/−21), the PR body, the ruling and its thread, the landed sibling as precedent only, and the head's check-runs. No dispatch order and no dispatching seat's conclusions were read as inputs. The record stays at rule level.

① Derived judgments

What changes. In the delegated branch of the ADR-0090 D12 gate, whether a by-id update or delete has a row to judge is now answered by the caller's own by-id read (the read door's answer, every read visibility and wall included), and the gate refuses at once when that read returns no row. The verdict on a row the caller reads is still taken on the stored row, so its guidance is unchanged. The organization branch's caller read (landed by the sibling) and the delegated branch's read are now one method, and the security plugin hands the gate its per-operation pre-image read so the gate, the read-door question after a refusal, and the later write gates read the row once between them.

  • Empty caller pre-image on update and delete. Right. The delegated walk refuses both verbs at the gate when the caller's read returns no row (403 PERMISSION_DENIED, one sentence, details { operation, object }), and no verb falls through to the engine. Before this head a delete naming no row was admitted by the walk and answered by the engine's not-found, while an update naming no row was refused by the walk with a different sentence; both now answer the same refusal. The lifecycle verbs take the same path (judged on the pre-image alone).
  • Under group and isolated, per principal class. The delegate: its read returns no row for a row behind the wall, so hidden and missing answer alike (whole refusal: status, code, sentence, details), pinned on both tables. The organization administrator who also holds a scope: the organization branch refuses first (for a delete, after the caller read; for an update, before any read), authorize then hands the write to the delegated walk because scopes are held, and the walk answers both ids with the same refusal through the same shared read; pinned. The edit-without-read delegate: its read is refused outright, which the gate classifies exactly as the by-id door's own read question does (a declared 4xx is not a hidden row), so the stored row is judged; a row outside its scope and an id naming no row both reach a gate refusal, which the middleware answers as that caller's read refusal for every id alike; pinned equal on both tables. All three classes answer hidden and missing byte-for-byte within the class. Across classes the shape differs (the delegates' gate refusal versus the read-refused delegate's read refusal), which is not a split within any one caller.
  • A row the caller reads. Unchanged verdict and guidance under every posture: the in-scope row is admitted (both tables, both reading delegate classes, update and delete, pinned at engine level; PATCH on the HTTP door), the own-organization row outside the scope keeps the guidance naming its unit or its holder and is not the no-row answer (pinned, and pinned not to equal the no-row answer).
  • single. No wall, so a row of any organization is one the delegate reads, and the guidance stands; every in-scope write lands, the read-refused delegate's included; pinned.
  • Tenant-level administrators, inserts, system and flow-system writes, organization administrators holding no scope, filter writes. All return or are refused before the walk; untouched by the diff.
  • Clause-②: no is true. Every write that lands today still lands. A row the caller reads is judged on the same stored row as before, so admissions are unchanged. A row the caller cannot read (absent from its read) was already refused before this head: by the walk with guidance when it was outside the scope, and by the by-id write door's own step 2.7 question when it was inside the scope (that step re-reads under the caller's context with the write-class filter, and the wall is a layer of that filter on both walled postures). The declared read refusal is handled as the door handles it, so the read-refused delegate's admissions are unchanged by construction, and the single control measures it. On the nested by-id writes (cascade, hook, flow-run-as) under the caller's context on an in-scope row the caller cannot read: the dev's note is reasoned, and the tree bears it out for these two objects, which declare no sharing, owner floor or other read visibility beyond the wall and the caller's field rules. Such a row is hidden only by the wall, and the wall is in step 2.7's write filter, so that write was refused at step 2.7 before and is refused at the gate now (one refusal exchanged for another). Accepted as reasoned, with a measurement asked for in ③.
  • The admission preview (canWriteObject) hands the gate an id-less preview, which the walk refuses before any read, as before; a preview carrying an id now answers false for a row the caller cannot read, which only brings the preview nearer to the write's own answer.

② Semver level

patch for @objectstack/plugin-security; Clause-②: no, Metadata-protocol: none, on the PR body and the changeset alike. Correct: no published schema, spec export, route or wire shape moves, and the only observable changes are refusals exchanged for refusals (the delegated walk's answer for a by-id write of a row absent from the caller's read, including the engine's not-found becoming the gate's refusal for a delete naming no row). The changeset carries the rule and both declaration lines and no mechanism.

③ Boundary flags

  1. The verdict on the stored row is within the ruling. The ruling's rule is that a row the caller cannot read answers what a nonexistent id answers, for every principal class, by reusing the read door's visibility judgment and adding no new door. This head reuses that judgment to decide whether a row exists for the caller, and takes the boundary verdict on the stored row because the caller's own read is served through its field rules, and in the delegated walk a judgment made on a row missing its position or its set would be made on less than the row and would admit a write outside the allowlist (the organization branch fails closed on such a read; the delegated walk would not). The posture rig pins the field-hidden case to the allowlist. The visibility question is the caller's; the ruling does not govern which columns the boundary weighs. Within the ruling.

  2. The residual for the read-refused delegate: a maintainer question, not a must-fix here. A delegate refused the read of the table outright still lands an in-scope write and is answered its read refusal for an id naming no row. That caller holds the write on the row and the write lands, which is the row answering as a row the caller may write, the class the ruling itself keeps distinct. The gate's classification of a declared read refusal is the by-id write door's own (absentUnderCallerRead), so the two doors read the ruling one way, and changing it here alone would split them. Whether an edit-without-read grant should keep landing writes at all is a question on the write door for every object, and goes to the maintainer; it does not block this head.

  3. The shape of the shared answer: a maintainer question. The ruling names the shared answer the read door's answer, and rejected option B partly because a refusal for a typo'd id misleads. Step 2.7 answers an absent row with the read door's own not-found; this gate answers it with its own 403, for the delegated walk as the sibling did for the organization branch. Hidden and missing are equal either way, so the rule holds, and the pins measure it. Whether both branches should answer with the read door's not-found instead, in one follow-up, goes to the maintainer.

  4. Check-runs on this head at the time of this record (2026-11-03T17:10Z). Success: Auto Label, Check Changeset, Check PR Size, Dogfood Regression Gate, Flag docs affected by code changes, Governed Surface Queue Guard, Lint · ESLint, Lint · docs & code guards, Lint · repo & tooling gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Lint · scoped · tooling self-tests, Live E2E UI, PR-body guards, Plan Test Core shards, Spec property liveness, Test Core (5/8), Test UI, Type Check · consumer gates, Type Check · debt ledger, Type Check · source gates, Type Check · workspace, TypeScript Type Check, filter. Skipped (opt-in or no UI change): 18.x upgrade harness, Build & E2E UI, Build Docs, Build UI Deps, the Dogfood Regression Gate shards, Dogfood Verify CLI, Lint UI, Packed-tarball smoke, Schedule gate, Temporal Conformance, the Test UI shards, Type Check UI, UI Published Artifacts. STILL RUNNING: Build Core, Lint · CI, release & engine gates, Lint · PM dispatch-gates, Test Core 1/8, 2/8, 3/8, 4/8, 6/8, 7/8, 8/8. Their conclusions are the gate verdicts; this PASS does not stand in for them, and the posture rig and the unchanged unit harness are among what the running shards measure. The Dogfood Regression Gate's shards were skipped, so the new HTTP pin's execution on this head is not evidenced by a check-run.

  5. The HTTP pin's red leg. The HTTP ablation was run on the question made to answer "readable" always and the pin went red, so the pin can fail. Its single-posture and read-refused legs are engine-level only, which is the right level for them. Accepted.

  6. The nested-write note (should-measure, no card). The reasoning in ① holds for these two objects on this head; a pin of one nested by-id write under the caller's context on a walled row would make it measured. The seat's follow-up.

  7. Public text under §6. Title, body, changeset and test names state the rule. The word sweep finds one near-match, in the single-posture control's test name, where the row named is one the delegate reads and the clause states the guidance it keeps, not a disclosure; within §6, the same wording as the sibling's control. No breach.

④ Design judgment

Tried to break it against the cited code; no must-fix found.

  • A principal class or verb that still splits. None within a class. Update, delete and the lifecycle verbs go through one delegatedTargets; the organization administrator holding a scope reaches the walk for both verbs; the read-refused delegate is answered its read refusal for every id the gate refuses. The admission preview and the explain surface do not take a different path.
  • Caller read and stored read disagreeing. The caller read decides only presence; the stored read is a bare system read, unscoped by any organization, as the walk's read was before this head. A row present to the caller and absent to the system read can only be a row removed between the two reads, and answers the no-row refusal, which is the honest answer. A row absent to the caller is never judged, so no guidance can be worded from a read the caller did not make. The write itself still passes step 2.7's own re-read and the wall composed into the write, so the gate's read is advisory to the gate alone, as before.
  • Double read and memo sharing. readAsCaller is the plugin's memoised per-operation pre-image read, keyed on the id. The organization branch and the walk ask it in turn for the organization administrator who holds a scope, and the read-door question after a refusal asks it again: one read, memo hits after (pinned at 1 for the delegate's out-of-scope refusal and for every admitted in-scope write). On a refused read nothing is memoised, so the read-door question asks the door again and receives the refusal (pinned as the one uncounted case). The gate's extractSingleId and the door's agree on a by-id write (payload id first, then the where id), so the memo key and step 2.7's id are the same value. The admission preview hands a synthetic context, whose memo is its own. The gate no longer swallows a store fault on the pre-image read as the walk did before (a catch that answered no row); a fault propagates as raised, as the door's read does, which is the right change and the sibling's shape.
  • Refusal sentence and details between the two sides. Within the walk, the no-row refusal is one sentence and one details object for a hidden row and a missing id; the posture rig compares the whole refusal, the HTTP pin the whole body with only the caller-supplied id written out. The organization branch's own no-row sentence differs from the walk's, but no caller receives one for one id and the other for another: an administrator holding a scope always ends in the walk.
  • Guidance naming a field the caller's own rules withhold (should-fix, not blocking). For a row the caller reads, the walk's refusal still names the position and the set it carries, as it did before this head, and the new control pins that sentence for a holder whose field rule hides the position. The verdict on the stored row is right (③.1); the pin should hold the verdict and its code, not the named value, and whether the sentence should name a value the caller's field rules hide is the maintainer's. Pre-existing wording, not introduced here.
  • The unchanged unit harness. Its findOne double ignores context, so every by-id case stands for a caller who reads the row, and the walk's caller read and stored read return the same row; expectations unchanged. A case removing an id the double does not hold would now be refused rather than admitted; the file is among what the running shards measure.
  • The HTTP pin. Boots the showcase behind a real isolated wall, asserts the wall active and not degraded, both callers no platform administrator and active in their organization, each reads no row behind the wall and reads its own in-scope row, and compares PATCH and DELETE answers whole. The in-scope control is written by the delegate itself through the door so the record-level rules after the gate admit its edit and the control measures the gate's verdict; the out-of-scope control asserts the guidance names the unit and is not the no-row answer. Sound.
  • Posture rig budget. The file's test-budget: 20 header stands at 70 cases; the dev reports 8.9 s on a shared box. Inside the budget; the running shards decide.

Implemented-by: claude/sec-hardening-l
Reviewed-by: session_01QSeKYn5CmmdShCJifm6WYj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-justin · session_01QSeKYn5CmmdShCJifm6WYj

席位核对

ACCEPT · head d57b423215a1c113740b409110558096c29f69f2 · 2026-11-03T17:30Z

  • Shape: 5 files, +513/−21. Not governed. Under 3000. Patch for plugin-security. Clause-②: no, Metadata-protocol: none.
  • Rule held (ruling 5985885287, every principal class): in the ADR-0090 D12 gate's delegated branch, the caller's own read decides whether a row exists. Three callers each answer a row they cannot read byte-for-byte like a missing id, under group and isolated: a delegate, an organization administrator who also holds a scope, and a delegate refused the read. An empty caller pre-image is refused at the gate on update and delete, never at the engine. A row the caller reads is judged on its stored image, so the guidance is unchanged.
  • Contract review: comment 6610617597. Served-tier: CONTRACT_REVIEW_TIER. Head-sha equals this head. VERDICT PASS, no must-fix.
  • Check-runs at this head: 36 success, 13 skipped, 0 failed, all completed. Skips judged by name (opt-in, no UI change, dogfood shard placeholders); check-expected-skips.mjs NOT MEASURED. mergeable_state read before arming: clean.
  • Gates: local dispatch-gates --ran at this head: 65 derived, 65 run, 0 NOT MEASURED. Posture rig 70/70. Full plugin-security suite and full dogfood battery green: 415 files, 3430 tests. The HTTP pin has a measured red leg (ablation (c)).
  • Accepted deviations:
    • The verdict is taken on the stored row and the caller's read decides presence. The review judged this within the ruling, because a verdict on a field-masked read would admit writes outside the allowlist.
    • A declared read refusal is not counted as a hidden row. This is the by-id write door's own reading.
    • Pre-image memo sharing is done.
  • Seat follow-ups (not for this landing):
    • Pin one nested by-id write under the caller's context on a walled row.
    • The control's pin should hold the verdict and code, not the named value.
  • Maintainer questions (decision batch, not changed here):
    • Should a delegate refused the read of the table answer alike for in-scope rows (this touches the by-id write door generally)?
    • Should both gate branches answer the read door's not-found instead of the gate's 403?
    • Should the walk's guidance name a value the caller's field rules hide?
  • Landing: ready, then auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant