The vulnerability lies in the excessive logging of CNI configuration data by the Calico CNI plugin. The analysis of the provided patches confirms that sensitive information was being written to log files. The patches consistently remove logging statements that output the entire configuration object, which could contain plaintext credentials.
The primary vulnerable functions identified are MutateConfigAdd and MutateConfigDel in cni-plugin/internal/pkg/azure/azure.go, which are part of the Azure IPAM helper. These functions were logging the complete stdinData on every CNI ADD and DEL operation. Additionally, the writeCNIConfig function in cni-plugin/pkg/install/install.go was logging the configuration content in case of a JSON validation error and also after writing the configuration file. An attacker with read access to the log file /var/log/calico/cni/cni.log on a node could extract Kubernetes ServiceAccount tokens and other credentials, leading to privilege escalation within the cluster.