fix: sanitize topic parameter in tool_diary_write
agent_name and entry are validated via sanitize_name/sanitize_content, but topic is stored raw into ChromaDB metadata. Apply the same sanitize_name guard to reject null bytes, path traversal, and oversized payloads.
This commit is contained in:
@@ -925,6 +925,7 @@ def tool_diary_write(agent_name: str, entry: str, topic: str = "general"):
|
||||
try:
|
||||
agent_name = sanitize_name(agent_name, "agent_name")
|
||||
entry = sanitize_content(entry)
|
||||
topic = sanitize_name(topic, "topic")
|
||||
except ValueError as e:
|
||||
return {"success": False, "error": str(e)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user