T09 · Insecure Skill Coding Practices
- Location
scripts/config_wizard.py:289- Finding
Shell Profile Command Injection Through Unescaped Environment Variable Persistence
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This prompt-optimization skill is mostly purpose-aligned, but its setup and diagnostics can persist or reveal API keys and store prompt history without enough protection or disclosure.
Review before installing. Do not run the setup wizard with real API keys unless you are comfortable with keys being written to local config or shell profile files. Avoid using show/get diagnostics with live credentials, and do not submit sensitive prompts unless you have disabled or cleaned the memory/history files. Rotate any keys that were already processed by this skill.
scripts/config_wizard.py:289Shell Profile Command Injection Through Unescaped Environment Variable Persistence
scripts/quick_setup.py:16API Keys Are Persisted in Plaintext Configuration Files
scripts/config_manager.py:137Configuration CLI Prints Resolved API Credentials to Standard Output
scripts/optimizer.py:367Unfiltered User Prompts and Feedback Are Retained Indefinitely
SKILL.md:571Unpinned Third-Party Package Installation Instructions
The documentation describes API keys, model routing, and external model usage, but it does not clearly warn that user prompts, context, and possibly conversation history may be transmitted to third-party services. In this skill's context, that omission is more dangerous because the optimizer is explicitly context-aware and personalized, increasing the chance that sensitive or identifying data will be sent off-device without informed user consent.
The skill presents itself as a ts:-triggered optimizer, yet much of the documented functionality is actually a configuration wizard, connectivity tester, and model configuration inspection CLI. This mismatch undermines informed consent and can cause users to run setup and diagnostic operations with broader access than expected.
The skill presents itself as a ts:-triggered optimizer, yet much of the documented functionality is actually a configuration wizard, connectivity tester, and model configuration inspection CLI. This mismatch undermines informed consent and can cause users to run setup and diagnostic operations with broader access than expected.
The skill presents itself as a ts:-triggered optimizer, yet much of the documented functionality is actually a configuration wizard, connectivity tester, and model configuration inspection CLI. This mismatch undermines informed consent and can cause users to run setup and diagnostic operations with broader access than expected.
The skill presents itself as a ts:-triggered optimizer, yet much of the documented functionality is actually a configuration wizard, connectivity tester, and model configuration inspection CLI. This mismatch undermines informed consent and can cause users to run setup and diagnostic operations with broader access than expected.
The CLI show and get commands print resolved model configuration directly as JSON, and the resolved config can include live api_key values loaded from environment variables. This creates a straightforward secret disclosure path to terminal output, logs, screenshots, shell history tooling, or calling processes, which is especially dangerous because the file already enriches config objects with credentials.
os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.
def clear_screen(self):
"""[EMOJI:6E05][EMOJI:5C4F][EMOJI:FF08][EMOJI:8DE8][EMOJI:5E73][EMOJI:53F0][EMOJI:FF09]"""
os.system('cls' if os.name == 'nt' else 'clear')
def print_header(self, title: str):
"""[EMOJI:6253][EMOJI:5370][EMOJI:6807][EMOJI:9898]"""
The skill presents itself as a prompt optimizer, but this file persistently modifies user shell startup files and installs API secrets into them. That creates a lasting side effect outside the expected scope of the skill and stores sensitive credentials in places that may be broadly readable, backed up, or later exposed through logs, dotfile sync, or local compromise.
The helper writes API credentials directly into .bashrc/.zshrc/.profile, which is a persistence mechanism not justified by a prompt-optimization feature. Plaintext secrets in shell profiles can be leaked via backups, source-control mistakes, workstation sharing, endpoint monitoring, or any later process that reads those files.
The entire publish checklist, form content, example descriptions, and user-facing instructions are written in Chinese, including recommended marketplace descriptions and usage examples. Because the file does not indicate that the skill is region-specific or provide an opt-in language choice, it presents a natural-language locale policy concern.
The description advertises multi-model routing and multiple AI providers but does not clearly warn users that their prompts, and potentially attached context, may be sent to third-party APIs. This creates a meaningful transparency and privacy risk because users may disclose sensitive business, personal, or proprietary information without understanding the external data flow.
The skill claims it will automatically supplement prompts using conversation history and known user preferences, but it does not provide a clear warning that such contextual data may be incorporated and possibly forwarded onward to external models. This increases the risk of unintended disclosure of sensitive prior chat content, profile data, or inferred personal information beyond the user's immediate request.
The marketing description advertises '智能前缀触发' but does not state concrete constraints for when the skill should activate. Because this is a prompt-manipulation skill, under-specified triggering increases the risk of accidental execution and unintended rewriting of prompts, making the skill more dangerous than a passive informational tool.
The documented trigger phrases (ts:, ts-opt:, 优化:) are described broadly without clear start-of-input, token-boundary, or exclusion rules. In a prompt-optimizer skill, ambiguous activation can cause unintended invocation on normal user text, which may alter user intent, interfere with other skills, or create prompt-routing confusion.
The release notes state that the skill stores personalized learning history and user preferences, but they do not disclose retention limits, sensitivity of stored content, access controls, or how users can review/delete that data. For a prompt-optimization skill that processes user tasks and conversation context, this can lead users to unknowingly persist sensitive prompts, creating privacy and compliance risk.
The skill advertises capabilities that imply environment access, local file read/write, and shell execution, but it does not declare any explicit tool scope or permissions. This creates a governance gap where reviewers and users cannot accurately assess what the skill may access or modify, increasing the chance of over-privileged execution and unintended system changes.
The skill explicitly normalizes collecting and reusing user history, preferences, and learning data over time. This is dangerous because it encourages long-term storage of natural-language interactions that may contain credentials, personal data, or sensitive project context, expanding breach and cross-session disclosure risk.
Automatically combining conversation history and owner preferences into new prompt optimizations can leak prior sensitive information into later outputs or external model requests. In a prompt-optimization skill, this context mixing is especially risky because users may assume each optimization only uses the current request.
Defining dedicated memory files for optimization history and user preferences establishes persistent local stores of potentially sensitive behavioral and prompt data. If those files are accessed by other local users, backups, or tools, they can expose confidential information beyond the original optimization session.
The learning mechanism instructs the system to record every optimization and store feedback, success cases, and failures, creating broad ongoing accumulation of user-provided data. Such blanket retention increases the blast radius of any compromise and raises the likelihood of sensitive information being reused or exposed later.
The skill states that optimization history and knowledge updates are recorded automatically, but it does not warn users that their prompts and feedback may be stored persistently. Because prompts often include confidential business, code, or personal data, silent retention creates a meaningful privacy and data leakage risk.
The installation text says setup will automatically set environment variables, but it does not warn that credentials or shell configuration files may be created or modified. This can leave secrets persisted on disk unexpectedly and alter the user's shell environment in ways that are hard to audit or undo.
This JSON file contains multiple natural-language values entirely in Chinese, including role labels, formatting expectations, and tone/style preferences. Because the configuration does not indicate that Chinese is optional or restricted to a justified locale-specific context, it appears to impose a language preference without user opt-in, which matches the language/locale policy violation category.
The task routing thresholds and model capability descriptors are written exclusively in Chinese, and one capability explicitly specifies Chinese writing. This imposes a language/locale assumption in natural-language configuration without offering user opt-in or documenting that the skill is intentionally region-specific.
The configuration enables automatic prefix detection and multiple trigger prefixes without any visible scoping, authorization, or context restrictions. In an agent skill, ambiguous activation can cause the optimizer to process unintended user input or be invoked in contexts the user did not clearly intend, which can widen prompt-injection and misrouting exposure.