CVE-2019-11249 kubectl cp allows symlink directory traversal

Medium 4.8 Published Updated

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.

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

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, CWE-61

Which versions are affected by CVE-2019-11249?

It affects 2 products.

Linux distribution packages (12)
atomic-enterprise-service-catalog Red Hat:openshift:4.1::el7All versions1:4.1.16-201909090609.git.1.cc4acc1.el7
atomic-enterprise-service-catalog-svcat Red Hat:openshift:4.1::el7All versions1:4.1.16-201909090609.git.1.cc4acc1.el7
jenkins-2-plugins Red Hat:openshift:4.1::el7All versions0:4.1.1567784275-1.el7
openshift Red Hat:openshift:4.1::el7All versions0:4.1.16-201909090609.git.0.2f97059.el7
openshift-ansible Red Hat:openshift:4.1::el7All versions0:4.1.16-201909090609.git.162.a0800db.el7
openshift-clients Red Hat:openshift:4.1::el7All versions0:4.1.16-201909090609.git.0.2f97059.el7
openshift-clients-redistributable Red Hat:openshift:4.1::el7All versions0:4.1.16-201909090609.git.0.2f97059.el7
openshift-hyperkube Red Hat:openshift:4.1::el7All versions0:4.1.16-201909090609.git.0.2f97059.el7
openshift Red Hat:openshift:4.1::el8All versions0:4.1.16-201909090609.git.0.2f97059.el8
openshift-clients Red Hat:openshift:4.1::el8All versions0:4.1.16-201909090609.git.0.2f97059.el8
openshift-clients-redistributable Red Hat:openshift:4.1::el8All versions0:4.1.16-201909090609.git.0.2f97059.el8
openshift-hyperkube Red Hat:openshift:4.1::el8All versions0:4.1.16-201909090609.git.0.2f97059.el8

Products include Kubernetes Kubernetes, Redhat Openshift Container Platform.

How do I fix CVE-2019-11249?

Upgrade to a fixed version.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2019-11249 being exploited?

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

All Kubernetes Kubernetes vulnerabilities

Sources

Also known as GHSA-v8c4-hw4j-x4pr, RHBA-2019:2794.

Is CVE-2019-11249 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free