Skip to content

Minio Operator uses Kubernetes apiserver audience for AssumeRoleWithWebIdentity STS

Moderate severity GitHub Reviewed Published Apr 21, 2025 in minio/operator • Updated Apr 21, 2025

Package

gomod github.com/minio/operator (Go)

Affected versions

< 7.1.0

Patched versions

7.1.0

Description

Prevent token leakage / privilege escalation

MinIO Operator STS: A Quick Overview

MinIO Operator STS is a native IAM Authentication for Kubernetes. MinIO Operator offers support for Secure Tokens (a.k.a. STS) which are a form of temporary access credentials for your MinIO Tenant. In essence, this allows you to control access to your MinIO tenant from your applications without having to explicitly create credentials for each application.

For an application to gain access into a MinIO Tenant, a PolicyBinding resource is required, granting explicit access to the applications by validating the kubernetes Service Account authorization token.

The service account token is validated as follows:

  1. The application calls AssumeRoleWithWebIdentity API MinIO Operator provides.
  2. MinIO Operator verifies the Service Account token agains the kubernetes API using the TokenReview API
  3. MinIO Operator reviews the TokenReviewResult confirms if the token is a valid token and the user is authenticated.
  4. MinIO Operator validates the service account has PolicyBinding in the Tenant namespace.
  5. MinIO Operator gets the PolicyBinding
  6. MinIO Operator calls the AssumeRole API in the MinIO Tenant
  7. MinIO Operator obtains temporary credentials (STS).
  8. MinIO Operator return temporary Credentials to the requester application.
  9. The applicaiton consumes Object Storage using the temporary credentials.

STS Diagram

Understanding Audiences in Kubernetes TokenReview

In step 2 the TokenReview API call attempts to authenticate a token to a known user, TokenReviewStatus is the result of the TokenReview request.

Audiences are audience identifiers chosen by the authenticator that are compatible with both the TokenReview and token.

An identifier is any identifier in the intersection of the TokenReviewSpec audiences and the token's audiences.

A client of the TokenReview API that sets the spec.audiences field should validate that a compatible audience identifier is returned in the status.audiences field to ensure that the TokenReview server is audience aware.
If no audiences are provided, the audience will default to the audience of the Kubernetes apiserver.

Solution: Properly Issuing and Using Audience-Specific ServiceAccount Tokens

This PR ensures the Operator STS service request the Service Account JWT to belong to the audiencests.min.io in the TokenReviewRequest.

This PR ensures the examples and documentation provided guides in how to create Service accounts with "disabled auto mount services tokens", by doing this the pods where the service account is used no longer mounts the service account automatically in the path /var/run/secrets/kubernetes.io/serviceaccount.

For illustrative purposes, here is how you disable auto mount of service account tokens at the service account level.

apiVersion: v1
kind: ServiceAccount
metadata:
  namespace: namespace-name
  name: service-account name
automountServiceAccountToken: false

Additionally documentation and examples show how to request an audience-specific token with audience sts.min.io, by asking for an ServiceAccount Token to be audience specific.

For illustrative purposes, here is how you request an audience specific service account token in a pod:

apiVersion: batch/v1
kind: Job
metadata:
  name: job-name
  namespace: job-namespace
spec:
  template:
    spec:
      serviceAccountName: service-account-name
      volumes:
        - name: sa-token
          projected:
            sources:
              - serviceAccountToken:
                  audience: "sts.min.io"
                  expirationSeconds: 86400
                  path: token
      containers:
        - name: mc
...
          volumeMounts:
            - name: sa-token
              mountPath: /var/run/secrets/sts.min.io/serviceaccount
              readOnly: true

How this prevent a token leakage or possible privilege escalation?.

This setup prevents privilege escalation and token leakage by combining multiple defense-in-depth mechanisms that ensure service account tokens are only usable by their intended audience, short-lived, and not exposed unnecessarily.

Audience restriction (aud: sts.min.io)

Problem: A ServiceAccount token is often valid for multiple audiences (e.g., the default Kubernetes API server). Without scoping, it can be replayed to other internal systems, which may unintentionally trust it.

Mitigation: Now we enforce that tokens are explicitly created for the sts.min.io audience using the Kubernetes TokenRequest API, and the MinIO Operator:

Sends audiences: ["sts.min.io"] in the TokenReview.

Verifies that the token was issued with this audience via status.audiences.

Effect: Even if a token is stolen or misused, it will fail validation if used outside the sts.min.io STS endpoint (e.g., reused at the API server or another service).

Token Leakage Mitigation

Disabling auto-mounted service account tokens

Problem: By default, Kubernetes mounts long-lived service account tokens into all pods at /var/run/secrets/kubernetes.io/serviceaccount, making them vulnerable to theft if the container is compromised.

Mitigation: No we guide users to set automountServiceAccountToken: false in their ServiceAccount definitions.

Effect: Prevents automatic token injection into all pods, reducing the attack surface.

Requesting short-lived, audience-specific tokens via serviceAccountToken projection

Problem: Long-lived tokens can be reused indefinitely if leaked.
Mitigation: You use projected service account tokens with:

  • audience: "sts.min.io"
  • A short expirationSeconds (e.g., 86400 = 24 hours, or even shorter)

Effect: Even if the token is leaked, it is:

  • Only usable for sts.min.io
  • Short-lived and expires soon
  • Revocable by disabling the SA or STS access

Affected Versions and Risk Assessment

The issue affects MinIO Operator versions v5.0.x and above, when the STS feature was first introduced.

  • In v5.0.x, STS was introduced as v1alpha1 and disabled by default. It required explicit API calls to be used.
  • In v6.0.x, STS graduated to v1beta1 and was enabled by default, but still requires explicit calls to the STS API for token usage.

The risk is minimal, as:

  • The Operator does not persist the token (neither in memory nor on disk).
  • The Operator only uses the token for a single validation and does not reuse it for any other purpose.

Release

Fix released in v7.1.0

References

@harshavardhana harshavardhana published to minio/operator Apr 21, 2025
Published to the GitHub Advisory Database Apr 21, 2025
Reviewed Apr 21, 2025
Last updated Apr 21, 2025

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v4 base metrics

Exploitability Metrics
Attack Vector Network
Attack Complexity Low
Attack Requirements None
Privileges Required None
User interaction None
Vulnerable System Impact Metrics
Confidentiality Low
Integrity None
Availability None
Subsequent System Impact Metrics
Confidentiality None
Integrity None
Availability None

CVSS v4 base metrics

Exploitability Metrics
Attack Vector: This metric reflects the context by which vulnerability exploitation is possible. This metric value (and consequently the resulting severity) will be larger the more remote (logically, and physically) an attacker can be in order to exploit the vulnerable system. The assumption is that the number of potential attackers for a vulnerability that could be exploited from across a network is larger than the number of potential attackers that could exploit a vulnerability requiring physical access to a device, and therefore warrants a greater severity.
Attack Complexity: This metric captures measurable actions that must be taken by the attacker to actively evade or circumvent existing built-in security-enhancing conditions in order to obtain a working exploit. These are conditions whose primary purpose is to increase security and/or increase exploit engineering complexity. A vulnerability exploitable without a target-specific variable has a lower complexity than a vulnerability that would require non-trivial customization. This metric is meant to capture security mechanisms utilized by the vulnerable system.
Attack Requirements: This metric captures the prerequisite deployment and execution conditions or variables of the vulnerable system that enable the attack. These differ from security-enhancing techniques/technologies (ref Attack Complexity) as the primary purpose of these conditions is not to explicitly mitigate attacks, but rather, emerge naturally as a consequence of the deployment and execution of the vulnerable system.
Privileges Required: This metric describes the level of privileges an attacker must possess prior to successfully exploiting the vulnerability. The method by which the attacker obtains privileged credentials prior to the attack (e.g., free trial accounts), is outside the scope of this metric. Generally, self-service provisioned accounts do not constitute a privilege requirement if the attacker can grant themselves privileges as part of the attack.
User interaction: This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable system. This metric determines whether the vulnerability can be exploited solely at the will of the attacker, or whether a separate user (or user-initiated process) must participate in some manner.
Vulnerable System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the VULNERABLE SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the VULNERABLE SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the VULNERABLE SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
Subsequent System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the SUBSEQUENT SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the SUBSEQUENT SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the SUBSEQUENT SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

EPSS score

Weaknesses

CVE ID

CVE-2025-32963

GHSA ID

GHSA-7m6v-q233-q9j9

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.