Skip to content

sharing: a sharing rule written through /api/v1/data/sys_sharing_rule (the Setup form) still stores a user recipient no user carries, which defineRule now refuses #38254

Done
0 of 1 issue completed

Description

@objectstack-fleet

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Filing gate: ① (product defect, named real producer) · Source: fleet. This is follow-up work owed by PR #38216 (card #33912), which refuses an unresolved user recipient at SharingService.grant and SharingRuleService.defineRule and lists the /data door as unchanged.

What happens

Read in code by the PR #38216 dev and confirmed by both contract reviews on that PR (records 7236871996 and the delta on head 8eb8823, ③ out-of-scope finding 1). The sys_sharing_rule guard in packages/plugins/plugin-sharing/src/rule-hooks.ts judges only object_name. So POST /api/v1/data/sys_sharing_rule, the door the Setup sharing-rule form writes through, still stores a rule whose user recipient id resolves to no user (or, under a wall, to no member of the rule's organization). The rule is inert: it grants no one access, and the author is told it saved. Not measured at the live door. Every id is accepted alike, so there is no existence oracle, and no security finding.

Expected

A sharing rule written through the /data door (insert, and an update that changes the recipient) gets the same refusal as defineRule after #38216: VALIDATION_FAILED, the same sentence, judged in the rule's organization, with no cross-organization oracle (an unknown id and another organization's user answer alike). The system context stays unjudged. Reuse SharingService.userRecipientRefusal rather than a second implementation.

Business reason

An admin who picks a wrong or deleted user in the Setup form gets a rule that silently shares nothing. The people the rule was meant for keep being denied, and nobody is told why.

Reader who acts

An area:data seat, after #38216 lands (Blocked-by: #38216). The landing point is packages/plugins/plugin-sharing/src/rule-hooks.ts.

Blocked-by: #38216

Dedupe

is:issue sys_sharing_rule recipient data door → 24. is:issue sharing rule unknown user recipient rule-hooks → 14. The only open hit on this mechanism is #33912 (this seat's). Its PR closes it, so this follow-up gets its own card. #30621 and #23952 (closed) are other mechanisms.

Grade: area:data · Bug · p3 · reach: named producer rule-hooks.ts sys_sharing_rule guard (judges object_name only)

Sub-issues

Sub-issues

0 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    bug
    pm:queue
    on Nov 28, 2026
  2. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t

    Triage: lands in packages/plugins/plugin-sharing/src/rule-hooks.ts · area:data · domain:server · Bug · p3 (fleet grade, unchanged) · pm:blocked · size S. Rationale: the fix reuses the recipient refusal that PR #38216 introduces (card #33912, in flight). That PR is still an open draft, so the card waits on it (Blocked-by: #38216 already in the body) and is not folded, because in-flight work is never folded into. The wrong recipient is stored as an inert rule and grants no one access, so Impeded × rare admin configuration ⇒ p3. When dispatched, the fix must keep the card's requirement that an unknown id and another organization's user get the same answer, and pin it.
    Path: none
    Grade: area:data · Bug · Impeded · reach: rare admin configuration (Setup sharing-rule form) · evidence: read (origin/main).

    Recorded 2026-11-28T13:56Z.

  3. added
    domain:server
    pm:blocked
    and removed
    pm:queue
    on Nov 28, 2026
  4. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t

    Path: none
    Unlock: Blocked-by: #38216 is done. PR #38216 (the user-recipient refusal) merged at 2026-11-28T14:03Z ⇒ pm:blocked → pm:queue. The fix now reuses that merged refusal at the /api/v1/data/sys_sharing_rule door. The first-touch notes stand: an unknown id and another organization's user get the same answer, pinned.

    Recorded 2026-11-28T15:46Z.

  5. added
    pm:queue
    and removed
    pm:blocked
    on Nov 28, 2026
  6. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CaJjkQx5fPE4Fbmoeq

    Claim: PM loop round 2 · 2026-12-03T14:29Z
    Session: session_01Utp6CaJjkQx5fPE4Fbmoeq
    Thread session: session_01Utp6CZVKCmRkE5bj7Rwba3
    Account: os-bill
    Branch: claude/project-thread-6t02u3
    Worktree: objectstack (card thread container)
    Domain: domain:server
    Seat: repo:objectstack@os-bill
    Area: data-1203
    File surface: packages/plugins/plugin-sharing/src/rule-hooks.ts, packages/plugins/plugin-sharing/src/sharing-plugin.ts, a new pin test packages/plugins/plugin-sharing/src/sharing-rule-recipient-guard.test.ts, a patch changeset. Stop on any other breach and explain in the report.
    Container & model: S, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate), effort: high (reason: an accept-set narrowing on the data door with pre-image and org resolution)
    Clause-②: no (narrowing)
    Clause-② note: the /api/v1/data/sys_sharing_rule door stops storing a user recipient that defineRule already refuses (same refusal sentence, no new code, export or key); a narrowing owes one contract-tier review before the queue.
    Metadata-protocol: none
    Responsibility: rule-hooks.ts (the only non-criteria data-door guard on sys_sharing_rule judges object_name alone) in objectstack plugin-sharing; defineRule covers the service path but not the data door; every admin saving a sharing rule through the Setup form, today.
    Thread-read: 7241733218
    Premise: holds — read by the card thread at origin/main 850d240: bindRuleObjectEnforcementGuard (rule-hooks.ts:405–430) judges object_name only; the recipient is judged only in defineRule (sharing-rule-service.ts:868–890) via userRecipientRefusal (sharing-service.ts:2350); blocker #38216 merged.
    Pre-claim lane: domain:server (plugin-sharing); the seat keeps it.
    Pre-claim deps: #38216 merged.
    Prior rulings read: thread read by the card thread; no ruling on the card.
    Serial constraints cleared: check-handover.mjs --inflight --card=38254 on the two source files → no overlap read (#38415, #35238 name no path).

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Dec 3, 2026
  8. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CaJjkQx5fPE4Fbmoeq

    Claim amendment: 2026-12-03T15:06Z · claim 7381546986 widens by one gate-forced file: check-system-context-census requires the new guard's isSystem early return to be owned by a census row. Work resumes on the maintainer's 15:02Z approval to carry PR #39361 to merge.
    File surface: content/docs/permissions/system-context.mdx (row 40's Symbol and Lose cells name bindRuleRecipientGuard, plus the generated register from --write)

  9. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CaJjkQx5fPE4Fbmoeq

    Claim amendment: 2026-12-03T15:07Z · claim 7381546986 widens by one test fixture the new guard breaks by design: the pin posts a made-up user recipient, which the guard now refuses before the declared-name guard it pins.
    File surface: packages/runtime/src/sharing-rule-declared-name.data-door.pin.test.ts (the recipient becomes the signed-in dev admin's real user id; fixture only)

  10. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CaJjkQx5fPE4Fbmoeq

    Claim amendment: 2026-12-03T16:43Z · claim 7381546986 widens by two prose pages that the zone's L1 round 1 asked for (the Skills-docs: line the narrowing owes).
    File surface: content/docs/kernel/runtime-services/sharing-service.mdx (line ~108, the data-door recipient refusal), content/docs/permissions/sharing-rules.mdx (one paragraph after the object refusal)

  11. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

    Close-out: 2026-12-04T01:57Z · PR #39361 merged at 2026-12-04T01:53Z as 49b2dd83; it closed this card. os-zhuang APPROVED 6180532852; contract review delta PASS 7396996931 (fable, by the seat repo:objectstack@os-elon-musk); landing 7397167801 and re-queue 7397866159. The state label leaves with this note.

  12. removed
    pm:dispatched
    on Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:databugdomain:serverpriority:p3

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions