Skip to content

security: conversation history is kept in the shared pod by conversation id alone, unbounded and not bound to the workspace #35

Closed

Description

@homer6

Severity: medium. Confidence: high for the missing binding and the unbounded growth; medium for exploitation, which needs another workspace's conversation id.

Where

What is wrong

  1. No tenant binding. The pod serves every workspace. History is looked up by conversation id alone, so a turn from workspace B that names workspace A's conversation id continues A's conversation: the model receives A's messages and the workspace data A's reads returned, and answers B. Lake does not prevent this: agent_turn accepts any caller-supplied conversation_id and only refuses when it finds an earlier task with that id in the caller's own customer and workspace belonging to another user (lake src/api/workspace_capabilities.cpp, latest_agent_conversation_task). In another workspace it finds none and dispatches the turn. The reverse also works: B can write into a conversation id that A later uses, planting instructions in A's history.
  2. Unbounded. Every conversation and every observation stays in memory for the life of the pod, with no cap on conversations, turns or size. One person can grow the pod's memory without limit by sending turns under new conversation ids.
  3. The list returned by history() is mutated outside the lock, so two turns on one conversation interleave their messages.

Who can reach it

Any person who can send an Experiments turn. Reading another workspace's history needs that conversation's id (ids are UUIDs that lake generates when the caller gives none, so this needs the id to leak, for example from a shared link, a log or a screenshot, or a caller that picks predictable ids). The memory growth needs nothing.

Evidence

self.conversations: dict[str, list[dict[str, Any]]] = {}
def history(self, conversation_id: str):
    with self.lock:
        return self.conversations.setdefault(conversation_id, [])
...
conversation_id = str(body.get("conversation_id") or uuid.uuid4())
answer = answer_turn(turn, state.history(conversation_id), ...)

Impact

Workspace data read with one person's credential can be disclosed to a person in another workspace, and one workspace can inject instructions into another's conversation. The memory growth can take the shared pod down for every workspace.

Recommended fix

  1. Key the history by (customer_id, workspace_id, requesting user, conversation_id) as the task carries them, and refuse a turn whose key does not match the stored owner.
  2. Better, keep no history in the pod: lake already sends prior_turn and stores the conversation in the workspace Zetta; rebuild the messages from what lake sends on each turn.
  3. If any cache remains, bound it (entries, age and bytes) and hold the lock while appending.

How to verify the fix

  • A test: a turn for customer A with conversation id X, then a turn for customer B with the same id X. The second turn's model call must not contain A's message or observations.
  • A test that sends turns under 10,000 new conversation ids and checks that the stored state stays within the bound.

Found by the G1 security review of the unreviewed repos, https://github.com/oramasearch/orama-bridge/issues/273.

Activity

  1. self-assigned this
    on Nov 15, 2026
  2. added
    securitySecurity-relevant (authz, secrets, isolation)
    on Nov 15, 2026
  3. homer6 commented on Nov 15, 2026

    @homer6
    ContributorAuthor

    Lake side, checked against lake dev (agent_turn in src/api/workspace_capabilities.cpp): Lake looks up a conversation's earlier turn with latest_agent_conversation_task(customer, conversation, agent, kind, workspace), so a turn in workspace B never receives workspace A's earlier turn. It also answers not_found when that turn was requested by someone else. A conversation id from another workspace therefore collides only inside the agent pod's own memory. Keying the pod's history by (workspace, conversation), the agent-side fix being made for this issue, closes it. No Lake change is needed.

  4. homer6 commented on Nov 15, 2026

    @homer6
    ContributorAuthor

    Fixed in #37 (commit d643d63, base dev).

    What changed: new conversations.ConversationStore replaces the process-wide dict. History is keyed by customer id, the checked workspace path (lake_url), the workspace and user ids when the turn carries them, and the conversation id, so another workspace naming the same id gets an empty history of its own and cannot read or write the first. The store holds at most 256 conversations (least recently used dropped), expires one idle for an hour, and keeps each history to its system prompt plus 60 messages and 200,000 characters, dropping whole exchanges. A turn works on a copy taken under the lock and saved back whole, so turns no longer interleave. Tests in tests/test_conversations.py cover the cross-workspace case and 10,000 conversation ids; docs in docs/operations/service.md. Lake's side is fixed separately.

    The tests were not run and nothing was built, per Steve, 2026-11-14 (tests run at review and release time).

  5. added
    in-prThe fix is in an open pull request, not merged yet
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in-prThe fix is in an open pull request, not merged yetsecuritySecurity-relevant (authz, secrets, isolation)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions