PoC Archive PoC Archive
High CVE-2026-34940 patched

OS Command Injection in KubeAI via Model URL (CVE-2026-34940)

by Unnamed researcher (GHSA disclosure) · 2026-07-05

CVSS 8.7/10
Severity
High
CVE
CVE-2026-34940
Category
cloud
Affected product
KubeAI (github.com/kubeai-project/kubeai)
Affected versions
<= commit ba1824e
Disclosed
2026-07-05
Patch status
patched

Metadata

FieldValue
Date Added2026-07-05
Last Updated2026-06
Author / ResearcherUnnamed researcher (GHSA disclosure)
CVE / AdvisoryCVE-2026-34940
Categorycloud
SeverityHigh
CVSS Score8.7 (CVSSv3)
StatusPoC
Tagskubernetes, kubeai, command-injection, ollama, crd, kubectl, model-serving, cwe-78
RelatedN/A

Affected Target

FieldValue
Software / SystemKubeAI (github.com/kubeai-project/kubeai)
Versions Affected<= commit ba1824e
Language / PlatformKubernetes / Go (target); nuclei-style YAML PoC
Authentication RequiredYes (Model CRD create/update RBAC, no cluster-admin needed)
Network Access RequiredYes (Kubernetes API)

Summary

KubeAI constructs a Kubernetes startup probe shell script by interpolating Model CRD URL components (ref, modelParam) into a bash -c command via Go’s fmt.Sprintf. Shell metacharacters in these fields are not sanitized, so any user holding only Model CRD create/update RBAC — not cluster-admin — can achieve arbitrary command execution inside the model server pod.


Vulnerability Details

Root Cause

The startup probe script is built via unsanitized string interpolation of user-controlled Model CRD fields into a bash -c invocation.

Attack Vector

  1. Obtain RBAC permission to create/update Model custom resources (a low-privilege role in many clusters).
  2. Set the model ref or modelParam field to a value containing shell metacharacters and a command payload.
  3. KubeAI reconciles the CRD and starts a pod whose startup probe runs the crafted shell command.

Impact

Command execution inside the model-serving pod for any user with Model CRD write access, without needing cluster-admin privileges.


Environment / Lab Setup

Target:   KubeAI <= commit ba1824e on a Kubernetes cluster
Attacker: kubectl access with Model CRD create/update RBAC

Proof of Concept

PoC Script

See poc.yaml in this folder.

1
kubectl apply -f poc.yaml

Applies a malicious Model CRD whose ref/modelParam fields inject a shell command into the generated startup probe.


Detection & Indicators of Compromise

Signs of compromise:

  • Unexpected shell metacharacters in Model CRD manifests
  • Anomalous process trees inside KubeAI-managed pods

Remediation

ActionDetail
Primary fixUpgrade to the patched KubeAI release once available — monitor the project’s GHSA advisory
Interim mitigationRestrict Model CRD create/update RBAC to trusted operators only

References


Notes

Mirrored from https://github.com/romain-deperne/CVE-2026-34940 on 2026-07-05.