Windows kubectl cp arbitrary-path write fixed
mediumWhen an attacker controls the source container, malicious archive paths could escape the intended destination and write files anywhere allowed by the local user's system permissions. After the upgrade, those paths can no longer escape the destination.
Show release-note lines
A path traversal vulnerability exists in the `kubectl cp` command when it is run on Windows. `kubectl cp` copies files between containers and the user machine. To copy files *from* a container, Kubernetes runs `tar` inside the container to create a tar archive, copies it over the network, and `kubectl` unpacks it on the user's machine. If the `tar` binary in the container is malicious, it could run any code and output unexpected, malicious results. An attacker who controls the contents of a container could use this to write files to arbitrary paths on the user's machine when `kubectl cp` is called, limited only by the system permissions of the local user. This issue only affects clients on Windows platforms. You are affected if you run the `kubectl` client on Windows and use `kubectl cp` to copy files *from* a container whose contents you do not fully control. Prior to upgrading, this vulnerability can be mitigated by only copying files from containers you trust, or by avoiding `kubectl cp` from untrusted containers on Windows.github.com/kubernetes/kubernetes/issues/141294
kubectl cp path traversal on Windows allows arbitrary file writesgithub.com/kubernetes/kubernetes/issues/141294