Cognithor
Any Visitor Could Steal Every API Key Zero Authentication Required
The /api/v1/bootstrap endpoint returns the application’s master bearer token to any caller with no authentication. Because the API server binds to 0.0.0.0 by default, any host that can reach the server port can retrieve the token in a single HTTP request then access every protected endpoint, exfiltrate all stored credentials, and trigger destructive operations such as factory reset.
On startup, cognithor generates (or reads from the environment) a master bearer token stored in _internal_api_token. This is the sole credential used by _verify_cc_token to authenticate every protected endpoint. The /api/v1/bootstrap route returns it unconditionally no auth dependency, no caller check:
The endpoint is also exempt from rate limiting, making repeated or automated retrieval completely unconstrained.
Verified against cognithor 0.71.0 in an isolated Docker container (python:3.12), default configuration, installed via pip install -e '.[web]'.
Step 1 Steal the master token (zero credentials)
Step 2 Exfiltrate full configuration (13,312 bytes, 14 API keys)
Step 3 Factory reset (destructive)
Control auth enforced on all other endpoints
| Endpoint | Method | Impact |
|---|---|---|
| /api/v1/config | GET | All LLM API keys and DB passwords |
| /api/v1/credentials | GET | All stored service credentials |
| /api/v1/config/factory-reset | POST | Wipe entire user configuration |
| /api/v1/agents | GET · POST · DELETE | Enumerate, create, or delete agents |
| /api/v1/vault/stats | GET | Vault metadata |
| /api/v1/sessions/guard/violations | GET | Security audit records |
| /api/v1/isolation/secrets | GET | Isolation layer secret stats |
Any attacker with network access to the cognithor port can silently exfiltrate every LLM API key, password, and secret in a single unauthenticated HTTP request. No prior knowledge, credentials, or user interaction required. On any deployment reachable over a local network or the internet, this is a complete compromise of all integrated third-party credentials.
Remove /api/v1/bootstrap or gate it with dependencies=[Depends(_verify_cc_token)]. The intended use case delivering the session token to the local frontend can be satisfied by embedding the token in the served HTML at render time, or passing it as a URL fragment on CLI launch (never transmitted over the network, inaccessible cross-origin).
As an immediate defence-in-depth measure, change the default bind from 0.0.0.0 to 127.0.0.1 at __main__.py:555 so the API is unreachable on external interfaces unless explicitly configured.
Fix shipped in v0.78.2 ↗ /api/v1/bootstrap now rejects non-loopback callers with 403. Default bind changed from 0.0.0.0 to 127.0.0.1. Credited in commit message, SECURITY.md, release notes, and annotated git tag.