A critical vulnerability has been discovered in Kubernetes that allows remote attackers to execute commands with SYSTEM privileges on Windows nodes within a cluster. Tracked as CVE-2024-9042, this flaw stems from a command-injection bug in the 'Log Query' beta feature. This vulnerability affects Kubernetes versions prior to 1.32.1 when this beta feature is enabled. Exploitation is possible through a specifically crafted command injected via a parameter in a query to a node.
According to Akamai researcher Tomer Peled, who discovered the flaw, the 'Log Query' mechanism does not properly validate and sanitize the parameter, allowing attackers to execute arbitrary code. The vulnerability only impacts clusters using Windows nodes with the beta logging feature turned on. The Kubernetes project has issued a security advisory with instructions on how to update, advising administrators to check cluster audit logs for suspicious inputs. While the number of deployments with this specific configuration is thought to be low, it highlights the importance of rigorous security testing for new features.