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
    P1
    modern
    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.

  6. media-ctrl commented on Nov 8, 2026

    @media-ctrl
  7. hackking007 commented on Nov 8, 2026

    @hackking007

    Agree with all three, and the non-enumerable denial path is the important one - it closes the exact residual the issue calls out ("only timing and existence leak"). If denied and not-yet-existing return the same shape and comparable timing, there's no oracle left to work with.

    One addition for the enforcement-point discussion: canSubscribe(ctx, uri) gates entry, but a subscription that was legitimately allowed can later become unauthorized while it's still live - a resource re-homed to another tenant, or an ACL change on an existing URI. If the only check is at subscribe time, the listener keeps receiving notifications/resources/updated after it should have lost access. So the single enforcement point media-ctrl describes should ideally be reachable from the dispatch path as well (re-check, or invalidate affected subscriptions on ACL/ownership change), not only from the subscribe path. Otherwise the hook is correct but revocation is a second, quieter version of the same cross-principal leak.

    Happy to review the PR against both the subscribe-time and dispatch-time cross-session cases when it's up.

  8. added 2 commits that reference this issue on Nov 13, 2026
    1a9e15f
    4d32435
  9. hackking007 commented on Nov 14, 2026

    @hackking007

    @Kehrlann - thanks for the quick, well-designed fix in 2.2.0 (the restrict() single-enforcement-point, fail-closed on error, narrow-only intersection - all exactly right; I verified the behavior against the 2.2.0 tag).

    Since #1307 was a multi-tenant authorization gap (subscriptions/listen honoured resourceSubscriptions for URIs the caller wasn't authorized to, leaking cross-principal resource existence, change timing, and change notifications), would you consider publishing a GitHub Security Advisory for it and requesting a CVE via GitHub? The fix is already shipped (66a7f61, released 2.2.0), so it would be a coordinated, post-fix advisory.

    Suggested metadata (final call is yours):

    • Weakness: CWE-862 Missing Authorization (authorization not enforced on the subscribe path)
    • Affected: modern (v3) server, subscriptions/listen - versions prior to 2.2.0
    • Fixed in: 2.2.0 (commit 66a7f61)
    • Suggested CVSS 3.1: AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:N/A:N (≈5.0, Medium) - cross-tenant information disclosure (resource existence + change notifications) reachable by an authenticated client
    • Credit: hackking007 - Levinity Engine (Moshe Levi)

    Happy to adjust any of the above.

  10. added a commit that references this issue on Nov 15, 2026
    66a7f61
  11. Kehrlann commented on Nov 16, 2026

    @Kehrlann
    ContributorAuthor

    Hey @hackking007 .

    This does not qualify for a CVE. The issue was only ever present in "milestone" builds (2.2.0-M1 and 2.2.0-M2), never in a full-blown version. It was fixed for 2.2.0.

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

Metadata

Metadata

Assignees

Labels

P1area/servermodern

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions