← 返回列表

CVE-2024-10220

单站 Kubernetes Vulnerability Announcements 发布 Wed, 20 Nov 2024 15:30:44 +0000 入库 2026-11-18T06:56:48

Repository navigation

area/kubelet

area/security

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

on Nov 20, 2024

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

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

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

  1. 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
  2. github-project-automationadded this to SIG Node Bugson Nov 20, 2024
  3. 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/accepted label and provide further guidance.


    The triage/accepted label can be added by org members by writing /triage accepted in 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.

  1. 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
  2. github-project-automationmoved this to Triage in SIG Node Bugson Nov 20, 2024
  3. cjiclosed this as completedon Nov 20, 2024
  4. github-project-automationmoved this from Triage to Done in SIG Node Bugson Nov 20, 2024
  5. 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-dirty it errors with jq: error (at <stdin>:28693): endswith() requires string inputs


    I removed the endswith("/.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
  6. 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
  7. jpuhlmanadded a commit that references this issue on Nov 17, 2025
  8. doanacadded a commit that references this issue on Nov 19, 2025

Metadata

Metadata

Assignees

Labels

area/kubelet

area/security

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

原文链接:https://github.com/kubernetes/kubernetes/issues/128885