A privilege escalation vulnerability exists in the KubeSphere CSR controller. Any CertificateSigningRequest with the label kubesphere.io/username is automatically approved by the controller without verifying the requesting identity or the binding between the label value and the CSR subject. An attacker who can create CSRs can obtain a valid client certificate signed by the Kubernetes cluster CA, authenticating as any user they specify.
Vendor: KubeSphere Product: KubeSphere Affected Versions: 4.0.0 through 4.1.3-rc.0 CVSS v3.1: AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H (9.0) Severity: Critical
File: pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go
The label kubesphere.io/username is defined at pkg/constants/constants.go:25 . The Approve function (lines 102-124) unconditionally sets the CSR status to Approved without any verification. After approval, UpdateKubeConfig (lines 126-138) writes the signed certificate and private key into the user's kubeconfig secret.
Endpoint: CSR controller (watches certificatesv1.CertificateSigningRequest ) File: pkg/controller/certificatesigningrequest/certificatesigningrequest_controller.go Functions: Reconcile (73), Approve (102) Label Trigger: kubesphere.io/username
Obtain Kubernetes API access with permissions to create CertificateSigningRequest objects
Generate an RSA key pair and CSR for a target privileged user (e.g., admin )
Create the CSR with kubesphere.io/username: admin label
The controller auto-approves it; the Kubernetes CA signs it
Use the signed certificate to authenticate as the target user
An attacker with CSR create permissions can obtain valid client certificates for any user, including platform administrators with cluster-admin access. This enables full cluster compromise and persistent access through valid client certificates that outlast short-lived tokens.
Verify the CSR's spec.username matches the label value
Only auto-approve CSRs created by the authorized KubeSphere kubeconfig controller
Implement signature-based verification or webhook-based approval instead of label-based unconditional approval
Restrict which signer names can be auto-approved
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
