Skip to content

fix(perms): pin listing provenance and kind, owners edit only community pins, flags bind author - #20

Merged
jphein merged 3 commits into
mainfrom
fix/perms-provenance-flags
Oct 23, 2026
Merged

jphein merged 3 commits into
mainfrom
fix/perms-provenance-flags

Conversation

@jphein

@jphein jphein commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Server-side rules for the 2026-10-22 security scan (private advisory GHSA-72r8-ccwp-xcwq). Client and seed fixes went in #19.

  • F8/F9: listings.create needs source null/community, no sourceId/sourceSyncedAt, and aggregates in createListing's range. Owner edits freeze source/sourceId/sourceSyncedAt.
  • F3–F6 server-side: kind must be one of the 12 known kinds on create and on any kind edit. This also covers old APKs that keep the unguarded glyph lookup.
  • F7: owners edit or delete only community pins, which closes the seed-race residual from fix(security): untrusted kind lookups, root error boundary, opaque default handle, seed skips owned rows #19.
  • F1: flags.create binds the author link to the caller.
  • Owner edits obey the same aggregate bounds as reporters (from an automated review).

Staging A/B on a throwaway self-hosted app with the repo schema (fields relaxed to optional, links identical), using an extended copy of creek-watch perms_ab.py:

  • main's rules: 11 mismatches, exactly the scan findings (positive control);
  • this branch: GATE PASS 77/77;
  • an allow-all ruleset flips the 5 inverse-link probes to ALLOW, while main and this branch deny them (the forward row's rule is the one checked);
  • every run ended with leftovers=0.

Prod prerequisites (read-only):

  • prod rules == main (key order only), backed up before the push;
  • prod schema links flags.author and saves.user to profiles, so no phantom namespaces;
  • all 85 prod species and all 47,731 listings use one of the 12 kinds.

Reviews:

  • Oracle (spyglass-ba) @ d7eb4a7: MERGE, nits applied (comments).
  • Cross-model (gpt-6.1-sol): MERGE-AFTER-FIXES. (1) Inverse-link takeover: probed, denied under these rules, with a positive control. (2)/(3) Wording on aggregates and null exceptions: documented in the comments. (4) double() on numeric strings: pre-existing in the aggregate branch and not a range bypass; left as a residual.

🤖 Generated with Claude Code

jphein and others added 3 commits October 22, 2026 14:23
…ty pins, flags bind author

Server side of the 2026-10-22 security scan (advisory GHSA-72r8-ccwp-xcwq):
- F8/F9: listings.create requires source null/community, no sourceId/sourceSyncedAt, and
  report aggregates in createListing's range; owner edits freeze source/sourceId/sourceSyncedAt.
- F3–F6 server-side: kind must be one of the 12 known kinds on create and on any kind edit,
  which also protects old APKs that keep the unguarded glyph lookup.
- F7: owners may edit or delete only community pins, so a create racing the seed at a derived
  id can't change or delete the import before the seed's post-write unlink.
- F1: flags.create binds the author link to the caller (ownerOf("author")).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d's skip+unlink and the inverse-link A/B

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 23, 2026 02:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9a7a896c-6a08-40c5-a97e-03a6a5763d9a
📥 Commits

Reviewing files that changed from the base of the PR and between a04352e and d3ac9ea.

📒 Files selected for processing: 1
  • instant.perms.ts
+-------------------------+
| Please feed the models. |
+-------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jphein
jphein merged commit bf51faf into main Oct 23, 2026
1 of 2 checks passed
@jphein

jphein commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

Self-merged by vale (techempower lane) under JP's standing yes (2026-09-28). CI green; typecheck/lint clean; staging A/B GATE PASS 77/77, with main as the positive control (11 = the scan findings) and allow-all rules as the inverse-link control; gitleaks clean. Oracle (spyglass-ba): MERGE. Cross-model (gpt-6.1-sol): MERGE-AFTER-FIXES; each point probed or documented (see body). Prod perms push follows via realm-cloud bin/instant-dash, with prod rules backed up first.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants