Repository navigation
fix(security): a Modify All holder deletes the records they own beside an authored delete policy - #39587
Conversation
…thored delete policy (red) Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj Co-authored-by: Claude <noreply@anthropic.com>
…an authored delete policy (by id) Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj Co-authored-by: Claude <noreply@anthropic.com>
… holder's owner term admits Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj Co-authored-by: Claude <noreply@anthropic.com>
…cted #39339 sentence Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 2 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 — 18 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 5856abbaaa76af1a7d3db9ab76fff35d365e2c02 && git checkout 5856abbaaa76af1a7d3db9ab76fff35d365e2c02
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8b1560bcd814f5f4699fb273b930b1984436fb4c 6e344f2e9cfa88981e6c7f934e2cd29c44f6d186 && git checkout -B drift-repro 8b1560bcd814f5f4699fb273b930b1984436fb4c && git merge --no-ff 6e344f2e9cfa88981e6c7f934e2cd29c44f6d186
node scripts/docs-audit/affected-docs.mjs --json 8b1560bcd814f5f4699fb273b930b1984436fb4c
|
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cwiNRyb9B38wT2fjYj Final green head: 2026-12-04T15:12Z · |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czzaKz49WLAvKtdyiY 席位核对L1 verdict (L1-b): ACCEPT at head Face: Against the ruling (7403225870, option A: the owner term admits delete for every owner, Modify All holders included; the ADR-0066 ① bypass stays out; the
Pins: Changesets: the new Landing: non-governed, under 3000 lines, Generated by Claude Code |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czzaKz49WLAvKtdyiY Contract reviewServed-tier: PR #39587 for card #39464, judged against ruling of record 7403225870 (option A of analysis 7398101528). Read: the card body and all six comments, the PR body and its six-file list, the net diff against Check-runs on this head: 39 success, 18 skipped, 1 failure. The one failure is ① Derived judgments
② Semver level
DELIBERATE CORRECTION of
The rest of that note, read at this head sentence by sentence:
New note
③ Boundary flagsDev report 7406862417 carries no
Earlier report 7403602744, both questions closed by claim amendment 7403630375: the surface was widened to Not ruled and not touched: the SQL push-down: ④ Design judgmentNo must-fix, no should-fix.
Nits (no effect on correctness or the contract; none is to be fixed on this head):
Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7 Landing · PR #39587 (Fixes #39464) · head
Follow-ups owed from L2 7415678902, not filed now because the seat is standing by on the maintainer's word (2026-12-04T15:09Z): N1 (a decision card: Modify All plus a declared write depth loses "above the owner" for delete, paired with the unruled writeScope |
Fixes #39464
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Ruling of record 7403225870 (route A) on #39464, as quoted: 「Route A: beside an authored delete policy, the owner term admits delete for every owner, Modify All holders included. The ADR-0066 ① bypass stays excluded.」
security/explain(security-plugin-rls-filter.ts, new siblingmodify-all-owner-delete-term.ts): beside an authored delete policy the declared write authority'sallowcannot speak for ownership when the caller holds Modify All, because the write depth the bit manufactures isorgand the bypass answersallowon every other row. Measured: the existingallowadmits a row the holder neither owns nor created, so it is not reused. For that caller the composition keeps the floor and the authored terms as before and adds one OR term,owner_id == current_user.id. That is the owner read off the row, nothing the bit adds: a row of another owner and a row with no owner stay refused. No term is added where the owner column is not provable (isOwnerAnchorUnprovable) or the field set could not be read.security-plugin-authz-middleware.ts,predicateWriteFloorReliefonly, surface widened by the dispatching seat): before this, the relief answerednullwhenever the floor-replaced Layer 1 was non-null, so a predicate delete kept the floored Layer 1 and missed the owned row the by-id door now admits, which would break ruling of record 7063130499 (A: one answer by id and by predicate). Now, when the replaced Layer 1 differs from the floored one, the matched rows the floor refuses are first narrowed to the rows the replaced Layer 1 admits (one read under the caller's context; refused read keeps the floor), and only those are asked their by-id verdict. When the two are the same tree, which is every case except this one, it still answersnullwith no verdict asked.writeScope(the spec refuses it), so the holder's depth apart from the bit isownunless a second set declares one, and that depth's owner set needs the hierarchy resolution behind the sharing service.DELIBERATE CORRECTION
.changeset/39339-owner-beside-delete-policy.md(pending, from PR #39448) said a Modify All holder "deletes the records the policy admits and the ones they created, and no others". This PR makes that false. Corrected sentence: "so its holder deletes the records the policy admits, the ones they created and the ones they own, and no others."check-empty-changesetstays red on this file on purpose; the confirming record is the dispatching seat's.Tests
owner-beside-authored-delete-policy.test.ts: Modify All owner deletes by id (DEALpublic_read_write, SECRETprivate) andsecurity/explainsays so first; Modify All holder refused another owner's row and an ownerless row (bypass stays out); Modify All predicate delete removes the closed, created and owned rows and leaves another owner's and the ownerless row; no-owner-column object keeps the creator rule for a Modify All holder.owner-beside-authored-delete-policy.test.ts+predicate-write-floor-deferral.test.ts):Acceptance notes
allow, which the delegated agent leg never receives, and the delegator's floored leg is unchanged.writeScope: 'org'asymmetry named in analysis 7398101528 is untouched.Verification
Read first, by risk:
packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts,predicateWriteFloorReliefsteps 2 and 4: the narrowing read before verdicts are asked.packages/plugins/plugin-security/src/security-plugin-rls-filter.ts, theholdsModifyAllOnDelete/ownershipAllowAdmitsRowblock.packages/plugins/plugin-security/src/modify-all-owner-delete-term.ts.Two-minute check:
pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/owner-beside-authored-delete-policy.test.tsshould show 28 passed.Local readings at head
6e344f2e(treeobjectstack-ai/objectstack, merge base0f5da90d):Suite, typecheck, derived gates
pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2: Test Files 294 passed (294), Tests 7461 passed, 52 skipped; VERDICT command-exit 0.pnpm --filter @objectstack/plugin-security typecheck: 0 TS errors, check:test-typecheck OK; VERDICT command-exit 0.dispatch-gates --commands(73 families): 70 exit 0;check-empty-changesetexit 1 on the corrected pending changeset (deliberate, above);check:dual-build-cjs-loadsandcheck:i18nexit 3 PREREQUISITE (no full build here): NOT MEASURED, CI owns them.--ran: 73 derived, 71 run, 2 NOT-MEASURED.check-nul-bytes: OK.test:repo(CITest Core); no exported symbol renamed or removed, so the platform-checklist rename check does not apply.Generated by Claude Code