You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Authorize resourceSubscriptions on subscriptions/listen #1307
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.
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.
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.
@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
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
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.
Activity
hackking007 commentedon Nov 3, 2026
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.
media-ctrl commentedon Nov 8, 2026
hackking007 commentedon Nov 8, 2026
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.
Restrict resource subscriptions
Restrict resource subscriptions
hackking007 commentedon Nov 14, 2026
@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):
Happy to adjust any of the above.
Restrict resource subscriptions
Kehrlann commentedon Nov 16, 2026
Hey @hackking007 .
This does not qualify for a CVE. The issue was only ever present in "milestone" builds (
2.2.0-M1and2.2.0-M2), never in a full-blown version. It was fixed for 2.2.0.