Repository navigation
committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)
sig/nodeCategorizes an issue or PR as relevant to SIG Node.Categorizes an issue or PR as relevant to SIG Node.
Description
A security vulnerability was discovered in Kubernetes that could allow a user with the ability to create a pod and associate a gitRepo volume to execute arbitrary commands beyond the container boundary. This vulnerability leverages the hooks folder in the target repository to run arbitrary commands outside of the container's boundary.
Please note that this issue was originally publicly disclosed with a fix in July (#124531), and we are retroactively assigning it a CVE to assist in awareness and tracking.
This issue has been rated High (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N) (score: 8.1), and assigned CVE-2024-10220.
Am I vulnerable?
This CVE affects Kubernetes clusters where pods use the in-tree gitRepo volume to clone a repository to a subdirectory. If the Kubernetes cluster is running one of the affected versions listed below, then it is vulnerable to this issue.
Affected Versions
- kubelet v1.30.0 to v1.30.2
- kubelet v1.29.0 to v1.29.6
- kubelet \<= v1.28.11
How do I mitigate this vulnerability?
To mitigate this vulnerability, you must upgrade your Kubernetes cluster to one of the fixed versions listed below.
Additionally, since the gitRepo volume has been deprecated, the recommended solution is to perform the Git clone operation using an init container and then mount the directory into the Pod's container. An example of this approach is provided here.
Fixed Versions
- kubelet master/v1.31.0 - fixed by gitRepo volume: directory must be max 1 level deep #124531
- kubelet v1.30.3 - fixed by Automated cherry pick of #124531: gitRepo volume: directory must be max 1 level deep #125988
- kubelet v1.29.7 - fixed by Automated cherry pick of #124531: gitRepo volume: directory must be max 1 level deep #125989
- kubelet v1.28.12 - fixed by Automated cherry pick of #124531: gitRepo volume: directory must be max 1 level deep #125990
Detection
To detect whether this vulnerability has been exploited, you can use the following command to list all pods that use the in-tree gitRepo volume and clones to a .git subdirectory.
kubectl get pods --all-namespaces -o json | jq '.items[] | select(.spec.volumes[].gitRepo.directory | endswith("/.git")) | {name: .metadata.name, namespace: .metadata.namespace}
If you find evidence that this vulnerability has been exploited, please contact security@kubernetes.io
Acknowledgements
This vulnerability was reported and mitigated by Imre Rad.
/area security
/kind bug
/committee security-response
/label official-cve-feed
/sig node
/area kubelet
Activity
- k8s-ci-robotadded kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.sig/nodeCategorizes an issue or PR as relevant to SIG Node.Categorizes an issue or PR as relevant to SIG Node.official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)on Nov 20, 2024
- github-project-automationadded this to SIG Node Bugson Nov 20, 2024
-
k8s-ci-robot commentedon Nov 20, 2024 ContributorMore actions This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the
triage/acceptedlabel and provide further guidance.
Thetriage/acceptedlabel can be added by org members by writing/triage acceptedin a comment.
Details Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
- k8s-ci-robotadded needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.on Nov 20, 2024
- github-project-automationmoved this to Triage in SIG Node Bugson Nov 20, 2024
- cjiclosed this as completedon Nov 20, 2024
- github-project-automationmoved this from Triage to Done in SIG Node Bugson Nov 20, 2024
-
paul-civitas commentedon Nov 20, 2024 More actions Hello the detection mentioned is very helpful, however it's missing a trailing single quotation mark. Also for jq version
jq-1.6-159-apple-gcff5336-dirtyit errors withjq: error (at <stdin>:28693): endswith() requires string inputs
I removed theendswith("/.git")to run:
kubectl get pods --all-namespaces -o json | jq '.items[] | select(.spec.volumes[].gitRepo.directory) | {name: .metadata.name, namespace: .metadata.namespace}'
Running this came up empty, which I understand indicates that we don't have any gitRepo volumes in our cluster, which is the expected result. But this one liner is very helpful for demonstrating said expected result, so thanks a ton for your contribution on this! Reacted by Ravi Buddi, Aaron Mildenstein, Sandro, mengmeng and Ramesh Kumar -
AbdulAhadAkhter commentedon Nov 25, 2024 More actions This worked for my version of jq. It kept coming back with a can't iterate over a null value. ```
kubectl get pods --all-namespaces -o json | jq '.items[] | select(.spec.volumes[]?.gitRepo? != null) | {name: .metadata.name, namespace: .metadata.namespace}'
```
Reacted by Ramesh Kumar - jpuhlmanadded a commit that references this issue on Nov 17, 2025
- doanacadded a commit that references this issue on Nov 19, 2025
Metadata
Metadata
Assignees
Labels
committee/security-responseDenotes an issue or PR intended to be handled by the product security committee.Denotes an issue or PR intended to be handled by the product security committee.
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
official-cve-feedIssues or PRs related to CVEs officially announced by Security Response Committee (SRC)Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)
sig/nodeCategorizes an issue or PR as relevant to SIG Node.Categorizes an issue or PR as relevant to SIG Node.
Type
Projects
- StatusDoneShow more project fields