The vulnerability described is an improper access control issue where Fleet's debug/pprof endpoints were accessible to any authenticated user, irrespective of their assigned role. The provided commit patch directly addresses this by modifying the authorization logic.
The analysis of the commit 5c030e32a3a9bc512355b5e1bf19636e4e6d0317 reveals that the change is located in the server/service/debug_handler.go file, specifically within the debugAuthenticationMiddleware.Middleware function. Before the patch, the check was !v.CanPerformActions(). This was not sufficient to prevent low-privilege users from accessing the endpoints. The patch introduces a more stringent check: !v.CanPerformActions() || v.User.GlobalRole == nil || *v.User.GlobalRole != fleet.RoleAdmin. This ensures that only users with the global 'admin' role can access these sensitive endpoints.
Therefore, the service.debugAuthenticationMiddleware.Middleware function is the exact location of the vulnerability. Any attempt to access the debug endpoints, whether successful or not, would involve the execution of this middleware. A runtime profiler would show this function in the call stack during an exploit attempt by a non-admin user.