VulnWatch by ve1ve2
high 7.7 EPSS 0.50%

GHSA-jw3m-8q7m-f35r / CVE-2026-68903: LLMKube: Arbitrary Host File Read via Model.spec.source hostPath Injection

Source:
GitHub Security Advisories
Published:
Fetched:
Updated:
Affects:
github.com/defilantech/llmkube

https://github.com/advisories/GHSA-jw3m-8q7m-f35r ↗

ghsagoCWE-22

LLMKube: Arbitrary Host File Read via Model.spec.source hostPath Injection ### Summary LLMKube's `ModelReconciler` accepts arbitrary absolute paths and `file://` URIs in the `Model.spec.source` field and propagates them to two distinct sinks without path allowlisting: (1) `os.Open()` inside the controller pod itself (`copyLocalModel`), and (2) a Kubernetes `HostPathVolumeSource` that mounts the attacker-supplied path into the inference pod's init container. Any namespace user with permission to create or update `Model` and `InferenceService` custom resources can read arbitrary files accessible to the controller pod (e.g., the controller's own Kubernetes service-account token) or arbitrary files on the node where the inference pod is scheduled (e.g., `/etc/kubernetes/kubelet.conf`). Model caching, the feature that activates the `hostPath` sink, is **enabled by default** in both the CLI and the official Helm chart. CVSS v3.1 Base Score: **7.7 (High)**. ### Details **Entry point — `Model.spec.source` field** The `Source` field in `api/v1alpha1/model_types.go:47-48` carries a `kubebuilder` validation pattern that explicitly permits absolute paths: ```go // +kubebuilder:validation:Pattern=`^(https?|file|pvc|hf)://.*|^/[^\s]+$|^[a-zA-Z0-9][\w\-\.\/]+$` Source string `json:"source"` ``` The branch `^/[^\s]+$` matches any non-whitespace absolute path on the host. **Sink 1 — Controller-pod arbitrary file read (`copyLocalModel`)** `internal/controller/source.go:93-103` classifies a source as local and extracts the path with no sanitization: ```go // isLocalSource: returns true for any "/" prefix or "file://" prefix func isLocalSource(source string) bool { return strings.HasPrefix(source, "/") || strings.HasPrefix(source, "file://") } // getLocalPath: strips "file://" prefix only; no canonicalization, no allowlist func getLocalPath(source string) string { return strings.TrimPrefix(source, "file://") } ``` `internal/controller/model_controller.go:241` passes the attacker-controlled source into `fetchModel`, which reaches `copyLocalModel` at line 664-667: ```go f, err := os.Open(localPath) // localPath = getLocalPath(model.Spec.Source) ``` An attacker sets `model.spec.source: /var/run/secrets/kubernetes.io/serviceaccount/token`; the controller opens its own SA token and writes it to the model-cache PVC, which the attacker can subsequently read. **Sink 2 — Node arbitrary file read via `HostPathVolumeSource`** `internal/controller/model_storage.go:560-568` converts the same path into a Kubernetes host volume with no canonical-root check: ```go if isLocalModelSource(model.Spec.Source) { localPath := getLocalPath(model.Spec.Source) volumes = append(volumes, corev1.Volume{ Name: "host-model", VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: localPath, Type: func() *corev1.HostPathType { t := corev1.HostPathFile; return &t }(), }, }, }) initVolumeMounts = append(initVolumeMounts, corev1. Affected packages: go:github.com/defilantech/llmkube Patched: github.com/defilantech/llmkube 0.9.0

Linked vulnerabilities (2)

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

LLMKube: Arbitrary Host File Read via Model.spec.source hostPath Injection

CWE: CWE-22Aliases: CVE-2026-68903
CVE-2026-68903 high 7.7 EPSS 0.50% (p44) NVDCVE.orgGHSA
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

LLMKube: Arbitrary Host File Read via Model.spec.source hostPath Injection

CWE: CWE-22Aliases: GHSA-jw3m-8q7m-f35rNVD: Received

Also reported by (1)