T09 · Insecure Skill Coding Practices
- Location
scripts/memory_layer.py:194- Finding
Unrestricted Storage Paths Permit File Access Outside the Intended Memory Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a legitimate agent memory layer, but it needs review because it persists potentially sensitive memories in plaintext and does not safely constrain storage paths.
Review before installing in any environment that may handle private user data or untrusted agent identifiers. Use only with trusted callers, validate agent_id and storage paths, keep the memory directory access-controlled, avoid storing secrets or credentials, and add retention and deletion controls before production use.
scripts/memory_layer.py:194Unrestricted Storage Paths Permit File Access Outside the Intended Memory Directory
scripts/consolidate.py:10Consolidation CLI Accepts an Unrestricted Agent Path
scripts/memory_layer.py:108Potentially Sensitive Agent Memory Is Persisted in Plaintext
The skill describes code-backed memory capabilities, including references to Redis storage, scripts, and persistent memory operations, but does not declare any explicit tool scope or permissions. In an agent ecosystem, undeclared file read/write or storage-related capabilities can cause the agent to invoke the skill in broader contexts than intended, reducing reviewability and increasing the chance of unauthorized data access or persistence.
The description uses very broad activation language like 'Use when building agent memory persistence, conversation context management, knowledge retrieval, or episodic recall,' which creates weak trigger boundaries. That makes over-invocation more likely, so the skill may be applied in situations involving sensitive conversations or user data even when memory persistence is unnecessary, increasing privacy and data-handling risk.
The skill explicitly stores persistent user preferences, facts, and episodic history, including examples like 'User prefers dark mode,' without any notice, consent model, retention policy, or privacy constraints. In context, this is more dangerous because the skill is specifically designed as a reusable memory layer for agents, so it normalizes long-lived collection of behavioral and preference data that could expose sensitive personal information, create profiling risk, or retain data longer than users expect.
The long-term memory layer persists arbitrary content and metadata to disk automatically, which can capture sensitive prompts, secrets, or personal data without any consent, minimization, encryption, or retention controls. In an agent-memory skill, this is more dangerous because the core purpose is to retain conversation context, making silent persistence of user-supplied content a realistic privacy and data-exposure risk.
The class docstring describes the long-term store as supporting "semantic retrieval" at L070, which implies behavior beyond literal substring matching. However, the implemented search at L088-L102 is explicitly a simple keyword search, and its own docstring acknowledges that vector similarity is not implemented.