A critical security vulnerability has been identified in Kubernetes, tracked as CVE-2024-10220, which poses a significant risk to container orchestration environments. The vulnerability affects Kubernetes clusters using the in-tree gitRepo volume feature to clone repositories into subdirectories. The flaw allows attackers to execute arbitrary commands outside of container boundaries, making it possible to compromise the security of the affected clusters. With a high severity rating and a CVSS score of 8.1, this vulnerability presents a serious threat to Kubernetes deployments.
This vulnerability is present across multiple versions of Kubernetes, including kubelet v1.30.0 to v1.30.2, v1.29.0 to v1.29.6, and up to v1.28.11. The security issue arises when attackers with the ability to create pods and associate gitRepo volumes can execute malicious commands by exploiting the hooks folder in repositories. Such actions can result in the execution of arbitrary commands, allowing attackers to break out of containerized environments and gain unauthorized control of the underlying systems.
To mitigate the risks posed by CVE-2024-10220, Kubernetes administrators are strongly advised to upgrade to the fixed versions of Kubernetes: v1.31.0, v1.30.3, v1.29.7, or v1.28.12. Additionally, since the gitRepo volume has been deprecated, it is recommended to switch to an alternative method for Git cloning operations using an init container. This approach allows Kubernetes to perform Git cloning securely and mount the resulting directory into the container’s pod. Regular patching and proper access controls are essential to reducing the vulnerability’s impact.
The Kubernetes Security Response Committee has acted promptly by assigning a CVE and releasing fixes, reflecting the community’s commitment to maintaining the platform’s security and integrity. This discovery highlights the importance of continuous monitoring and adherence to security best practices in container orchestration. As Kubernetes remains a widely-used platform in both development and production environments, staying ahead of such vulnerabilities is critical to safeguarding applications and infrastructures against potential exploits.