T09 · Insecure Skill Coding Practices
- Location
scripts/learner.py:62- Finding
Symlink-Following Arbitrary File Overwrite in Learning-State Persistence
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly does what it says, but its learning helper can persist user-provided notes and preferences into caller-selected directories without clear bounds.
Review before installing if you do not want a skill to keep local learning history. Avoid passing untrusted directories to learner.py, do not store secrets in notes or preferences, and inspect or remove learned_patterns.json if you want to clear retained state.
scripts/learner.py:62Symlink-Following Arbitrary File Overwrite in Learning-State Persistence
This is a strong description-behavior mismatch: the skill claims multi-agent orchestration, but analysis indicates undeclared persistence and learning-related data collection features instead. Hidden behavior is dangerous because users and reviewers may grant trust based on the declared purpose while the implementation stores local data and performs additional analysis outside the documented contract.
The skill advertises orchestration behavior but does not declare any tool scope despite detected file-write capability. Undeclared write access weakens reviewability and can enable unexpected local state changes, persistence, or tampering that callers did not consent to.
The manifest description and main heading/body are written entirely in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.
The script accepts an arbitrary path or skill name, resolves it, and then reads/writes learned_patterns.json under that directory with no confinement to the current skill. In a multi-agent skill ecosystem, this enables cross-skill state modification and unintended persistence in attacker-chosen directories if another component passes untrusted input, weakening isolation boundaries between skills.
The module persistently stores free-form notes and user preferences to disk without any minimization, redaction, retention policy, or consent prompt. In practice, notes and preferences can easily contain secrets, personal data, internal prompts, or operational context that later becomes readable by other local components or exposed through backups and logs.
This code file contains user-facing natural-language documentation and usage/help text exclusively in Chinese, with no indication that users may choose another language. Under the policy rule for language/locale, forcing a specific language without opt-in is a natural-language policy concern.
The printed usage string is a direct user-facing interaction and is only available in Chinese. Because the file does not offer locale selection or clearly justify a Chinese-only constraint, this appears to force a specific language on users.
The documentation frames the module as a neutral learning component that only records usage, preferences, insights, and reflection. In practice, resolve_skill_dir allows operating on arbitrary skill directories, and self_reflect generates advice to write experience back into the skill's SKILL.md, which goes beyond the narrow 'only records' framing in the docstring.
Natural-language policy violations include forcing a specific language or locale without offering a choice. Here, the module docstring and CLI-facing messages are entirely in Chinese, with no indication that the user can select another language or that the skill is intentionally region-specific.