Summary
MCPHub incorrectly authorizes group routes when a bearer key is allowed to access only one server within the group. An attacker holding such a legitimately issued key may access other servers in the same group that were outside the key's intended scope.
Affected context
The issue occurs in MCPHub deployments using bearer keys with an access type of "servers" or "custom" together with group routes. It becomes risky when a key is scoped to only some servers in a group and the group-level authorization decision is not followed by per-server scope checks.
Exploit preconditions
- Attack surface: MCPHub group-routed MCP server or API endpoints - Required access: A valid bearer key with accessType set to "servers" or "custom" - Trigger point: A request to a group route containing servers beyond the key's allowedServers scope - Why exploitation is possible: Authorization succeeds when any one server in the group matches the key, and the remaining servers are not re-checked after group-level access is granted
Why this happens
The authorization logic treats a partial overlap between a bearer key's allowedServers list and a group's servers as sufficient authorization for the entire group. This is an improper authorization design mapped to CWE-863: authorization checks do not consistently enforce the intended resource scope for every server reached through the authorized route.
Potential impact
- An attacker may access MCP servers that were not included in the bearer key's scope.
- Sensitive data exposed by neighboring servers could be disclosed.
- Unauthorized tools or APIs could be invoked through the shared group route.
- A compromised or overly scoped key could enable broader lateral access within MCPHub.
- Downstream systems may be modified if exposed servers permit write operations.
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the narrowest resource boundary. Group-level approval should not replace per-server scope checks, and access should be denied unless every requested server is covered by the key's explicit policy. Secure-by-default designs can require explicit authorization for each routed server, reduce trust in route-derived context, invalidate or narrowly scope bearer keys when permissions change, and apply least privilege to exposed MCP tools and backend credentials.
How teams detect issues like this
Detection can include static analysis and code review for authorization decisions that use any-match logic where all requested resources require authorization. Reviewers can trace whether resource scopes are re-evaluated after group, batch, or proxy authorization. Runtime policy enforcement should log key identity, requested group, resolved servers, and allowedServers, while monitoring for successful access to servers absent from the key scope. Automated security review tools may help identify missing object-level authorization checks and inconsistent scope enforcement.

