CVE-2025-64323: kgateway is missing xDS authorization
5.3
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/kgateway-dev/kgateway/v2 | go | >= 2.1.0-agw-cel-rbac, < 2.1.0 | 2.1.0 |
| github.com/kgateway-dev/kgateway/v2 | go | < 2.0.5 | 2.0.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability lies in the absence of an authentication mechanism on the xDS gRPC server in Kgateway. This allowed any client with network access to connect and retrieve sensitive configuration data. The analysis of the patches reveals that the fix involves adding a JWT-based authentication layer.
The core of the vulnerability is in how the xDS server was created and how it handled incoming requests. The function setup.NewControlPlane was responsible for setting up the gRPC server. In its vulnerable state, it did not configure any authentication interceptors, leaving the xDS services exposed.
Requests were handled by krtcollections.(*callbacks).OnStreamRequest, which processed the discovery requests. This function trusted client-provided metadata (the 'role' field) to identify the client, which is insecure. An attacker could simply set this field to impersonate a privileged client.
The patch introduces new authentication logic in internal/kgateway/setup/authn.go, including the KubeJWTAuthenticator and authenticationManager. The setup.NewControlPlane function was updated to use this new authentication mechanism via a gRPC stream interceptor. The (*callbacks).OnStreamRequest function was also modified to use the authenticated peer information from the context instead of relying on unverified client metadata.
Therefore, the vulnerable functions are the ones that previously created the insecure server and processed the unauthenticated requests. The newly added functions in authn.go are part of the mitigation.
Vulnerable functions
krtcollections.(*callbacks).OnStreamRequestinternal/kgateway/krtcollections/uniqueclients.go
setup.NewControlPlaneinternal/kgateway/setup/controlplane.go
setup.(*authenticationManager).authenticateinternal/kgateway/setup/authn.go
setup.(*KubeJWTAuthenticator).Authenticateinternal/kgateway/setup/authn.go