T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:79
- Finding
- Automatic Transmission of Potentially Sensitive Conversation Data<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:79-89`, `SKILL.md:160-165`, and `SKILL.md:177-211` **Vulnerability Type**: Excessive automatic collection and network transmission of user data **Risk Level**: Medium ### Vulnerable Code ```python def save_conversation_summary(messages): """从对话中提取关键点并存储""" for msg in messages: if is_important(msg): # 判断是否为关键信息 store_memory( content=msg["content"], sender=msg["sender"], metadata={"type": "conversation_summary"} ) ``` The automatic storage policy is documented as follows: ```text 在以下时机自动存储记忆: 1. **对话结束** - 提取关键要点 2. **用户自我介绍** - 存储用户信息 3. **任务完成** - 记录完成内容 4. **用户偏好表达** - 记住偏好设置 ``` The complete example sends the selected content to the configured server: ```python class EverMemOS: def __init__(self, url=None, user_id="default"): self.base_url = url or os.getenv("EVERMEMOS_URL", "http://localhost:1995") self.user_id = user_id def store(self, content, sender="user"): """存储记忆""" return requests.post( f"{self.base_url}/api/v1/memories", json={ "message_id": f"msg_{int(time.time()*1000)}", "content": content, "sender": sender, "user_id": self.user_id, "create_time": datetime.utcnow().isoformat() + "Z", "scene": "assistant" } ).json() ``` ### Technical Analysis Network-based storage is intrinsic to the declared long-term memory functionality. However, the Skill directs the agent to store conversation summaries, introductions, task records, and preferences automatically. These categories can contain personally identifiable information, credentials accidentally pasted into a conversation, confidential business information, or other sensitive material. The documented workflow provides no explicit per-item consent gate, content pre ...[truncated 1672 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Disable automatic memory storage by default. 2. Require explicit user confirmation before each storage operation. 3. Show the exact content, user identifier, and destination that will receive the data. 4. Store only the minimum fact requested by the user instead of full messages or broad summaries. 5. Add a sensitive-data filter that removes credentials, authentication tokens, financial information, health information, and unnecessary personal identifiers. 6. Restrict destinations to an administrator-approved allowlist of trusted origins. 7. Separate memory namespaces by authenticated user identity and prevent use of a shared default identity in multi-user deployments. 8. Define retention periods and provide list, correction, export, and deletion controls. 9. Record auditable consent and storage events without duplicating sensitive content in logs. 10. Treat retrieved memories as untrusted data and prevent stored content from becoming agent instructions. ]]>
