kubectl cp命令允许复制容器和用户计算机之间的文件，在通过tar解压时存在缺陷，当用户主动运行kubectl cp命令从container上复制tar文件并解压时可能导致用户计算机上的文件或数据被覆盖或创建。
Incomplete fixes for CVE-2019-1002101, kubectl cp potential directory traversal - CVE-2019-11246
Hello Kubernetes Community,
Another security issue was discovered with the Kubernetes kubectl cp command that could enable a directory traversal such that a malicious container could replace or create files on a user’s workstation. The vulnerability is a client-side defect and requires user interaction to be exploited. The issue is High severity and upgrading kubectl to Kubernetes 1.12.9, 1.13.6, and 1.14.2 or later is encouraged to fix this issue.
Am I vulnerable? 如何知道是否有漏洞？
Run kubectl version --client and if it does not say client version 1.12.9, 1.13.6, or 1.14.2 or newer, you are running a vulnerable version.
How do I upgrade? 如何升级？
Follow installation instructions here https://kubernetes.io/docs/tasks/tools/install-kubectl/
Not all instructions will provide up-to-date kubectl versions at the time of this announcement. So, always confirm with kubectl version.
Vulnerability Details 漏洞详情
The details for this vulnerability are very similar to CVE-2019-1002101. The original fix for that issue was incomplete and a new exploit method was discovered.
The kubectl cp command allows copying 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 could use this to write files to any path on the user’s machine when kubectl cp is called, limited only by the system permissions of the local user.
See https://github.com/kubernetes/kubernetes/pull/76788 for details.
This issue was discovered by Charles Holmes, Atredis Partners as part of the CNCF-sponsored Kubernetes Third-party Security Audit. Thanks to Maciej Szulik for the fix, to Tim Allclair for the test cases and fix review, and to the patch release managers for including the fix in their releases.
Joel Smith on behalf of the Kubernetes Product Security Committee