fix(official): require verified ownership for newly allowlisted official org handles#2481
fix(official): require verified ownership for newly allowlisted official org handles#2481BunsDev wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex review: found issues before merge. Reviewed June 24, 2026, 9:25 PM ET / 01:25 UTC. Summary Reproducibility: not applicable. as a user issue reproduction path because this is a PR review. The blockers are source-reproducible from the PR head diff, current main policy/spec, and live dirty merge state. Review metrics: 3 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Preserve current main's exact-row Do we have a high-confidence way to reproduce the issue? Not applicable as a user issue reproduction path because this is a PR review. The blockers are source-reproducible from the PR head diff, current main policy/spec, and live dirty merge state. Is this the best way to solve the issue? No. Current main's exact-row Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3ef5f14d84a7. Label changesLabel justifications:
Evidence reviewedSecurity concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
Pull request overview
This PR hardens how ClawHub derives the official publisher flag by ensuring newly-allowlisted official org handles can’t become Official solely by claiming a mutable handle; instead they must be tied to an active reserved-handle record and verified ownership.
Changes:
- Split official org handles into legacy vs reserved-owner-verified lists and require reservation + rightful-owner org ownership for reserved-owner-verified handles.
- Block self-serve org creation for reserved-owner-verified official handles unless the actor holds the active reservation.
- Expose a
DbCtx-friendlygetLatestActiveReservedHandlehelper and add/adjust regression tests + spec wording.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/official-publishers.md | Updates the policy spec to distinguish legacy official orgs vs reservation/ownership-verified official orgs. |
| convex/publishers.ts | Blocks self-serve creation of reserved-owner-verified official org handles unless reserved for the actor. |
| convex/publishers.test.ts | Adds regression tests for reserved-owner-verified handle creation behavior. |
| convex/lib/reservedHandles.ts | Adds a DbCtx-compatible helper for fetching the latest active reservation. |
| convex/lib/officialPublishers.ts | Enforces reservation + rightful-owner ownership checks for reserved-owner-verified official org handles and personal derivation. |
| convex/lib/officialPublishers.test.ts | Adds org-level tests for reserved-owner verification logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ).resolves.toBe(false); | ||
| }); | ||
|
|
||
| it("treats personal publishers for openclaw org members as official", async () => { |
There was a problem hiding this comment.
Added in commit $(git -C /tmp/workspace/openclaw/clawhub rev-parse --short HEAD): two new tests cover the personal-publisher membership path for nvidia:
- "does not treat personal publisher of unreserved nvidia org member as official" — member of an org that has no
reservedHandlesrecord resolves tofalse. - "treats personal publisher of reserved-owner-controlled nvidia org member as official" — member of an org whose
rightfulOwnerUserIdholds the"owner"role resolves totrue.
There was a problem hiding this comment.
Added in commit cb53d4ab: two new tests cover the personal-publisher membership path for nvidia:
- "does not treat personal publisher of unreserved nvidia org member as official" — member of an org with no
reservedHandlesrecord resolves tofalse. - "treats personal publisher of reserved-owner-controlled nvidia org member as official" — member of an org whose
rightfulOwnerUserIdholds the"owner"role resolves totrue.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| @@ -0,0 +1,11154 @@ | |||
| { | |||
Previously only 'plugins' and 'skills' were protected. Any user could register @admin, @settings, @dashboard, @search, etc. as a publisher handle, shadowing those platform routes via the $owner catch-all. Add all current top-level src/routes/ segments to RESERVED_PUBLIC_OWNER_HANDLES, grouped by purpose: - Content browsing: skills, souls, plugins, packages, publishers, orgs - Profile shortlinks: p, u - User flows: search, import, upload, publish-skill, publish-plugin, stars, dashboard, settings - Admin/internal: admin, management, audits - Informational: docs, cli - Auth/account: user, users Also add a doc comment noting to update this set when new top-level routes are added.
Summary
isReservedOwnerVerifiedOfficialOrgHandleandisOfficialOrgPublisherand consulting them fromisOfficialPublisherinconvex/lib/officialPublishers.ts. Blocked self-serve org creation for reserved-owner-verified official handles increateOrgPublisherForUserunless the handle is already reserved for the actor. Exposed aDbCtx-friendlygetLatestActiveReservedHandlehelper inconvex/lib/reservedHandles.ts. Added regression tests inconvex/lib/officialPublishers.test.tscovering org-level and personal-publisher membership cases fornvidia, and added a spec update inspecs/official-publishers.md.nvidia) made Official status rely solely on the mutable publisher handle, which allowed handle-squatting and unauthorized Official package publishing. The change binds Official status to a verified owner/reservation so unclaimed or attacker-created orgs cannot acquire Official privileges by registering the handle.Linked Issue
Screenshots
N/ABehavioural Proof
Require an active
reservedHandlesrecord whoserightfulOwnerUserIdowns the org before treating a newly allowlisted handle (e.g.nvidia) as Official, both for org publishers and for personal publishers deriving Official status via org membership.Block self-serve org creation for reserved-owner-verified official handles unless the actor is the rightful owner.
Regression tests confirm: unreserved
nvidiaorg → not official; reserved+rightful-owner-ownednvidiaorg → official; personal publisher member of unreservednvidiaorg → not official; personal publisher member of reserved+rightful-owner-ownednvidiaorg → official.Behavioural proof included, or
N/ASecurity / Trust Impact
Prevents handle-squatting on newly allowlisted official handles (e.g.
nvidia). Official status for these handles is now gated on an admin-createdreservedHandlesrecord binding the handle to a specificrightfulOwnerUserId, and self-serve org creation for those handles is blocked for non-rightful-owners.Data / Deploy Impact
Verification
bun run ci:staticbunx vitest run convex/lib/officialPublishers.test.ts convex/publishers.test.ts --reporter verbose— all passedbun run ci:unitorN/Afor docs/config-only:bun run ci:unitpassedci:types-build,ci:packages,ci:e2e-http,ci:playwright-smoke,test:pw:local-auth,proof:ui):bun run ci:types-buildpassedbun run format:check && bun run lintpassed;bun run ci:staticandbun run deadcode:cicould not fully run in this environment due tobun auditandknip/registry access issues (environment/tooling limits, not regressions)