CVE-2026-18381: Project-koku/koku-metrics-operator: koku-metrics-operator: operator service-account token exfiltration via user-controlled prometheus service_address

Published Jul 30, 2026
·
Updated

Summary

The koku-metrics-operator CostManagementMetricsConfig CRD exposes spec.prometheusconfig.serviceaddress as a free-form string with no host validation. The operator reads its own Kubernetes service-account token from /var/run/secrets/kubernetes.io/serviceaccount/token and configures it as the BearerToken for PromQL queries sent to this user-supplied address. The service-account token carries the manager-role ClusterRole, which grants get on all Secrets cluster-wide.

Impact

A principal with create/update permission on costmanagementmetricsconfigs in the operator namespace can harvest the operator's Kubernetes service-account token by redirecting Prometheus queries to an attacker-controlled endpoint. This token grants read access to every named Secret in any namespace across the cluster.

Affected Code

- api/v1beta1/metricsconfigtypes.go:198 — serviceaddress field definition (no validation) - internal/collector/prometheus.go:95-117 — token read and client configuration - config/rbac/role.yaml:18-22 — ClusterRole grants secrets:get cluster-wide

Remediation

Restrict serviceaddress to in-cluster Prometheus/Thanos endpoints via CRD CEL validation:

yaml x-kubernetes-validations: - rule: "url(self.serviceaddress).getHostname().endsWith('.openshift-monitoring.svc') || url(self.serviceaddress).getHostname().endsWith('.openshift-monitoring.svc.cluster.local')" message: "serviceaddress must target the in-cluster monitoring service"

Or use a TokenRequest API call with audience bound to prometheus-k8s so the token is not replayable against kube-apiserver.

Other sources

A flaw was found in the koku-metrics-operator for Red Hat OpenShift. The operator's CostManagementMetricsConfig custom resource allows a user able to edit the CR to specify an arbitrary upload URL. The operator attaches its own Kubernetes service-account bearer token to queries sent to this user-controlled URL, allowing the attacker to obtain the token.

MITRE

Affected Software

3 affected components
koku-metrics-operator
Project-koku/koku-metrics-operator
redhat Cost Management Metrics Operator Openshift

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Add/enable CRD CEL validation so spec.prometheus_config.service_address is rejected unless url(self.service_address).getHostname().endsWith('.openshift-monitoring.svc') || url(self.service_address).getHostname().endsWith('.openshift-monitoring.svc.cluster.local').

    koku-metrics-operator CostManagementMetricsConfig CRD (spec.prometheus_config.service_address) x-kubernetes-validations (CEL) = service_address must target the in-cluster monitoring service

Event History

Jul 30, 2026
Data Sourced
via Red Hat·11:38 AM
DescriptionSeverityAffected Software
CVE Published
via MITRE·12:00 PM
Data Sourced
via MITRE·12:00 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·12:17 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-18381?

CVE-2026-18381 has a severity rating of 7.6, classified as high.

2

How do I fix CVE-2026-18381?

To mitigate CVE-2026-18381, ensure that the service_address field in the CostManagementMetricsConfig CRD is validated to prevent unauthorized access to the service-account token.

3

What type of vulnerability is CVE-2026-18381?

CVE-2026-18381 is classified as a Server-Side Request Forgery (SSRF) vulnerability.

4

What components are affected by CVE-2026-18381?

CVE-2026-18381 affects the koku-metrics-operator within the Project-koku/koku-metrics-operator software.

5

What is the risk level of CVE-2026-18381?

CVE-2026-18381 has a risk level of 47, indicating a significant potential impact if exploited.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203