# CVE-2024-10220: Arbitrary command execution through gitRepo volume

> Attackers can execute arbitrary commands on nodes by exploiting specially crafted gitRepo volumes in Kubernetes kubelet.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Nov 2024
- **Updated:** 25 Nov 2024
- **Also known as:** AZL-53528, AZL-53652, CLEANSTART-2025-ZX75782, DEBIAN-CVE-2024-10220, GHSA-27wf-5967-98gx, GO-2024-3286, MINI-r7rp-5m55-7mp3, OESA-2024-2532

## What is CVE-2024-10220?

CVE-2024-10220 is a high-severity command injection vulnerability in Kubernetes kubelet, published on 22 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

The Kubernetes kubelet component allows arbitrary command execution via specially crafted gitRepo volumes.This issue affects kubelet: through 1.28.11, from 1.29.0 through 1.29.6, from 1.30.0 through 1.30.2.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-10220?

7 open source packages ship an affected version, including k8s.io/kubernetes.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `k8s.io/kubernetes` | Go | All versions | 1.28.12, 1.29.7, 1.30.3 |
| `k8s.io/kubernetes` | Go | All versions | 1.28.12 |
| `k8s.io/kubernetes` | Go | All versions | 1.28.12 |
| `k8s.io/kubernetes` | Go | From 1.29.0 | 1.29.7 |
| `k8s.io/kubernetes` | Go | From 1.29.0 | 1.29.7 |
| `k8s.io/kubernetes` | Go | From 1.30.0 | 1.30.3 |
| `k8s.io/kubernetes` | Go | From 1.30.0 | 1.30.3 |

## How do I fix CVE-2024-10220?

Upgrade k8s.io/kubernetes to a fixed version for your release line: 1.28.12, 1.29.7 or 1.30.3.

## Is CVE-2024-10220 being exploited?

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

Public exploit code:

- CVE-2024-10220 Test repo (github_poc): https://github.com/mochizuki875/CVE-2024-10220-githooks
- CVE-2024-10220 reveals a critical flaw in Kubernetes’ deprecated gitRepo volume type, allowing attackers to execute arbitrary commands via malicious .hooks scripts. The article explains how this breaks container isolation and offers exploit code, automation examples, and mitigation guidance (github_poc): https://github.com/mrk336/CVE-2024-10220-Kubernetes-gitRepo-Volume-Vulnerability
- https://github.com/any2sec/cve-2024-10220 (github_poc): https://github.com/any2sec/cve-2024-10220
- https://github.com/filipzag/CVE-2024-10220 (github_poc): https://github.com/filipzag/CVE-2024-10220
- CVE-2024-10220 POC (github_poc): https://github.com/candranapits/poc-CVE-2024-10220
- https://github.com/orgC/CVE-2024-10220-demo (github_poc): https://github.com/orgC/CVE-2024-10220-demo

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-10220 and fix it if it is affected.

What it is: CVE-2024-10220 is a high-severity command injection vulnerability in Kubernetes kubelet, published on 22 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-10220 in the wild and no public exploit code.

Affected packages and fixed versions:
- k8s.io/kubernetes (Go): affected all versions; fixed in 1.28.12, 1.29.7, 1.30.3
- k8s.io/kubernetes (Go): affected all versions; fixed in 1.28.12
- k8s.io/kubernetes (Go): affected all versions; fixed in 1.28.12
- k8s.io/kubernetes (Go): affected from 1.29.0; fixed in 1.29.7
- k8s.io/kubernetes (Go): affected from 1.29.0; fixed in 1.29.7
- k8s.io/kubernetes (Go): affected from 1.30.0; fixed in 1.30.3
- k8s.io/kubernetes (Go): affected from 1.30.0; fixed in 1.30.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-10220/ (Markdown: https://insights.sbomify.com/CVE-2024-10220/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-10220
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-10220
- OSV: https://osv.dev/vulnerability/CVE-2024-10220

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-10220/
Summaries are generated and may contain mistakes; the official description above is the record.
