Repository navigation
Description
Severity: medium. Confidence: high for the missing binding and the unbounded growth; medium for exploitation, which needs another workspace's conversation id.
Where
src/agent_experiments/service.py#L34-L44:State.conversationsis one process-widedictkeyed only byconversation_id; entries are never removed.src/agent_experiments/service.py#L144-L168:conversation_idis taken from the turn body and its history is passed toanswer_turn, with no check ofcustomer_idor workspace.src/agent_experiments/agent.py#L503-L510and#L568-L593: the system prompt, every message, every model reply and everylake_readobservation (up to 30,000 characters each) are appended to that list and sent to the model on the next turn.
What is wrong
- 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_turnaccepts any caller-suppliedconversation_idand only refuses when it finds an earlier task with that id in the caller's own customer and workspace belonging to another user (lakesrc/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. - 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.
- 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
- 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. - Better, keep no history in the pod: lake already sends
prior_turnand stores the conversation in the workspace Zetta; rebuild the messages from what lake sends on each turn. - 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
homer6 commentedon Nov 15, 2026
Lake side, checked against
lakedev (agent_turninsrc/api/workspace_capabilities.cpp): Lake looks up a conversation's earlier turn withlatest_agent_conversation_task(customer, conversation, agent, kind, workspace), so a turn in workspace B never receives workspace A's earlier turn. It also answersnot_foundwhen 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.homer6 commentedon Nov 15, 2026
Fixed in #37 (commit d643d63, base
dev).What changed: new
conversations.ConversationStorereplaces 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 intests/test_conversations.pycover the cross-workspace case and 10,000 conversation ids; docs indocs/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).