T09 · Insecure Skill Coding Practices
- Location
scripts/qwen-code.js:204- Finding
Shell Command Injection in MCP Command Handling
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real Qwen CLI wrapper, but it needs review because it promotes unattended code-changing runs and includes unsafe helper code that can execute unintended shell commands or write persistent skill files outside the intended location.
Install only if you trust the Qwen CLI and intend to let it access the target project and Qwen account state. Run it from an isolated workspace, avoid -y/--yolo and automated process approvals on important code, pin the Qwen CLI version instead of using latest, and do not pass untrusted values to mcp, extensions, or skill create until the wrapper is fixed.
scripts/qwen-code.js:204Shell Command Injection in MCP Command Handling
scripts/qwen-code.js:222Shell Command Injection in Extension Command Handling
scripts/qwen-code.js:298Path Traversal Allows File Creation or Overwrite Outside the Skills Directory
scripts/qwen-code.js:307JavaScript Injection in Generated Skill Source
assets/examples/headless-mode.example.js:16Shell Command Injection in the Published Headless Automation Example
assets/examples/ci-cd.example.yml:24Unpinned Global Installation of an Executable Dependency
This skill appears to expose capabilities beyond simple task execution, including access to local Qwen configuration, project/session history, skills, extensions, and agent-management surfaces. That mismatch is dangerous because it can lead to unintended local data exposure and broader control over the host environment than the user expects from the description.
This skill appears to expose capabilities beyond simple task execution, including access to local Qwen configuration, project/session history, skills, extensions, and agent-management surfaces. That mismatch is dangerous because it can lead to unintended local data exposure and broader control over the host environment than the user expects from the description.
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Referenced artifact was not completely inspected
scripts/qwen-code.js status
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
export DASHSCOPE_API_KEY="sk-xxx"
Get key from: https://dashscope.console.aliyun.com/
---
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
qwen -p "根据上述问题,生成修复后的完整代码版本" /tmp/sample_code.py
# 清理
rm /tmp/sample_code.py
echo ""
echo "=== 代码审查示例完成 ==="
This markdown file includes natural-language statements such as 'Complete rewrite in English' and 'All content now English-only for international audience.' That imposes a specific language policy without any opt-in, alternative, or region-specific justification, which matches the locale-policy violation criteria.
The README explicitly promotes an auto-approve (-y) mode for background task execution, enabling the external Qwen CLI to make changes or proceed without interactive review. In the context of an automation skill that runs coding tasks and refactors code, this materially increases the risk of unauthorized file modifications, unsafe command execution, or propagation of harmful changes through CI/CD workflows.
bash workdir:~/project background:true yieldMs:30000
command:"qwen -p 'Analyze code structure' -m qwen3-coder-plus"
bash workdir:~/project background:true yieldMs:30000
command:"qwen -p 'Refactor this function' -y"
The README makes a misleading security claim that all code generation and modifications require user confirmation, while earlier documentation explicitly shows YOLO mode using -y for auto-approval. This inconsistency can cause operators to trust the skill more than warranted and may lead to unattended code changes or command execution in sensitive environments.
The changelog explicitly describes an 'English-Only Refactoring' and says all documentation is in English. This is a natural-language locale policy choice presented without any user choice, opt-in, or region-specific justification, which matches the language-policy violation criteria.
The skill documents use of a networked CLI, authentication, environment variables, and background execution, but it does not declare any explicit tool scope such as allowed tools or permissions. That omission weakens reviewability and makes it easier for an agent to invoke broader capabilities than users may expect, especially since the skill also encourages autonomous background runs.
The documented use of auto-approve mode delegates change approval to the external CLI, allowing it to make decisions and modifications without per-action human review. In a coding/automation skill, that creates a real risk of unintended file changes, command execution, or policy bypass through over-broad trust in the tool.
bash workdir:~/project background:true yieldMs:30000
command:"qwen -p 'Analyze code structure' -m qwen3-coder-plus"
bash workdir:~/project background:true yieldMs:30000
command:"qwen -p 'Refactor this function' -y"
The examples promote auto-approval and sending confirmation input to a background process without emphasizing manual review of proposed changes. That pattern increases the chance of unreviewed code edits, unsafe shell actions, or harmful modifications being accepted automatically.
The rules section normalizes YOLO mode for building and parallel autonomous runs, which encourages higher-trust execution patterns at scale. Combining auto-approval with multiple background processes magnifies the blast radius of mistakes or malicious prompts across many files or repositories.
1. **Respect tool choice** — if user asks for Qwen, use Qwen. NEVER offer to build it yourself!
2. **Be patient** — don't kill sessions because they're "slow"
3. **Monitor with process:log** — check progress without interfering
4. **YOLO mode for building** — `--yolo` auto-approves changes (use in workspace only)
5. **Review mode for safety** — production code should use review mode
6. **Parallel is OK** — run many Qwen processes at once for batch work
7. **NEVER start Qwen in ~/clawd/** — it'll read your soul docs! Use target project dir or /tmp
The security notes say all code generation and modifications require user confirmation, but elsewhere the skill explicitly recommends YOLO mode that auto-approves changes. This contradiction can mislead users into believing destructive or unreviewed edits cannot occur, lowering caution during execution.
The manifest description is written entirely in Chinese and provides no indication that users may choose another language or that the skill is intended only for a Chinese-speaking or region-specific audience. This creates a natural-language locale constraint without opt-in or documented justification.
The script's comments, echoed messages, and prompt text are all written in Chinese, which effectively forces a specific language for users interacting with the example. There is no opt-in, alternative language path, or documentation that this is intentionally limited to a Chinese-speaking audience.
Detected: suspicious.dangerous_exec, suspicious.exposed_secret_literal