Kubernetes Flaws Could Lead to Remote Code Execution on Windows Endpoints

Cyber Security Threat Summary:
Akamai researchers recently discovered a high-severity vulnerability in Kubernetes tracked as CVE-2023-3676 (CVSS 8.8). This identification of this issue led to the discovery of two more vulnerabilities tracked as CVE-2023-3893, and CVE-2023-3955 (CVSS 8.8). All three vulnerabilities were caused by insecure function call and the lack of user input sanitization” (Security Affairs, 2023).

Using the vulnerability, a threat actor can carry out remote code execution with SYSTEM privileges on all Windows endpoints within a Kubernetes cluster. The exploit can be triggered by applying a malicious YAML file on the cluster.

The vulnerability impacts default installations of Kubernetes and was tested against both on-prem deployments and Azure Kubernetes Service.

Security Officer Comments:
The researchers found the presence of “exec[.]Command” combined with unsanitized user-supplied input strongly hints at a command injection opportunity. Because PowerShell allows users to evaluate values inside strings before they are used, any PowerShell command can be inserted between the parentheses and will be evaluated, including $(Start-Process cmd), $(Invoke-Expression exp), and other PowerShell treats.

“An attacker can abuse the subPath subproperty in a YAML file to gain access to privileged data outside of the container. The subPath evaluation can be abused to reach the vulnerable code and execute arbitrary command with SYSTEM privileges (kubelet’s own context) from remote nodes, and gain control over all Windows nodes in the cluster” (Akamai, 2023).

Suggested Correction(s):
“CVE-2023-3676 requires low privileges and, therefore, sets a low bar for attackers: All they need to have is access to a node and apply privileges. Successful exploitation of this vulnerability will lead to remote code execution on any Windows node on the machine with SYSTEM privileges.” reads the advisory published by Akamai. “High impact coupled with ease of exploitation usually means that there is a higher chance of seeing this attack (and similar attacks) on organizations.

Akamai provided a proof-of-concept YAML file as well as an OPA rule for blocking this vulnerability.

Below is the disclosure timeline:

  • 07/13/2023 — Vulnerability disclosed to Kubernetes team.
  • 07/19/2023 — CVEs assigned by Kubernetes team
  • 08/23/2023 — Kubernetes released the CVE fixes
  • 09/13/2023 — blog post published
Link(s):
https://www.akamai.com/blog/security-research/kubernetes-critical-vulnerability-command-injection
https://securityaffairs.com/150807/hacking/kubernetes-flaws-rce.html