Skip to main content

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')


Severity Medium
Score 6.5/10


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. Kubernetes affected versions include versions v1.12.9 prior to 1.12.10, 1.13.6 prior to 1.13.9, v1.14.2 prior to 1.14.5 and v1.15.x prior to 1.15.2. This is due to an incomplete fix in CVE-2019-1002101 and CVE-2019-11246

  • LOW
  • HIGH
  • NONE
  • NONE
  • NONE

CWE-22 - Path Traversal

Path traversal (or directory traversal), is a vulnerability that allows malicious users to traverse the server's root directory, gaining access to arbitrary files and folders such as application code & data, back-end credentials, and sensitive operating system files. In the worst-case scenario, an attacker could potentially execute arbitrary files on the server, resulting in a denial of service attack. Such an exploit may severely impact the integrity, confidentiality, and availability of an application.

Advisory Timeline

  • Published