Skip to content

[bug] Curator-chosen provider IDs reach cross-library merges through refresh jobs and refresh debt #2801

Closed

Description

@Quick104

What happened

A delegated metadata curator can still move an item onto an existing item in a library outside their scope, through work that runs without the curation check that #2777 adds to match, split, and merge.

The curation check travels on the request context. Two paths store curator-chosen provider IDs and then act on them later, outside that context:

  • PATCH /admin/items/{id}/metadata writes tmdb_id, imdb_id, and tvdb_id on the item (internal/catalog/item_repo.go, addString("tmdb_id", upd.TmdbID)). POST /admin/items/{id}/refresh-metadata then queues an item refresh job. The job runs on the runner's own context (internal/adminjob/runner.go, context.WithCancel(r.executionContext())), so it carries no curation authorizer. ModeManualRefresh seeds its provider IDs from those columns (internal/metadata/service.go, case ModeScheduledRefresh, ModeManualRefresh). reanchorContentID or canonicalizeLocalContentID then calls rebindItemOnto onto the item already at the derived content ID, wherever its libraries are.
  • After a split or merge, a refused follow-up (target identify, source refresh, or merge-target refresh) records a refresh failure and a refresh-debt attempt. The debt retry runs as automatic work with no authorizer, so it can perform the same rebind.

Both routes sit behind the same metadata-curation gate as match and split, so a curator who may not choose an out-of-scope destination through match/apply can still reach it this way.

Steps to reproduce

Established from source only; not reproduced on a deployment.

  1. As a curator scoped to library A, edit an in-scope item's tmdb_id to the TMDB ID of a movie that already exists only in library B.
  2. Request a metadata refresh for the edited item.
  3. When the refresh job runs and the provider confirms the ID, the item is merged onto the library B item: files, memberships, and user state move onto it.

Expected behavior

A curator-chosen identity reaches a cross-library merge only after the same library-policy decision that match/apply now applies. Possible directions, which need a maintainer decision:

  • authorize the derived destination when the curator writes provider IDs (PATCH, split targets), so the stored identity is already in scope;
  • persist the requesting actor's scope on item refresh jobs and refresh-debt rows and rebuild the authorizer when they run;
  • or keep automatic convergence unchecked by design and document that provider-ID edits are outside the curation boundary.

Silo version / commit

Source assessment at 94ec78f99 (head of #2777) and ed40fa20f (its base on main); both behave the same on these paths.

Deployment

Source review; no deployment used.

Clients affected

Web UI and any client that calls the admin catalog API as a delegated curator.

Relevant logs

No logs available.

Technical notes

The fix changes the authority plumbing that #2777 introduces (internal/access/metadata_curation.go, the item refresh job, refresh debt), so it should follow that PR.

AI disclosure

  • Harness: Claude Code in T3 Code, running the /silo review workflow.
  • Tools: Claude Code, Codex CLI, GitHub CLI.
  • Models: claude-opus-5-5 (review and this report); gpt-6.1-sol (independent read-only review that raised the same path).
  • Involvement: AI source assessment. No live reproduction.

Confirmations

  • Searched open and closed issues and pull requests.
  • Reproduced on a real deployment.

Source: found in review of #2777

Activity

  1. added
    bug
    on Oct 20, 2026
  2. added
    impact: security
    needs-review
    priority: P0
    on Oct 20, 2026
  3. added a commit that references this issue on Nov 14, 2026
    9d15395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugimpact: securityneeds-reviewpriority: P0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions