# k8s-mcp-server: Missing authentication on default SSE/HTTP transport allows unauthenticated Kubernetes tool execution

k8s-mcp-server's default SSE transport on 0.0.0.0:8080 dispatches tools/call with no auth, letting any network client run Kubernetes read/write tools with server privileges.

- Payout: Research
- Severity: high
- Program: k8s-mcp-server
- Found by: bebold6133
- Disclosed: 2026-11-19
- CVE: CVE-2026-130007
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-m932-63jc-4jqq
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-m932-63jc-4jqq
- Tags: area:ai domain:ai domain:cloud impact:integrity impact:privesc kind:research platform:ghsa sev:high tech:go tech:kubernetes technique:source-review vuln:access-control vuln:auth-bypass vuln:misconfiguration

**Target:** MCP SSE/HTTP transport endpoint (GET /sse, POST /message) on port 8080
**Root cause:** NewSSEServer is created without an auth option or contextFunc and binds 0.0.0.0; handleMessage only checks method==POST and a loadable sessionId (a correlation value, not a credential) before dispatching to tools/call. Only ACAO:* is set, which is CORS relaxation, not auth.
**Steps:**
1. Start `k8s-mcp-server -mode sse -port 8080` with dummy KUBERNETES_SERVER=https://127.0.0.1:1
2. `GET /sse` -> HTTP 200, server mints `/message?sessionId=93b3...`
3. `POST /message initialize` -> HTTP 202, result over SSE
4. `POST /message tools/list` -> HTTP 202, full tool list incl. destructive tools
5. `POST /message tools/call getAPIResources` -> HTTP 202, handler executes; response is in-handler dial error `-32603 ... dial tcp 127.0.0.1:1: connect`, not 401/403
6. `ss -ltnp` confirms LISTEN *:8080
**How found:** Static trace of handleSSE -> handleMessage -> tools/call in mcp-go v0.57.0 and main.go L129-130, noting no auth option/contextFunc and 0.0.0.0 bind; confirmed at runtime by observing the tools/call response was an in-handler cluster dial error rather than 401/403, proving the RPC passed any authorization gate.
**Exploitation:** Any client with network reach to port 8080 opens GET /sse to obtain a sessionId, then POSTs JSON-RPC to /message with no auth headers to enumerate and invoke tools. Calls execute with the server's kubeconfig privileges: cluster reads and, since readOnly defaults false, Create/Delete/RolloutRestart and Helm Install/Upgrade/Uninstall/Rollback.
**Escalation:** Default readOnly=false exposes state-changing tools (Create/Delete/Helm) beyond read access; containerized deployment on 0.0.0.0 makes the port externally reachable.
**Insight:** For MCP servers, the sessionId minted by GET /sse is a correlation value, not a credential — check whether handleMessage gates on anything beyond a loadable sessionId, and treat an in-handler error (e.g. backend dial failure) instead of 401/403 as proof the request bypassed auth.

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

**Unauthenticated tools/call request sequence over SSE**

```
GET  /sse                         -> HTTP 200; server mints /message?sessionId=93b3...
  POST /message initialize          -> HTTP 202; result returned over SSE
  POST /message tools/list          -> HTTP 202; FULL tool list returned (incl. destructive)
  POST /message tools/call getAPIResources -> HTTP 202; handler EXECUTED:
        error -32603 "... Get https://127.0.0.1:1/api...: dial tcp 127.0.0.1:1: connect"
```

