Summary
LLMKube's model reconciliation can accept attacker-selected absolute paths or file:// URIs as model sources without restricting them to approved locations. A user who can create or update relevant resources may cause files from the controller pod or, under the applicable cache configuration, a Kubernetes node to be copied into model storage and exposed.
Affected context
The issue occurs in LLMKube's ModelReconciler when processing Model.spec.source. Risk depends on a deployment allowing namespace users to create or update Model and InferenceService resources and on the controller accepting local paths without an approved-root restriction. When model caching is enabled, the reconciliation flow may also use a HostPath volume to access a node file.
Exploit preconditions
- Attack surface: Model and InferenceService resource creation or updates handled by the LLMKube controller
- Required access: Permissions to create or update those resources in an applicable namespace
- Trigger point: Model reconciliation and local model copying; node-file access is relevant when model caching is enabled
- Why exploitation is possible: User-controlled absolute paths or
file://URIs are not restricted to approved roots, allowing the controller or mounted volume to access files outside the intended model storage area
Why this happens
The controller uses a user-controlled model source to select a local filesystem path without adequately constraining that path to approved directories. This is an improper limitation of a pathname to a restricted directory, corresponding to CWE-22: Path Traversal. The underlying insecure pattern is trusting a resource field as a filesystem location without canonicalizing it and enforcing an appropriate boundary.
Potential impact
- Files readable by the controller could be copied into model storage and disclosed to users who can access that storage.
- Controller service-account credentials or other sensitive files in the controller pod could be exposed.
- When model caching is enabled, sensitive files accessible on a node could be copied and exposed.
- Access to disclosed credentials could enable further unauthorized actions, depending on their permissions.
General mitigation guidance
Common defensive patterns include:
- Accepting model sources only from an explicit set of trusted locations or storage backends.
- Resolving and canonicalizing local paths, then verifying they remain within approved roots before opening or copying files.
- Avoiding direct use of user-controlled paths in HostPath mounts; use narrowly scoped storage mechanisms where possible.
- Restricting who can create or update model-related resources through least-privilege RBAC.
- Limiting controller service-account permissions and access to sensitive files, and reducing node exposure through constrained workload configuration.
How teams detect issues like this
- Review reconciliation code for user-controlled paths passed to file-opening, copy, or volume-mount operations.
- Use static analysis to identify filesystem access where paths are not canonicalized and checked against trusted roots.
- Audit RBAC policies for permissions to create or update Model and InferenceService resources.
- Monitor model resource changes and controller activity for unexpected local paths,
file://sources, or access to sensitive locations. - Enforce policy checks that restrict model sources to approved storage schemes and locations.

