Skip to content
OpenAdvisories
Medium · 6.4 Public exploit CVE-2019-1002101 EUVD-2022-0775GHSA-34jx-wx69-9x8vGO-2022-0782

kubectl cp path traversal

Published Apr 1, 2019 · Updated Sep 16, 2024 · Assigned by dwf

Description

The kubectl cp command allows copying files between containers and the user machine. To copy files from a container, Kubernetes creates a tar inside the container, 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. The untar function can both create and follow symbolic links. The issue is resolved in kubectl v1.11.9, v1.12.7, v1.13.5, and v1.14.0.

Affected products

VendorProductAffectedFixed
Kubernetes Kubernetes 1.1-1.10, 1.11 – < 1.11.9, 1.12 – < 1.12.7, 1.13 – < 1.13.5 1.11.9

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Red Hat OpenShift 3 ansible-service-broker +2 1.1.20-1.el7 RHBA-2019:0619
Red Hat OpenShift 3 atomic-enterprise-service-catalog +1 1:3.10.127-1.git.55.b54f8c7.el7 RHBA-2019:0636, RHBA-2019:0620
Red Hat OpenShift 3 atomic-openshift +13 3.9.74-1.git.0.78e56ea.el7 RHBA-2019:0636, RHBA-2019:0620, RHBA-2019:0619
Red Hat OpenShift 3 atomic-openshift-cluster-autoscaler 3.11.98-1.git.0.3b82207.el7 RHBA-2019:0636
Red Hat OpenShift 3 atomic-openshift-descheduler 3.10.127-1.git.153.bc1eddd.el7 RHBA-2019:0636, RHBA-2019:0620
Red Hat OpenShift 3 atomic-openshift-dockerregistry 3.9.74-1.git.0.b102e93.el7 RHBA-2019:0636, RHBA-2019:0620, RHBA-2019:0619
Red Hat OpenShift 3 atomic-openshift-hyperkube +1 3.10.127-1.git.0.dab74c6.el7 RHBA-2019:0636, RHBA-2019:0620
Red Hat OpenShift 3 atomic-openshift-metrics-server 3.11.98-1.git.52.0623d01.el7 RHBA-2019:0636
Red Hat OpenShift 3 atomic-openshift-node-problem-detector 3.10.127-1.git.0.4f5519b.el7 RHBA-2019:0636, RHBA-2019:0620
Red Hat OpenShift 3 atomic-openshift-service-idler 3.11.98-1.git.14.1793066.el7 RHBA-2019:0636
Red Hat OpenShift 3 atomic-openshift-web-console 3.9.74-1.git.50.93129da.el7 RHBA-2019:0636, RHBA-2019:0620, RHBA-2019:0619
Red Hat OpenShift 3 cri-o 1.9.16-1.git78b2041.el7 RHBA-2019:0619
Red Hat OpenShift 3 golang-github-openshift-oauth-proxy 3.11.98-1.git.0.fd9716c.el7 RHBA-2019:0636
Red Hat OpenShift 3 openshift-ansible +4 3.9.74-1.git.0.70a0a63.el7 RHBA-2019:0636, RHBA-2019:0620, RHBA-2019:0619
Red Hat OpenShift 3 openshift-ansible-test 3.11.98-1.git.0.3cfa7c3.el7 RHBA-2019:0636
Red Hat OpenShift 3 openshift-enterprise-autoheal 3.11.98-1.git.0.6737a19.el7 RHBA-2019:0636
Red Hat OpenShift 3 openshift-enterprise-cluster-capacity 3.10.127-1.git.0.44580c6.el7 RHBA-2019:0636, RHBA-2019:0620
Red Hat OpenShift 3 prometheus +1 3.11.98-1.git.0.61907ad.el7 RHBA-2019:0636
Red Hat OpenShift 3 prometheus-alertmanager +1 3.11.98-1.git.92.7ebe477.el7 RHBA-2019:0636
Red Hat OpenShift 3 prometheus-node-exporter +1 3.9.74-1.git.0.2ab615c.el7 RHBA-2019:0636, RHBA-2019:0620, RHBA-2019:0619
Red Hat OpenShift 3 python-certifi +1 2018.4.16-2.el7 RHBA-2019:0636
Red Hat OpenShift 3 python-docker 2.4.2-2.el7 RHBA-2019:0636
Red Hat OpenShift 3 python-libcloud 2.2.1-20180102gitd701bf9.el7 RHBA-2019:0636, RHBA-2019:0620
Red Hat OpenShift 3 rubygem-fluent-plugin-viaq_data_model +1 0.0.18-1.el7 RHBA-2019:0636, RHBA-2019:0620
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed govulncheck-vulndb 0.0.20250807T150727-1.1 openSUSE-SU-2025:15424-1
openSUSE Tumbleweed k3s 1.21.3+k3s1-1.2 openSUSE-SU-2024:10884-1

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 7 kubeadm +2 1.12.7-1.1.2.el7 ELSA-2019-4593
Oracle Linux 7 kubeadm-ha-setup 0.0.2-1.0.24.el7 ELSA-2019-4593
Oracle Linux 7 kubeadm-upgrade 0.0.1-1.0.22.el7 ELSA-2019-4593
Oracle Linux 7 kubernetes-cni 0.6.0-2.2.1.el7 ELSA-2019-4593
Oracle Linux 7 kubernetes-cni-plugins 0.7.5-1.0.1.el7 ELSA-2019-4593

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
Go k8s.io/kubernetes < 1.11.9 1.11.9 GHSA-34jx-wx69-9x8v
Go k8s.io/kubernetes >= 1.12.0, < 1.12.7 1.12.7 GHSA-34jx-wx69-9x8v
Go k8s.io/kubernetes >= 1.13.0, < 1.13.5 1.13.5 GHSA-34jx-wx69-9x8v
Go k8s.io/kubernetes < 1.11.9 · >= 1.12.0, < 1.12.7 · >= 1.13.0, < 1.13.5 1.11.9, 1.12.7, 1.13.5 GO-2022-0782

Advisories 6

References