Bug 2509253 (CVE-2026-18382) - CVE-2026-18382 project-koku/koku-metrics-operator: koku-metrics-operator: service-account client credentials sent to user-controlled token_url
Summary: CVE-2026-18382 project-koku/koku-metrics-operator: koku-metrics-operator: ser...
Keywords:
Status: NEW
Alias: CVE-2026-18382
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-07-30 11:46 UTC by OSIDB Bzimport
Modified: 2026-07-30 11:57 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-07-30 11:46:54 UTC
## Summary

The koku-metrics-operator CostManagementMetricsConfig CRD exposes `spec.authentication.token_url` as a writable field with no host validation. When `spec.authentication.type == service-account`, the operator POSTs `client_id` and `client_secret` (read from a user-referenced Secret) as form data to this user-supplied URL. The default is the Red Hat SSO endpoint, but a CR editor can override it to any URL.

## Impact

A principal with `create`/`update` permission on `costmanagementmetricsconfigs` can redirect the tenant's Red Hat SSO `client_id`/`client_secret` pair to an attacker endpoint. These credentials grant `api.console` scope on `console.redhat.com` for the customer organization.

## Affected Code

- `api/v1beta1/metricsconfig_types.go:117` — `token_url` field definition (no validation)
- `internal/controller/costmanagementmetricsconfig_controller.go:450` — `GetAccessToken(ctx, cr.Spec.Authentication.TokenURL)` call
- `internal/crhchttp/config.go:75-93` — POST to user-supplied `tokenURL`

## Remediation

Hard-code the Red Hat SSO token endpoint or enforce a suffix allow-list (`*.redhat.com`) in `GetAccessToken`. Reject non-HTTPS schemes:

```go
if !strings.HasSuffix(tokenURL, ".redhat.com") {
    return "", fmt.Errorf("token_url must be a *.redhat.com endpoint")
}
```


Note You need to log in before you can comment on or make changes to this bug.