| 제목 | letta-ai LettaBot 0.2.0 Missing Authentication for Critical Function (CWE-306) |
|---|
| 설명 | # Technical Details
An Unauthenticated Portal Management Endpoint Access exists in the `GET /api/v1/pairing/:channel` and `GET /api/v1/status` routes in `src/api/server.ts` of LettaBot.
The application fails to enforce API key authentication on portal-backed read endpoints when the agent conversation mode is `shared` (the default). Both routes conditionally skip API key validation when `getPortalMode(options)` resolves to `shared`: `if (getPortalMode(options) !== 'shared' && !validateApiKey(req.headers, options.apiKey))`. In default shared mode, the authorization branch is skipped entirely, allowing unauthenticated remote callers to query pairing request listings and agent status metadata.
# Vulnerable Code
File: src/api/server.ts
Method: GET /api/v1/pairing/:channel handler (line ~449-456) and GET /api/v1/status handler (line ~707-714); getPortalMode() (line ~928-934)
Why: The mode-gated authorization check only rejects unauthenticated requests when mode is NOT shared. In the default shared mode, the guard evaluates `getPortalMode(options) !== 'shared'` as `false`, short-circuits the AND, and skips API key validation entirely.
# Reproduction
1. Deploy LettaBot with default `shared` conversation mode.
2. Send unauthenticated GET requests to `/api/v1/pairing/:channel` and `/api/v1/status`.
3. Observe HTTP 200 responses containing pairing request data and agent metadata (agentId, conversationId, channels, baseUrl, timestamps).
4. Switch to `per-channel` mode and confirm the same requests return 401 Unauthorized.
# Impact
- Remote unauthenticated enumeration of management-plane metadata including pairing state and internal agent status.
- Exposes deployment topology, active channels, conversation identifiers, and service base URLs.
- Assists follow-on targeting by revealing internal infrastructure details. |
|---|
| 원천 | ⚠️ https://gist.github.com/YLChen-007/2ba2e586f3d16cb368c8dcd6ef680178 |
|---|
| 사용자 | JohnChen (UID 99088) |
|---|
| 제출 | 2026. 06. 18. AM 08:50 (2 개월 ago) |
|---|
| 모더레이션 | 2026. 08. 05. PM 08:44 (2 months later) |
|---|
| 상태 | 수락 |
|---|
| VulDB 항목 | 386359 [letta-ai LettaBot 0.2.0 API Status Route src/api/server.ts 약한 인증] |
|---|
| 포인트들 | 20 |
|---|