T09 · Insecure Skill Coding Practices
- Location
SKILL.md:43- Finding
Unrestricted AI-Generated SQL Queries
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is local-only, but it automatically persists personal notes and can replace the memory database without clear safeguards.
Review before installing if your MEMORY.md may contain sensitive information. Use it only if you are comfortable with automatic local duplication into memory.db, make backups before heartbeat sync runs, and avoid letting an agent execute model-generated SQL directly without a constrained read-only query function.
SKILL.md:43Unrestricted AI-Generated SQL Queries
auto_sync_memory.py:37Destructive Full-Table Replacement Can Cause Memory Data Loss
描述中最核心的功能不仅包括 MEMORY.md 到 SQLite 的自动同步,还包括自然语言检索和知识库集成;而实际代码只覆盖了其中的同步部分。代码会在 Markdown 更新时间较新时,解析三级标题块并全量重建 memories 表,这与“自动同步到本地数据库”是一致的,也符合“无外部 API 调用”的声明。但描述强调的查询/检索能力是该技能的重要卖点和使用场景,而代码完全未实现,因此存在实质性描述与行为不一致。
The README states that the system will automatically sync MEMORY.md into memory.db on every heartbeat, but it does not clearly warn users that potentially sensitive personal notes will be persistently copied to disk in a second datastore. Even though the storage is local-only, silent or poorly disclosed persistence increases privacy risk, broadens the attack surface, and can surprise users who may not expect automated duplication of personal data.
The skill describes reading sensitive local files such as MEMORY.md and interacting with a local SQLite database, but it does not declare any explicit tool scope or permissions. In an agent framework, undeclared file-read capability weakens least-privilege controls and can cause the runtime or reviewer to underestimate what local data the skill may access.
The inline comment says the old data is cleared 'or optionally: only update changes', implying a synchronization strategy that could preserve existing records or update incrementally. In reality, the code always executes DELETE FROM memories, which wipes the entire table before reinserting current markdown blocks, so the documentation understates the destructive behavior of the sync.
The script deletes all existing rows from the memories table before re-inserting data, which is a destructive operation. Although it prints that synchronization is happening, there is no explicit warning that prior database contents will be wiped and replaced.
Comments and printed status messages are written only in Chinese, which imposes a specific language without any opt-in or explanation of a locale-specific requirement. This can violate language/locale policy when the skill is expected to operate in a general environment.
No suspicious patterns detected.