T09 · Insecure Skill Coding Practices
- Location
scripts/write.mjs:159- Finding
OS Command Injection Through the User-Controlled Topic Argument
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Chinese AI-writing skill is purpose-aligned, but it needs Review because its search feature can execute shell commands from a user-supplied topic and runs an unverified local search script with inherited environment secrets.
Review before installing. Use only with trusted topic input, avoid setting TAVILY_API_KEY until the shell execution is fixed, and do not rely on the advertised rewrite/SEO/dedup features unless those scripts are added. The publisher should replace execSync string execution with argument-array process execution or a direct Tavily API client, pass only the required environment variables, add clear privacy and overwrite warnings, and verify or remove the external local-skill dependency.
scripts/write.mjs:159OS Command Injection Through the User-Controlled Topic Argument
scripts/write.mjs:156Execution of an Unverified External Skill With Inherited Environment Secrets
The script constructs a shell command and executes another script using execSync, which is a dangerous capability expansion for a writing tool. Because the command embeds user-controlled topic text inside a shell string, this introduces command injection risk in addition to cross-skill execution, potentially allowing arbitrary command execution under the current user.
The natural-language instructions and descriptions are entirely in Chinese, which effectively forces a specific language for users without opt-in or explanation. Under the policy, language constraints should either offer user choice or be clearly documented and justified as region-specific.
This markdown file advertises '自动搜索相关热点话题' using Tavily AI Search, which implies outbound network requests based on user-provided topics. The README does not warn users that their prompts/topics may be sent to a third-party search service, creating a missing disclosure about privacy-affecting behavior.
The skill declares an environment dependency (TAVILY_API_KEY) but does not define any explicit tool scope such as permissions or allowed-tools. That creates ambiguity about what runtime actions the skill may perform with the secret and weakens least-privilege controls, increasing the risk of unintended network use or secret exposure if supporting scripts access the environment unsafely.
The manifest advertises a broader AI writing suite, including 查重, SEO 优化, and 改写润色. The code in this file implements style-based article generation and appends search results, but contains no logic for duplicate checking, SEO analysis/optimization, or rewriting existing text, so the described behavior does not match the actual implementation here.
The script reads an external API key from the environment and conditionally enables network-backed behavior via a separate search skill, expanding capability beyond simple local content templating. In a writing assistant, this creates unexpected data-flow and dependency risk: user topics can be sent to external services, and behavior now depends on another skill outside this file’s trust boundary.
User-controlled topic input is inserted directly into a shell command without safe argument separation, making this more than a disclosure issue: it is an exploitable command injection sink. In this skill context, topics are expected to be arbitrary free-form text, which increases the likelihood that special shell metacharacters could be supplied intentionally or accidentally.
The usage example documents saving output to '~/article.md', which affects local user data by writing to the filesystem. The README does not include any caution about file creation or possible overwrite behavior, so users are not warned about this data-affecting operation.
The script writes generated content to a user-specified file path when --output is provided. While it logs after saving, the help and surrounding comments do not warn that this option will overwrite or create files on disk, which is a safety-relevant side effect.
The generated timestamp is forced to use the zh-CN locale and Asia/Shanghai timezone, which imposes a specific language/locale behavior without user opt-in. The file does not indicate that this is a region-specific tool or provide a configurable locale setting.