Skip to content

GHSA-34jx-wx69-9x8v CVE-2019-1002101 GO-2022-0782

Symlink Attack in kubectl cp

Medium Go
Severity
5.5 / 10
Medium · CVSS 3.0
Exploit chance (EPSS)
12.80%
Chance of exploitation in the next 30 days. Higher than 96.29% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-59 Improper Link Resolution Before File Access ('Link Following')
Fix
1.11.9
Upgrade k8s.io/kubernetes to this version or later

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.

Affected versions

Go

PackageVulnerableFixed in
k8s.io/kubernetes
< 1.11.9
1.11.9
k8s.io/kubernetes
>= 1.12.0, < 1.12.7
1.12.7
k8s.io/kubernetes
>= 1.13.0, < 1.13.5
1.13.5
k8s.io/kubernetes
< 1.11.9
>= 1.12.0, < 1.12.7
>= 1.13.0, < 1.13.5
1.11.9
1.12.7
1.13.5

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

k8s.io/kubernetes Go → 1.11.9

go
go get k8s.io/kubernetes@v1.11.9 && go mod tidy

Severity breakdown

CVSS 3.0 5.5

CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

Weakness

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

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

How to prevent it
  • Architecture and Design: Follow the principle of least privilege when assigning access rights to entities in a software system. Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-r6j8-c6r2-37rr
kube-controller-manager is vulnerable to half-blind Server Side Request Forgery through in-tree Portworx StorageClass
Medium Also affects k8s.io/kubernetes
GHSA-4x4m-3c2p-qppc
Kubernetes Nodes can delete themselves by adding an OwnerReference
Medium Also affects k8s.io/kubernetes
GHSA-hj2p-8wj8-pfq4
kubernetes allows nodes to bypass dynamic resource allocation authorization checks
Low Also affects k8s.io/kubernetes
GO-2025-3547
Kubernetes kube-apiserver Vulnerable to Race Condition
Low Also affects k8s.io/kubernetes
GHSA-3wgm-2gw2-vh5m
Kubernetes GitRepo Volume Inadvertent Local Repository Access
Medium Also affects k8s.io/kubernetes
GHSA-vv39-3w5q-974q
Kubernetes allows Command Injection affecting Windows nodes via nodes/*/logs/query API
Medium Also affects k8s.io/kubernetes
GHSA-jgfp-53c3-624w
Node Denial of Service via kubelet Checkpoint API
Medium Also affects k8s.io/kubernetes
GHSA-27wf-5967-98gx
Kubernetes kubelet arbitrary command execution
High Also affects k8s.io/kubernetes
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor