6.4medium
kubectl cp path traversal
- Severity
- 6.4medium CVSS:3.0 by dwf
- Exploit likelihood
- 12.8% (higher than 96% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- dwf
- Also known as
- GHSA-34jx-wx69-9x8vGO-2022-0782
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
| Product or package | Versions | Reported by |
|---|---|---|
| Kubernetes Kubernetes | 1.1-1.10, from 1.11 before 1.11.9, from 1.12 before 1.12.7, from 1.13 before 1.13.5, from 1.11.0 before 1.11.9, from 1.12.0 before 1.12.7, from 1.13.0 before 1.13.5, 1.14.0 | CVE List, NVD |
| k8s.io/kubernetes (Go) | before 1.11.9, from 1.12.0 before 1.12.7, from 1.13.0 before 1.13.5 | GitHub Advisory Database, Go Vulnerability Database |
| redhat openshift_container_platform | 3.9, 3.10, 3.11 | NVD |
All scores
| dwf | 6.4medium CVSS:3.0 | CVSS:3.0/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 5.5medium CVSS:3.0 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| NVD | 5.5medium CVSS:3.0 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| NVD | 5.8medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:P |
Classification
What each source says
CVE List
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.
Go Vulnerability Database
Symlink Attack in kubectl cp in k8s.io/kubernetes
NVD (es)
El comando kubectl cp permite copiar archivos entre contenedores y la máquina del usuario. Para copiar archivos de un contenedor, Kubernetes crea un alquitrán dentro del contenedor, lo copia a través de la red y kubectl lo descomprime en la máquina del usuario. Si el binario tar en el contenedor es malicioso, podría ejecutar cualquier código y generar resultados inesperados y maliciosos. Un atacante podría usar esto para escribir archivos en cualquier ruta en la máquina del usuario cuando se llama a kubectl cp, limitado solo por los permisos del sistema del usuario local. La función untar puede crear y seguir enlaces simbólicos. El problema se resuelve en kubectl v1.11.9, v1.12.7, v1.13.5 y v1.14.0.
References
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2019-1002101 changed 2024-09-16 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-34jx-wx69-9x8v changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2022-0782 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2019-1002101 changed 2026-06-17 | Public domain |