VDB
Sign up
MEDIUM5.5

GHSA-34jx-wx69-9x8v

Symlink Attack in kubectl cp

Quick fix

GHSA-34jx-wx69-9x8v — k8s.io/kubernetes: upgrade to the fixed version with the command below.

go get k8s.io/kubernetes@v1.11.9

Details

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

Go/k8s.io/kubernetes
Introduced in: 0Fixed in: 1.11.9
Fixgo get k8s.io/kubernetes@v1.11.9
Go/k8s.io/kubernetes
Introduced in: 1.12.0Fixed in: 1.12.7
Fixgo get k8s.io/kubernetes@v1.12.7
Go/k8s.io/kubernetes
Introduced in: 1.13.0Fixed in: 1.13.5
Fixgo get k8s.io/kubernetes@v1.13.5

References