# CVE-2019-1002101: kubectl cp path traversal

> A malicious tar binary in a container can exploit kubectl cp to write files to arbitrary paths on the user's machine, potentially executing code.

- **Severity:** Medium 6.4 (`CVSS:3.0/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 1 Apr 2019
- **Updated:** 16 Sep 2024
- **Also known as:** GHSA-34jx-wx69-9x8v, GO-2022-0782, RHBA-2019:0619, RHBA-2019:0620, RHBA-2019:0636

## What is CVE-2019-1002101?

CVE-2019-1002101 is a medium-severity path traversal vulnerability in Kubernetes Kubernetes, published on 1 Apr 2019. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-59 (Improper Link Resolution Before File Access)

## Which versions are affected by CVE-2019-1002101?

7 open source packages ship an affected version, including k8s.io/kubernetes. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `k8s.io/kubernetes` | Go | All versions | 1.11.9, 1.12.7, 1.13.5 |
| `k8s.io/kubernetes` | Go | All versions | 1.11.9 |
| `k8s.io/kubernetes` | Go | All versions | 1.11.9 |
| `k8s.io/kubernetes` | Go | From 1.12.0 | 1.12.7 |
| `k8s.io/kubernetes` | Go | From 1.12.0 | 1.12.7 |
| `k8s.io/kubernetes` | Go | From 1.13.0 | 1.13.5 |
| `k8s.io/kubernetes` | Go | From 1.13.0 | 1.13.5 |
| `atomic-enterprise-service-catalog` | Red Hat:openshift:3.10::el7 | All versions | 1:3.10.127-1.git.55.b54f8c7.el7 |
| `atomic-enterprise-service-catalog-svcat` | Red Hat:openshift:3.10::el7 | All versions | 1:3.10.127-1.git.55.b54f8c7.el7 |
| `atomic-openshift` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-clients` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-clients-redistributable` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-descheduler` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.153.bc1eddd.el7 |
| `atomic-openshift-docker-excluder` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-dockerregistry` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.f8aa6dd.el7 |
| `atomic-openshift-excluder` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-hyperkube` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-hypershift` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-master` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-node` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-node-problem-detector` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.4f5519b.el7 |
| `atomic-openshift-pod` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-sdn-ovs` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-template-service-broker` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-tests` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.dab74c6.el7 |
| `atomic-openshift-web-console` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.50.eab7949.el7 |
| `golang-github-prometheus-node_exporter` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.8ebe819.el7 |
| `openshift-ansible` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.131da09.el7 |
| `openshift-ansible-docs` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.131da09.el7 |
| `openshift-ansible-playbooks` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.131da09.el7 |
| `openshift-ansible-roles` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.131da09.el7 |
| `openshift-enterprise-cluster-capacity` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.44580c6.el7 |
| `prometheus-node-exporter` | Red Hat:openshift:3.10::el7 | All versions | 0:3.10.127-1.git.0.8ebe819.el7 |
| `python-libcloud` | Red Hat:openshift:3.10::el7 | All versions | 0:2.2.1-20180102gitd701bf9.el7 |
| `rubygem-fluent-plugin-viaq_data_model` | Red Hat:openshift:3.10::el7 | All versions | 0:0.0.18-1.el7 |
| `rubygem-fluent-plugin-viaq_data_model-doc` | Red Hat:openshift:3.10::el7 | All versions | 0:0.0.18-1.el7 |
| `atomic-enterprise-service-catalog` | Red Hat:openshift:3.11::el7 | All versions | 1:3.11.98-1.git.0.a7877b0.el7 |
| `atomic-enterprise-service-catalog-svcat` | Red Hat:openshift:3.11::el7 | All versions | 1:3.11.98-1.git.0.a7877b0.el7 |
| `atomic-openshift` | Red Hat:openshift:3.11::el7 | All versions | 0:3.11.98-1.git.0.0cbaff3.el7 |
| `atomic-openshift-clients` | Red Hat:openshift:3.11::el7 | All versions | 0:3.11.98-1.git.0.0cbaff3.el7 |

Products: Kubernetes Kubernetes, Redhat Openshift Container Platform.

## How do I fix CVE-2019-1002101?

Upgrade k8s.io/kubernetes to a fixed version for your release line: 1.11.9, 1.12.7 or 1.13.5.

## Is CVE-2019-1002101 being exploited?

There is no known exploitation of CVE-2019-1002101 in the wild and no public exploit code.

Public exploit code:

- PoC helper scripts and Dockerfile for CVE-2019-1002101 (github_poc): https://github.com/brompwnie/CVE-2019-1002101-Helpers

## Other vulnerabilities in Kubernetes Kubernetes

- [CVE-2018-1002105](https://insights.sbomify.com/CVE-2018-1002105/): Privilege Escalation in Kubernetes (critical 9.8)
- [CVE-2017-1000056](https://insights.sbomify.com/CVE-2017-1000056/): Kubernetes Privilege Escalation (critical 9.8)
- [CVE-2016-1906](https://insights.sbomify.com/CVE-2016-1906/): Authorization bypass in Openshift (critical 9.8)
- [CVE-2023-3676](https://insights.sbomify.com/CVE-2023-3676/): Kubernetes - Windows nodes - Insufficient input sanitization leads to privilege escalation (high 8.8)
- [CVE-2023-3955](https://insights.sbomify.com/CVE-2023-3955/): Kubernetes - Windows nodes - Insufficient input sanitization leads to privilege escalation (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2019-1002101 and fix it if it is affected.

What it is: CVE-2019-1002101 is a medium-severity path traversal vulnerability in Kubernetes Kubernetes, published on 1 Apr 2019. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2019-1002101 in the wild and no public exploit code.

Affected packages and fixed versions:
- k8s.io/kubernetes (Go): affected all versions; fixed in 1.11.9, 1.12.7, 1.13.5
- k8s.io/kubernetes (Go): affected all versions; fixed in 1.11.9
- k8s.io/kubernetes (Go): affected all versions; fixed in 1.11.9
- k8s.io/kubernetes (Go): affected from 1.12.0; fixed in 1.12.7
- k8s.io/kubernetes (Go): affected from 1.12.0; fixed in 1.12.7
- k8s.io/kubernetes (Go): affected from 1.13.0; fixed in 1.13.5
- k8s.io/kubernetes (Go): affected from 1.13.0; fixed in 1.13.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2019-1002101/ (Markdown: https://insights.sbomify.com/CVE-2019-1002101/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2019-1002101
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2019-1002101
- OSV: https://osv.dev/vulnerability/CVE-2019-1002101

---
From sbomify Insights: https://insights.sbomify.com/CVE-2019-1002101/
Summaries are generated and may contain mistakes; the official description above is the record.
