GitHub Advisoryadvisory · Go

GHSA-34jx-wx69-9x8v Symlink Attack in kubectl cp

MEDIUM Published 2022-02-15 Modified 2023-09-18 Official page ↗
Aliases
CVE-2019-1002101
Ecosystem
Go
Packages
k8s.io/kubernetes
Severity
Moderate
CVSS vector
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
Weaknesses
CWE-59
Reviewed
2021-05-19

Affected packages

• Go k8s.io/kubernetes: < 1.11.9 → fixed in 1.11.9 • Go k8s.io/kubernetes: >= 1.12.0, < 1.12.7 → fixed in 1.12.7 • Go k8s.io/kubernetes: >= 1.13.0, < 1.13.5 → fixed in 1.13.5

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.

Related

Alias · CVE (1)

  • CVE-2019-1002101 The kubectl cp command allows copying files between containers and the user machine. vulnerability

Weakness · CWE (1)

  • CWE-59 Improper Link Resolution Before File Access weakness

References