Miggo Logo

CVE-2024-10220:
Kubernetes kubelet arbitrary command execution

8.1

CVSS Score
3.1

Basic Information

EPSS Score
0.93569%
Published
11/22/2024
Updated
12/13/2024
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
k8s.io/kubernetesgo< 1.28.121.28.12
k8s.io/kubernetesgo>= 1.29.0, < 1.29.71.29.7
k8s.io/kubernetesgo>= 1.30.0, < 1.30.31.30.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability allows arbitrary command execution via specially crafted gitRepo volumes. The provided commit 1ab06efe92d8e898ca1931471c9533ce94aba29b patches the validateVolume function in pkg/volume/git_repo/git_repo.go. This function is responsible for validating the parameters of a GitRepo volume. The patch adds a check to ensure that if both a Revision and a Directory are specified, the Directory field does not contain path separators (e.g., / or \\). This prevents path traversal attacks where an attacker could specify a Directory like ../.git/hooks in conjunction with a Revision to potentially write executable git hooks into an unexpected location, leading to command execution when git checkout or similar commands are run by the kubelet. The validateVolume function is where the vulnerable input (src.Directory and src.Revision) is processed, and the lack of proper validation here was the root cause. Therefore, this function would be active during the setup of a malicious gitRepo volume and is central to the exploitation of the vulnerability.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

T** Ku**rn*t*s ku**l*t *ompon*nt *llows *r*itr*ry *omm*n* *x**ution vi* sp**i*lly *r**t** *itR*po volum*s.T*is issu* *****ts ku**l*t: t*rou** *.**.**, *rom *.**.* t*rou** *.**.*, *rom *.**.* t*rou** *.**.*.

Reasoning

T** vuln*r**ility *llows *r*itr*ry *omm*n* *x**ution vi* sp**i*lly *r**t** *itR*po volum*s. T** provi*** *ommit `****************************************` p*t***s t** `v*li**t*Volum*` *un*tion in `pk*/volum*/*it_r*po/*it_r*po.*o`. T*is *un*tion is r*