T09 · Insecure Skill Coding Practices
- Location
scripts/kb_sync.py:14- Finding
Cloud synchronization workflow does not enforce sensitive-file filtering
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is not clearly malicious, but it claims cloud knowledge-base sync while shipping only a local scanner plus an unrelated persistent learning logger, with weak controls around broad file scanning and future uploads.
Review before installing. Use this only on a narrow notes-only directory, inspect the dry-run file list carefully, avoid JSON/text files that may contain secrets, and do not let the agent call cloud connectors or API upserts until you have confirmed the exact destination and files. Be aware that the learner script can persist local usage notes and preferences in learned_patterns.json.
scripts/kb_sync.py:14Cloud synchronization workflow does not enforce sensitive-file filtering
The code implements a dry-run/local diff utility based on file hashes and a stored manifest. Its primary behavior is to detect local adds, updates, and deletes and optionally write a new manifest. This is only a small subset of the declared functionality ('change preview' / diff), but the core advertised purpose—syncing with a cloud knowledge base, including bidirectional diff and conflict handling—is absent. Therefore the description materially overstates and misrepresents the actual behavior.
声明描述的是一个面向笔记与云端知识库的数据同步工具,核心能力应包括扫描本地笔记、访问远程知识库/API、比较差异、处理冲突并执行同步。实际代码完全没有网络请求、文件同步、diff、冲突处理或云端知识库接口调用。相反,它提供的是一个独立的通用“自进化学习模块”CLI:init/record/prefer/insight/reflect,用于记录技能使用情况和偏好,并生成统计洞察与改进建议。其主要目的、操作对象和资源访问范围都与声明严重不符,因此属于明显的描述-行为不匹配。
The skill advertises file read/write behavior through example commands and manifest updates, but it does not declare any explicit tool scope or permission boundary. That creates an authorization and review gap: a caller or platform may not understand that the skill can read local files and persist state, increasing the risk of unintended file access or writes.
Broad natural-language triggers can cause the skill to activate on ordinary requests involving notes, comparison, or sync, even when the user did not intend file or cloud operations. In a skill that may read local directories, write manifests, or initiate remote updates, overbroad routing increases the chance of unintended data access or transmission.
The skill describes uploading local notes to remote knowledge bases and persisting manifest state, but it does not clearly warn that user data may be transmitted externally or that remote content may be modified. In a knowledge-sync context, that omission is dangerous because users may unknowingly expose sensitive notes, overwrite cloud documents, or trigger deletions without informed consent.
The skill manifest describes synchronizing between a local notes directory and cloud knowledge bases such as IMA, 腾讯乐享, or a generic API, including bidirectional diff, conflict detection, and cloud document updates. This script never accesses any network service or cloud API; it only scans local files, compares them to a local JSON manifest, and prints add/update/delete candidates.
When dry-run is disabled, the only side effect is writing the current file-hash map to the provided manifest path. For a skill advertised as updating cloud documents and syncing local notes with remote knowledge bases, persisting a local JSON state file is materially different from performing actual remote synchronization.
The file implements a generic cross-skill 'self-evolving learning' component rather than functionality needed for note/knowledge-base synchronization. In this skill context, unrelated reusable logic expands the skill's scope and creates an unnecessary channel for persistent data collection and future behavior shaping, which increases attack surface and violates least-privilege expectations for a sync assistant.
The file’s user-facing documentation and CLI descriptions are entirely in Chinese, presenting the skill as a general-purpose module rather than a region-specific tool. This creates a language/locale policy concern because the skill implicitly requires a specific language without offering user opt-in or documenting a justified locale restriction.
This module persistently stores user preferences, capabilities used, error history, notes, and recent operations in learned_patterns.json, which goes beyond what is required to synchronize notes with a knowledge base. Because notes and error messages may contain sensitive content, this creates a local telemetry store that can accumulate private user data and operational metadata without clear minimization, retention control, or consent.
All user-facing natural-language instructions and invocation examples are presented only in Chinese, which can amount to a language/locale constraint without user opt-in. The file does not state that the skill is region-specific or offer multilingual usage guidance.