QID 980122

QID 980122: Go (go) Security Update for github.com/fluxcd/kustomize-controller (GHSA-35rf-v2jv-gfg7)

Users that can create Kubernetes Secrets, Service Accounts and Flux Kustomization objects, could execute commands inside the kustomize-controller container by embedding a shell script in a Kubernetes Secret. This can be used to run `kubectl` commands under the Service Account of kustomize-controller, thus allowing an authenticated Kubernetes user to gain cluster admin privileges.

Multitenant environments where non-admin users have permissions to create Flux Kustomization objects are affected by this issue.

  • CVSS V3 rated as Critical - 8.8 severity.
  • CVSS V2 rated as Critical - 9 severity.
  • Solution
    This vulnerability was fixed in kustomize-controller v0.15.0 (included in flux2 v0.18.0) released on 2021-10-08. Starting with v0.15, the kustomize-controller no longer executes shell commands on the container OS and the `kubectl` binary has been removed from the container image.Workaround:
    To prevent the creation of Kubernetes Service Accounts with `secrets` in namespaces owned by tenants, a Kubernetes validation webhook such as Gatekeeper OPA or Kyverno can be used.

    ```yaml
    apiVersion: kyverno.io/v1
    kind: ClusterPolicy
    metadata:
    name: restrict-sa
    spec:
    validationFailureAction: enforce
    background: false
    rules:
    - name: validate-sa
    match:
    resources:
    kinds:
    - ServiceAccount
    namespaces:
    - tenant1
    - tenant2
    subjects:
    - kind: User
    name: [email protected]
    - kind: User
    name: [email protected]
    - kind: ServiceAccount
    name: kustomize-controller
    namespace: flux-system
    - kind: ServiceAccount
    name: helm-controller
    namespace: flux-system
    validate:
    message: "Invalid service account"
    pattern:
    X(secrets): "*?"
    ```
    Vendor References

    CVEs related to QID 980122

    Software Advisories
    Advisory ID Software Component Link
    GHSA-35rf-v2jv-gfg7 github.com/fluxcd/kustomize-controller URL Logo github.com/advisories/GHSA-35rf-v2jv-gfg7
    © CVE.report 2026 |

    Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

    CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

    Free CVE JSON API cve.report/api

    CVE.report and Source URL Uptime Status status.cve.report