镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Authorize resourceSubscriptions on subscriptions/listen #1307

Description

@Kehrlann

Problem

On the modern server, subscriptions/listen accepts any URI in resourceSubscriptions. SubscriptionsFeature never checks that the caller is allowed to access it. Change events are server-wide, so on a multi-tenant server a client can subscribe to another principal's URI and receive notifications/resources/updated for it. Only timing and existence leak, not content.

Desired outcome

Server implementers have a hook to gate subscriptions per URI.

Example, non-normative implementation:

  • Add a canSubscribe(ctx, uri) hook to the resource repositories, defaulting to allow. subscriptions/listen drops every URI it denies.

Notes

  • Filtering by find isn't suitable: subscribing to a resource that doesn't exist yet is legitimate.
  • List-changed notifications have no payload and go to every listener. Document on McpChangeFeed that they aren't scoped per principal.

Credit

Reported by @hackking007

Activity

  1. added this to the 2.2.0-M2 milestone on Nov 2, 2026
  2. self-assigned this
    on Nov 2, 2026
  3. added
    P1Significant bug affecting many users, highly requested feature
    modernv3 covering the 2026-07-28 spec
    on Nov 2, 2026
  4. modified the milestones: 2.2.0-M2, 2.2.0-M3 on Nov 2, 2026
  5. hackking007 commented on Nov 3, 2026

    @hackking007

    Thanks Daniel - appreciate the fast triage and the credit on #1307. The canSubscribe(ctx, uri) hook is the right shape; happy to review the PR against the cross-session cases when it's up.

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

Metadata

Metadata

Assignees

Labels

P1Significant bug affecting many users, highly requested featurearea/servermodernv3 covering the 2026-07-28 spec

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions