# CVE-2019-11249: kubectl cp allows symlink directory traversal

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

- **Severity:** Medium 4.8 (`CVSS:3.0/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 29 Aug 2019
- **Updated:** 16 Sep 2024
- **Also known as:** GHSA-v8c4-hw4j-x4pr, RHBA-2019:2794

## What is CVE-2019-11249?

CVE-2019-11249 is a medium-severity path traversal vulnerability in Kubernetes Kubernetes, published on 29 Aug 2019. Any signed-in user can exploit it over the network, 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 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 prior to 1.13.9, versions prior to 1.14.5, versions prior to 1.15.2, and versions 1.1, 1.2, 1.4, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), CWE-61 (UNIX Symbolic Link (Symlink) Following)

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

It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `atomic-enterprise-service-catalog` | Red Hat:openshift:4.1::el7 | All versions | 1:4.1.16-201909090609.git.1.cc4acc1.el7 |
| `atomic-enterprise-service-catalog-svcat` | Red Hat:openshift:4.1::el7 | All versions | 1:4.1.16-201909090609.git.1.cc4acc1.el7 |
| `jenkins-2-plugins` | Red Hat:openshift:4.1::el7 | All versions | 0:4.1.1567784275-1.el7 |
| `openshift` | Red Hat:openshift:4.1::el7 | All versions | 0:4.1.16-201909090609.git.0.2f97059.el7 |
| `openshift-ansible` | Red Hat:openshift:4.1::el7 | All versions | 0:4.1.16-201909090609.git.162.a0800db.el7 |
| `openshift-clients` | Red Hat:openshift:4.1::el7 | All versions | 0:4.1.16-201909090609.git.0.2f97059.el7 |
| `openshift-clients-redistributable` | Red Hat:openshift:4.1::el7 | All versions | 0:4.1.16-201909090609.git.0.2f97059.el7 |
| `openshift-hyperkube` | Red Hat:openshift:4.1::el7 | All versions | 0:4.1.16-201909090609.git.0.2f97059.el7 |
| `openshift` | Red Hat:openshift:4.1::el8 | All versions | 0:4.1.16-201909090609.git.0.2f97059.el8 |
| `openshift-clients` | Red Hat:openshift:4.1::el8 | All versions | 0:4.1.16-201909090609.git.0.2f97059.el8 |
| `openshift-clients-redistributable` | Red Hat:openshift:4.1::el8 | All versions | 0:4.1.16-201909090609.git.0.2f97059.el8 |
| `openshift-hyperkube` | Red Hat:openshift:4.1::el8 | All versions | 0:4.1.16-201909090609.git.0.2f97059.el8 |

Products: Kubernetes Kubernetes, Redhat Openshift Container Platform.

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

Upgrade to a fixed version.

## Is CVE-2019-11249 being exploited?

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

## 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-11249 and fix it if it is affected.

What it is: CVE-2019-11249 is a medium-severity path traversal vulnerability in Kubernetes Kubernetes, published on 29 Aug 2019. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2019-11249 in the wild and no public exploit code.

Affected product: Kubernetes Kubernetes. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-11249/ (Markdown: https://insights.sbomify.com/CVE-2019-11249/index.md)
```

## Sources

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

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