CVE-2024-58269: Rancher exposes sensitive information through audit logs
4.3
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/rancher/rancher | go | < 0.0.0-20251013203444-50dc516a19ea | 0.0.0-20251013203444-50dc516a19ea |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability is caused by insufficient redaction of sensitive data in Rancher's audit logs. The analysis of the provided patches reveals three key areas where the logging mechanism failed:
-
Incomplete Annotation Redaction: The audit policy for redacting the
kubectl.kubernetes.io/last-applied-configurationannotation was not recursive. TheDefaultPoliciesfunction inpkg/auth/audit/default.gowas updated to use a recursive JSON path ($..), fixing the issue where sensitive values within this annotation were logged if they were nested inside other objects. -
Incorrect Secret Redaction: The
redactSecretfunction inpkg/auth/audit/redact.gowas mistakenly redacting data from the request body instead of the response body. This meant that any API response containing Kubernetes secret data was logged in cleartext. -
Insufficient Import URL Redaction: The
redactImportUrlfunction inpkg/auth/audit/redact.goonly checked the request URI for sensitive import URLs. It failed to check other parts of the request, such as theRefererheader. An attacker with access to the logs could extract non-expiring cluster registration tokens from these headers.
The identified functions are directly responsible for these failures. During runtime, these functions would be invoked as part of the audit logging pipeline. An attacker triggering the vulnerability would cause these functions to process requests or responses containing sensitive data, which, prior to the patch, would be written to the audit logs without proper redaction. Therefore, these functions are the primary indicators of the vulnerability being triggered.
Vulnerable functions
github.com/rancher/rancher/pkg/auth/audit.DefaultPoliciespkg/auth/audit/default.go
github.com/rancher/rancher/pkg/auth/audit.redactSecretpkg/auth/audit/redact.go
github.com/rancher/rancher/pkg/auth/audit.redactImportUrlpkg/auth/audit/redact.go