RustSeverity: MediumStatus: Fixed

AuthMiddleware scope check fails open when a verified token has no scope claim

AuthMiddleware enforced required_scopes only when a verified token carried a scope claim. A token with no scope claim skipped that check and the request continued. This applies to an HTTP server that sets required_scopes, and only to a caller who already holds a valid token from the same authorization server. Reported in public issue #301 by ucsurf; fixed by Ali Hashemi in PR #304 (be55243), released in rust-mcp-sdk 2.1.0. Ali Hashemi (hashemix) closed the issue as completed on 2026-11-29 via release pull request 303.

The issue

AuthMiddleware in rust-mcp-sdk enforced required_scopes only when a verified token carried a scope claim. When that claim was absent, the check was skipped and the request continued. The server’s auth provider contract says a request must be rejected when a required scope is missing.

This applies to HTTP servers that set required_scopes. It matters for a caller who already holds a valid token from the same authorization server. The reviewed tree was rust-mcp-sdk 2.0.1.

The fix

Reported in public issue 301 by ucsurf. Ali Hashemi (hashemix) fixed it in pull request 304, merged as be55243 on 2026-11-29. A verified token with no scope claim is now treated as having no scopes, and a server with required scopes answers 403.

The fix is in rust-mcp-sdk 2.1.0, tagged rust-mcp-sdk-v2.1.0. hashemix closed issue 301 as completed on 2026-11-29 through release pull request 303.

Timeline

  1. Found
  2. Reported via public issue
  3. Disclosed publicly
  4. Entry last updated

Machine-readable: JSON · Markdown · ID security/rust/rust-mcp-stack__rust-mcp-sdk/2026-11-29-auth-middleware-scope-check-fails-open

If this work is useful to you, you can support it on Buy Me a Coffee.