The vulnerability, identified as GHSA-vwx9-7qcf-gg7f, is a cross-tenant Insecure Direct Object Reference (IDOR) in ShellHub. The root cause was a missing authorization check in several API endpoints that handle namespace management. When a request was authenticated using an API key, the system would not have a user ID (X-ID) in the request context. The code in multiple handlers incorrectly skipped membership and tenancy checks if the user ID was absent. This allowed an attacker, authenticated with an API key from their own tenant, to perform actions on any other tenant's namespace by simply knowing the victim's tenant UUID.
The analysis of the patch fe8e2bdf830a1cd765d5f73a13b09b4137db260e confirms this. The fix introduces a new middleware, RequiresTenant, which is applied to the affected routes. This middleware ensures that the tenant ID from the caller's authentication context matches the tenant ID specified in the API request path.
The following functions were identified as vulnerable because they were modified to include this new tenancy check, or had logic added to scope data to the caller's tenant:
routes.Handler.GetNamespace: The original reported vulnerability. It allowed unauthorized disclosure of a namespace's details, including member information.
routes.Handler.EditNamespace: Allowed unauthorized modification of a namespace.
routes.Handler.DeleteNamespace: Allowed unauthorized deletion of a namespace.
routes.Handler.EditSessionRecordStatus: Allowed unauthorized changes to the session recording setting of a namespace.
services.service.ListNamespaces (called by routes.Handler.GetNamespaceList): Allowed an API key user to enumerate all namespaces across the entire ShellHub instance, instead of just their own.
These functions would appear in a runtime profile or stack trace during the exploitation of this vulnerability. The fix involves enforcing strict tenant-based authorization at the routing layer for specific actions and modifying the service layer logic for list operations.