Repository navigation
feat(lint): warn when another permission set's View All, Modify All or viewAllFields re-opens a field one set hides - #37016
Conversation
…elds re-opens a hidden field (WIP) Claude-Session: https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7 Co-authored-by: Claude <noreply@anthropic.com>
…-reopen; wildcard rule reads viewAllFields Claude-Session: https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7 Co-authored-by: Claude <noreply@anthropic.com>
…nt-cross-set-field-reopen
…bility meta-tests Claude-Session: https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7 Co-authored-by: Claude <noreply@anthropic.com>
…ssue-36052-lint-cross-set-field-reopen
…oss-set-field-reopen
Claude-Session: https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7 Co-authored-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011y7As5bdhV5T4N9vpjmZzH
📓 Docs Drift CheckThis PR changes 1 package(s): 20 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 7 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 4 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 9390ea1d5cb516fe324c6e6653b1d8bc4911cd86 && git checkout 9390ea1d5cb516fe324c6e6653b1d8bc4911cd86
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a73edb3cd784e212c7b8b21757a44c0cfed9adfe 8ef5a6dd11a5f666c711162009c7ad17bb5350a9 && git checkout -B drift-repro a73edb3cd784e212c7b8b21757a44c0cfed9adfe && git merge --no-ff 8ef5a6dd11a5f666c711162009c7ad17bb5350a9
node scripts/docs-audit/affected-docs.mjs --json a73edb3cd784e212c7b8b21757a44c0cfed9adfe
|
|
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH 席位核对 — ACCEPT · head 8ef5a6d2026-11-24T16:24Z · L1 (one-shot reviewer), checked against GitHub and CI on this head: all check-runs completed at 2026-11-24T16:24Z: 57 Checklist
The
|
|
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH Landing — seat arms #37016
|
repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH
Fixes #36052
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
security-cross-set-field-reopeninpackages/lint/src/validate-security-posture.ts. For a field that one set hides (readable: false) or edit-locks, and that another set re-opens throughviewAllRecords(View All),modifyAllRecords(Modify All) orviewAllFieldson the object (its own entry for the object, else its'*'entry, a lookup, never a merge), it reports one finding per hiding row and re-opening set, on the hiding row's path, naming both sets and the field. The hint carries the ruled steering: drop the bit, give the second set its ownreadable: falserow (beside View All /viewAllFieldsonly), sayviewAllFields: truewhen the second set should read every field, or, for a field that must stay hidden from everyone without a capability, declarerequiredPermissionson the field (ADR-0066 D3) plus amaskingRulewhere a partial value is needed.superuserFieldVotein@objectstack/corereads it: Modify All votes read and edit on every field; View All andviewAllFieldsvote read only, and cast no read vote on a field the same set's own row declaresreadable: false.requiredPermissions(that AND-gate is folded in after the merge, so no set's bit opens it); an edit lock beside View All orviewAllFields(they never vote an edit); a key on an object this stack does not define, or naming a field the object does not declare (security-fls-unknown-fieldowns that); any judgement by field name.security-superuser-field-mask-inert. That rule owns the same-set case (a set's own Modify All unbinding its own row). The new rule skips any hiding row whose own set holds Modify All on the object, so that row gets exactly one finding, from the same-set rule. Beside its own View All alone, a set's row still binds its holders (the 2026-11-15 note), so it is judged here against the other sets. Both rules'os explainentries now point at each other.security-wildcard-vamareadsviewAllFieldson a package-authored'*'entry (scope widened by L2 record 7063858938, card comment 7063882080). Error, not warning, the same tier as the two record bits, because: the wildcard bit is the field half of the same package-authored superuser (a read vote on every field of every object, other packages' objects included); the organization boundary already refuses to distribute such a set (the delegated-admin gate's condition (a) reads the three bits alike); and the key is not in any release yet (its changeset.changeset/36050-view-all-fields-bit.mdis still pending), so no stack a released version accepted stops building. A wildcard with the record bits keeps its message; the hint names every bit present.viewAllFieldson an object's own entry is not reported by this rule.rule-explanations.ts(new entry, plus the two neighbouring entries updated), user sentences invalidate-security-posture.user-text.tsfor every platform locale, the id exported frompackages/lint/src/index.ts, and apatchchangeset for@objectstack/lint.Why
Ruling 6912661484 on #34365, step 2: an author who hides a field from one role with a
readable: falserow is not told that a holder of another set with View All on the object reads it anyway (the hotcrm#2481 case). Field grants union without deny, so the warning is the only place the author learns of it before the field-axis split makes View All / Modify All stop voting on fields.Tests
New file
packages/lint/src/validate-security-posture-cross-set-field-reopen-36052.test.ts(16 cases), plus updates tovalidate-security-posture.test.tsandfinding-user-text.test.ts. The card's acceptance fixtures map as: two-set hide + View All fires; + Modify All fires (read and edit); +viewAllFieldson the second set fires (own entry and'*'); one set alone does not; arequiredPermissionsfield does not. The wildcard rule has three cases (bit alone is an error naming it; one finding with all three bits; record-bit wording kept, per-object andfalsebits not reported).Run on head
8ef5a6dd11a(after mergingorigin/mainat57445a69981):pnpm --filter @objectstack/lint test, typecheck
Ablation (source-resolved: the test imports ./validate-security-posture.js, so no dist leg), via scripts/ablation-replace.mjs
Acceptance notes
holdsViewAllFieldsin lint is a copy of the private helper of the same name in@objectstack/core(security/effective-object-permissions.ts); lint does not depend on core. The two copies read the bit identically today (own entry else'*',=== true); noted, not filed.packages/lint/src/index.ts(one export line) is outside the claim's declared file surface; it is the barrel the new rule id needs to be importable like its siblings.editable !== true, so a row that declares onlyreadable: falseis also an edit lock; the explanation sayseditableomitted parses to false.Verification
Local gate subset:
node scripts/pm/dispatch-gates.mjs --commandsderived 68 families for this diff;--ranreconciliation: 68 derived, 65 run (all exit 0), 3 NOT MEASURED, 0 unrun.check:dual-build-cjs-loadsandcheck:lean-entry-closure(exit 3, PREREQUISITE NOT MET: they read every package's built output; a scoped objectql build hit the shared lock's queue timeout). CI's Build Core runs them.check:type-check-debt(a 500 s timeout on the shared box, whole-repo typecheck). CI's TypeScript Type Check runs it.Files to read first, by risk:
packages/lint/src/validate-security-posture.ts, thepushCrossSetFieldReopenandobjectWideFieldVotehunks (the vote reading and the skips).security-wildcard-vamahunk (a new error path).packages/lint/src/validate-security-posture.user-text.ts(sentences per locale).Two-minute check:
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-security-posture-cross-set-field-reopen-36052.test.ts. Expect 16 passed.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI).main, one pull request.packages/spectouched: not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code