Deep dive on the most severe Kubernetes vulnerabilities – CVE-2017-1002101/2
Kubernetes did not validate the subPath attribute in volume mounts, allowing a container to access files outside the volume, including the host filesystem. A second flaw allowed containers using certain volume types to trigger deletion of arbitrary host files.
twistlock.com
Published on twistlock.com
Two vulnerabilities were reported and fixed in Kubernetes two weeks ago. The GitHub issues discussing the vulnerabilities and fixes were vague, so in this post I will review the bugs in additional detail and suggest remediation methods.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
The bug breaks container isolation and allows access to the host filesystem, and the second bug allows deletion of arbitrary host files; managed Kubernetes services like Azure AKS remained vulnerable at the time of writing.
What the attacker needed
Ability to create pods with volumes; Kubernetes cluster with vulnerable version
The fix
The vulnerabilities were fixed in Kubernetes; upgrading is the strongest remedy, and if upgrading is not possible, volumes should be disabled via PodSecurityPolicy.
How it was found
- Create a pod with a hostPath volume mounted at /vol.
- From inside the container, create a symlink at /vol/sym pointing to /etc.
- Create a second pod with the same volume and set subPath to sym.
- The second container mounts the host's /etc as /vol, exposing host files.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Kubernetes runs containers, which are like lightweight virtual machines. A volume is a folder shared between the container and the host. The bug let a container trick Kubernetes into sharing a sensitive host folder, like /etc, which holds system configuration. An attacker with permission to create pods could read or delete host files.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.