OS Command Injection in KubeAI via Model URL (CVE-2026-34940)
by Unnamed researcher (GHSA disclosure) · 2026-07-05
- 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
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-06 |
| Author / Researcher | Unnamed researcher (GHSA disclosure) |
| CVE / Advisory | CVE-2026-34940 |
| Category | cloud |
| Severity | High |
| CVSS Score | 8.7 (CVSSv3) |
| Status | PoC |
| Tags | kubernetes, kubeai, command-injection, ollama, crd, kubectl, model-serving, cwe-78 |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | KubeAI (github.com/kubeai-project/kubeai) |
| Versions Affected | <= commit ba1824e |
| Language / Platform | Kubernetes / Go (target); nuclei-style YAML PoC |
| Authentication Required | Yes (Model CRD create/update RBAC, no cluster-admin needed) |
| Network Access Required | Yes (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
- Obtain RBAC permission to create/update
Modelcustom resources (a low-privilege role in many clusters). - Set the model
reformodelParamfield to a value containing shell metacharacters and a command payload. - 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.yamlin this folder.
| |
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
| Action | Detail |
|---|---|
| Primary fix | Upgrade to the patched KubeAI release once available — monitor the project’s GHSA advisory |
| Interim mitigation | Restrict 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.