T09 · Insecure Skill Coding Practices
- Location
SKILL.md:83- Finding
Shell Command Injection Through Mandatory Response Validation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
WenYan is a disclosed classical-Chinese style tool, but its mandatory shell-based validation and persistent state handling need review before use.
Review before installing. Use it only in a sandboxed or scoped workspace, avoid implementing the documented echo-based validation literally, restrict style IDs to known values, and prefer explicit commands or confirmation for persistent mode changes. Do not paste generated prompts into account-wide or app-wide system instructions unless you want all responses there to adopt this style.
SKILL.md:83Shell Command Injection Through Mandatory Response Validation
scripts/style_engine.py:32Path Traversal Through Unvalidated Style Identifiers
The file describes WenYan as a "general-purpose classical Chinese style engine," which indicates the skill is designed to force a specific language/style. Under the policy rule, language constraints should either be optional for the user or clearly justified as a locale-specific tool; this contribution guide does not present that as an opt-in choice.
The activation phrases are very broad natural-language commands like '用文言说话' and '换个古代风格', which can plausibly appear in ordinary conversation rather than as explicit control commands. In a skill that changes persistent agent behavior, this creates unintended activation risk and prompt-state confusion, especially because the mode remains active until explicitly exited.
The semantic exit behavior accepts vague phrases like '够了', '算了', '我听不懂', and '换回来', which are common in normal dialogue and may be spoken for content reasons rather than as mode-control commands. Because these phrases can silently disable the skill, they create ambiguous control flow and make agent behavior easy to manipulate or disrupt unintentionally.
The English activation examples use generic phrases such as 'Switch to Sanguo 3' and 'Exit classical style' that resemble ordinary user requests and can collide with normal content discussion. In multi-agent or tool-integrated environments, generic triggers increase the chance of accidental mode switching and unintended persistent prompt changes.
The English semantic exit examples ('enough', 'stop', 'too classical', 'I don't understand') are highly common conversational phrases and lack safeguards that distinguish control intent from ordinary feedback. This makes the skill easy to deactivate accidentally or by adversarial phrasing embedded in user content, reducing reliability and enabling prompt-state manipulation.
The skill explicitly describes reading and writing state.json on every turn, but it declares no tool scope or permissions boundary. That creates an authorization gap: an agent runtime may grant broader file access than users expect, and the persistent state behavior can be invoked without an explicit consent model.
The activation phrases are broad and include natural-language variants like '换个古代风格' and '用武侠语气', which can be matched in ambiguous contexts rather than as a clear command. This can cause unintended skill activation and persistent mode changes, especially because the skill then auto-applies state on subsequent turns.
The exit logic relies on open-ended semantic intent matching such as '够了' or '算了', which may appear in unrelated conversation and cause unintended deactivation. While this is safer than refusing to exit, it still lets ambiguous text silently alter persistent state and creates unpredictable control flow for the user.
The text states that after filling the system prompt field, the whole app 'speaks classical Chinese,' which imposes a specific language/style behavior on all app responses. This is a natural-language locale/language constraint presented as the default outcome, without an explicit opt-in or user choice mechanism.
This markdown file presents the skill entirely as Chinese-only interaction examples, including all user prompts and assistant responses, with no indication that users may choose another language. Under the language/locale policy rule, forcing a specific language without opt-in is a natural-language policy violation.
This file is entirely framed as a Chinese/WenYan style comparison sheet and presents all examples and phrasing exclusively in Chinese. Under the language/locale policy, content that enforces a specific language without user opt-in can be a natural-language policy violation when no alternative or choice is provided.
The description states that the skill converts AI replies into ancient Chinese style and enumerates Chinese literary styles, which implies a fixed language/locale transformation. The manifest does not mention any user opt-in, language selection, or region-specific justification for enforcing this output style.
This manifest-like JSON is entirely structured around Chinese labels and Chinese-era address mappings such as "现代" and "古代通称", with no indication that the skill is optional, locale-specific, or user-selectable. The policy explicitly calls for flagging language or locale constraints when a specific language is forced without user opt-in or justification.
This JSON contains natural-language descriptions and instructions exclusively in Chinese, such as the description at L02 and replacement principles at L32-L36. Because the file offers no alternative language, opt-in, or justification for a Chinese-only constraint, it can violate a language/locale policy requiring user choice or explicit documentation.
This JSON style file mandates a specific Chinese linguistic and cultural register, including Chinese self/other forms of address and era-specific phrasing. Because the file does not indicate any user opt-in or choice of language/locale, it appears to impose a language/style constraint that may violate organizational language-choice policy.
The natural-language rules require an archaic Buddhist-Chinese tone and ban modern terms, which constrains output language behavior in a way users may not have requested. Without accompanying opt-in or justification that this is a region- or style-specific optional mode, this is a policy concern under language/locale restrictions.
This JSON style definition requires responses in a specific Chinese literary register, including fixed Chinese address terms, templates, and rules forbidding modern vocabulary. That is a natural-language locale/style constraint with no indication of user opt-in or alternative language choice, which can violate language/locale policy requirements.
The rules require a fixed Han-end strategist persona and prohibit modern vocabulary, effectively forcing responses into a specific Chinese historical linguistic style. There is no indication in this file that the user can choose or opt into this language/locale constraint.
This configuration is entirely prescriptive for Classical Chinese/Chinese-language output, including Chinese naming, replacements, templates, and rules such as requiring specific Chinese rhetorical forms. The file does not indicate any user opt-in or language choice, which can violate a language/locale policy when the skill is expected to respect user language preferences.
This style configuration consistently mandates a specific language/register: the name is Chinese and the rules require archaic Shijing-style phrasing, including forbidding modern vocabulary and prescribing classical forms. Because the file does not indicate any user choice, opt-in, or region-specific justification, it appears to enforce a language/locale style unconditionally.
This JSON style configuration requires output in a specific Chinese wuxia register, including Chinese honorifics, fixed Chinese replacements, and rules banning modern vocabulary. That constitutes a language/locale constraint presented as mandatory behavior, and the file does not indicate any user choice or opt-in for applying this linguistic mode.
This JSON configuration mandates a specific language and historical register through its name, forbidden patterns, replacements, templates, and rules. The file does not indicate that users can opt into another language or locale, so it appears to enforce a fixed linguistic style in a way that can violate language/locale choice policy.
The generated instruction says the model 'MUST reply in the following style' and makes it 'mandatory, not optional.' Because this skill enforces a specific linguistic mode on output rather than offering a choice, it is a natural-language policy concern under the language/locale rule.
The script contains language-specific behavior such as counting Chinese characters and splitting sentences on the Chinese full stop, while defaulting style operations to a fixed style ID. There is no natural-language disclosure that this tool is intended only for Chinese text or that users can opt into that locale constraint, which may violate language/locale policy expectations.
This JSON test file hard-codes Chinese inputs and expected Chinese phrases such as "阿弥陀佛" and "施主", and explicitly rejects neutral alternatives in another language/register. That creates a language/locale constraint in the skill behavior without any indication of user choice or opt-in, which matches the policy-violation criteria for forced language behavior.