CVE-2019-11251: Symlink Attack in Kubernetes kubectl cp Command
Summary
CVE-2019-11251: Kubernetes kubectl cp Vulnerable to Symlink Attack. Affects k8s.io/kubernetes across 3 version ranges.
>= 1.13.10, < 1.13.11
>= 1.14.6, < 1.14.7
>= 1.15.3, < 1.16.0
Fixed in 1.13.11, 1.14.7 or 1.16.0, depending on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Kubernetes kubectl cp command is a tool used for copying files and directories between containers and the user's local filesystem. It is a part of the Kubernetes package and is implemented in Go. The kubectl cp command allows users to interact with containers and perform file operations. However, versions 1.1-1.12, and versions prior to 1.13.11, 1.14.7, and 1.15.4 are vulnerable to a symlink attack. This vulnerability allows an attacker to use a combination of two symlinks provided by the tar output of a malicious container to place a file outside of the destination directory specified in the kubectl cp invocation. By exploiting this vulnerability, an attacker can place a nefarious file outside of the intended destination tree.
Vulnerability Detail
The vulnerability arises from a flaw in the kubectl cp command's handling of symlinks. When a user invokes the kubectl cp command to copy files from a container, the command extracts the files using the tar utility. The tar output contains symlinks that point to files within the container. By manipulating the symlinks in the tar output, an attacker can trick the kubectl cp command into placing a file outside of the intended destination directory. This can lead to various malicious activities, such as overwriting critical files or executing arbitrary code.
How To Fix
Latest published version: v1.37.1 as of 23 Oct 2026
go get k8s.io/kubernetes@v1.37.1
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
>= 1.13.10, < 1.13.111.13.11go get k8s.io/kubernetes@v1.13.11 -
>= 1.14.6, < 1.14.71.14.7go get k8s.io/kubernetes@v1.14.7 -
>= 1.15.3, < 1.16.01.16.0go get k8s.io/kubernetes@v1.16.0
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, users can avoid using the kubectl cp command or restrict its usage to trusted containers and directories. Additionally, users can manually inspect the contents of the tar output before extracting files to ensure that no malicious symlinks are present. This can be done by using the 'tar -tvf' command to list the contents of the tar file and verifying the symlinks.
Conclusion
The symlink attack vulnerability in the Kubernetes kubectl cp command can be exploited by an attacker to place a file outside of the intended destination directory. To mitigate this vulnerability, it is crucial to update the Kubernetes package to versions 1.13.11, 1.14.7, or 1.15.4, or any subsequent versions that include the fix. Additionally, users can follow the provided workaround to minimize the risk of exploitation. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for k8s.io/kubernetes →
FAQ
This vulnerability allows an attacker to place a file outside of the intended destination directory specified in the kubectl cp command. This can lead to various malicious activities, such as overwriting critical files or executing arbitrary code.
Versions 1.1-1.12, and versions prior to 1.13.11, 1.14.7, and 1.15.4 are affected by this vulnerability.
To mitigate the risk of exploitation, it is recommended to update the Kubernetes package to versions 1.13.11, 1.14.7, or 1.15.4, or any subsequent versions that include the fix.
As a temporary workaround, users can avoid using the kubectl cp command or restrict its usage to trusted containers and directories. Additionally, users can manually inspect the contents of the tar output before extracting files to ensure that no malicious symlinks are present.
More information about this vulnerability can be found in the GitHub Advisory Database: [link to the advisory]
References
Related vulnerabilities
Recent vulnerabilities recorded for k8s.io/kubernetes.