| Title | https://github.com/chenhg5/ cc-connect commit dfad1941 Missing Authentication |
|---|
| Description | Webhook server runs without authentication when webhook.token is empty
## Summary
`WebhookServer` (core/webhook.go) allows running with an empty `webhook.token`, which silently disables authentication on the webhook HTTP endpoint. Unlike the bridge server (`core/bridge.go`), which already fails closed on an empty token unless an explicit insecure opt-in is set, the webhook server had no equivalent guard.
## Impact
The webhook endpoint (`POST /hook` by default) accepts a JSON body with either a `prompt` (sent to an agent session) or `exec` (a raw shell command executed via the configured shell, with a 5-minute timeout). With `webhook.token` unset or left blank in config, any network client that can reach the listening port can trigger arbitrary shell execution or agent prompts with no authentication at all, binding to all interfaces (`:<port>`) by default.
## Where
- `core/webhook.go`: `NewWebhookServer` / `authenticate` — `if ws.token == "" { return true }` meant an empty token was treated as "auth not required" rather than "auth misconfigured."
- `cmd/cc-connect/main.go`: webhook server startup unconditionally calls `core.NewWebhookServer(port, cfg.Webhook.Token, path)` regardless of whether a token is set.
## Suggested fix
Mirror the existing `BridgeConfig`/`core/bridge.go` pattern already used elsewhere in this codebase: fail closed (refuse to start) when no token is configured, unless an explicit `insecure` opt-in is set, in which case bind loopback-only and log a warning. A fix implementing this is attached as a PR. |
|---|
| Source | ⚠️ https://github.com/chenhg5/cc-connect/issues/1964 |
|---|
| User | carfeii (UID 97470) |
|---|
| Submission | 11/13/2026 15:53 (23 days ago) |
|---|
| Moderation | 12/06/2026 22:49 (23 days later) |
|---|
| Status | Duplicate |
|---|
| VulDB entry | 393229 [chenhg5 cc-connect up to 1.4.1 core/webhook.go authenticate exec code injection] |
|---|
| Points | 0 |
|---|