Security
Headlines
HeadlinesLatestCVEs

Headline

GHSA-jxgp-jgh3-8jc8: KubeOperator allows unauthorized access to system API

Summary

API interfaces with unauthorized access will leak sensitive information /api/v1/clusters/kubeconfig/<clusterName>

Details

Routes using v1 without any restrictions <img width="930" alt="image" src="https://user-images.githubusercontent.com/35884266/211258033-84aa14fb-01d5-459c-af81-e48b7552fabf.png">

Directly pass in downloadKubeconfig according to the cluster name

<img width="960" alt="image" src="https://user-images.githubusercontent.com/35884266/211258011-d885fda6-06c3-4603-be4a-38d9c9b918b4.png"> pkg/router/v1/white.go

no restrictions

func downloadKubeconfig(ctx context.Context) {
    clusterName := ctx.Params().GetString("name")
    ctx.Header("Content-Disposition", "attachment")
    ctx.Header("filename", fmt.Sprintf("%s-config", clusterName))
    ctx.Header("Content-Type", "application/download")
    clusterService := service.NewClusterService()
    str, err := clusterService.GetKubeconfig(clusterName)
    if err != nil {
        _, _ = ctx.JSON(err)
        ctx.StatusCode(http.StatusInternalServerError)
    }
    _, _ = ctx.WriteString(str)
}

<img width="872" alt="image" src="https://user-images.githubusercontent.com/35884266/211258106-79204452-b0b8-4d02-b774-1c2b61dd6bf2.png">

Impact

This is an unauthorized access to the kubeconfig vulnerability, which can be used to take over the cluster under certain conditions

ghsa
#vulnerability#js#git#auth

Summary

API interfaces with unauthorized access will leak sensitive information
/api/v1/clusters/kubeconfig/

Details

Routes using v1 without any restrictions

Directly pass in downloadKubeconfig according to the cluster name

pkg/router/v1/white.go

no restrictions

func downloadKubeconfig(ctx context.Context) { clusterName := ctx.Params().GetString(“name”) ctx.Header("Content-Disposition", “attachment”) ctx.Header("filename", fmt.Sprintf("%s-config", clusterName)) ctx.Header("Content-Type", “application/download”) clusterService := service.NewClusterService() str, err := clusterService.GetKubeconfig(clusterName) if err != nil { _, _ = ctx.JSON(err) ctx.StatusCode(http.StatusInternalServerError) } _, _ = ctx.WriteString(str) }

Impact

This is an unauthorized access to the kubeconfig vulnerability, which can be used to take over the cluster under certain conditions

References

  • GHSA-jxgp-jgh3-8jc8

Related news

CVE-2023-22480: Unauthorized access to system API

KubeOperator is an open source Kubernetes distribution focused on helping enterprises plan, deploy and operate production-level K8s clusters. In KubeOperator versions 3.16.3 and below, API interfaces with unauthorized entities and can leak sensitive information. This vulnerability could be used to take over the cluster under certain conditions. This issue has been patched in version 3.16.4.

ghsa: Latest News

GHSA-c873-wfhp-wx5m: SP1 has missing verifier checks and fiat-shamir observations