T09 · Insecure Skill Coding Practices
- Location
run.py:34- Finding
Unrestricted Handler Path Selection Enables Arbitrary Python Execution
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears to fetch the advertised stock announcement and research report data, but its local command dispatcher and PDF saving behavior are broader than they need to be.
Review before installing. Use only the documented subskill names, avoid untrusted output filenames, and do not run it in a directory or installation where overwriting skill files or following symlinks could affect important local files. The observed issues look like insecure scoping and file-handling weaknesses, not proven malicious intent.
run.py:34Unrestricted Handler Path Selection Enables Arbitrary Python Execution
sub-skills/stock-announcements-specific-url-hash/scripts/handler.py:13Symlink-Following Announcement Download Permits Arbitrary File Overwrite
sub-skills/stock-reports-specific-url-hash/scripts/handler.py:13Symlink-Following Report Download Permits Arbitrary File Overwrite
Referenced artifact was not completely inspected
`run.py` 与本文件(`SKILL.md`)位于同一目录。执行时:
The skill advertises and operationalizes shell execution, file access, and network access via python <RUN_PY> ... and PDF download flows, but it does not declare any explicit tool/permission scope. That creates a governance gap: an orchestrator or reviewer cannot easily constrain what the skill is allowed to do, increasing the risk of unintended command execution, network retrieval, or file operations beyond the user’s expectation.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print(f"错误:未找到 subskill '{subskill}',路径不存在:{handler}", file=sys.stderr)
sys.exit(1)
result = subprocess.run(
[sys.executable, handler] + sys.argv[2:],
cwd=SKILL_ROOT,
)
The natural-language strings in the module docstring and CLI descriptions are exclusively in Chinese, with no indication that the user can choose another language or that the skill is intentionally restricted to a Chinese-speaking audience. Under the stated policy, forcing a specific language without opt-in is a locale/language policy concern.
The file's docstring and command-line descriptions are entirely in Chinese, which imposes a specific language on users without any visible opt-in or explanation of a region-specific requirement. Under the language/locale policy, forcing a specific language without user choice can be a natural-language policy violation.
This code includes user-facing natural-language strings entirely in Chinese, including the module docstring, command description, and argument help text. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.
The skill instructs downloading and saving PDFs with an --output filename but provides no warning or safeguard around local file creation, overwrite behavior, or path handling. In practice, this can lead to accidental overwriting of existing files or writing to unintended locations if the output parameter is not constrained by the implementation.
The module docstring and runtime usage/error messages are presented only in Chinese, which imposes a specific language on users without any visible opt-in or alternative. The policy for this audit flags language or locale constraints when they are forced rather than optional or justified.
This markdown file presents the skill name, usage, parameters, and notes entirely in Chinese. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is clearly documented and justified, which is not present here.
This code constructs a URL from the user-provided date and pagination arguments and sends it to a remote service with urllib.request.urlopen. Although the operation is central to the script's purpose, the file itself provides no explicit comment, docstring detail, or user-facing notice that supplied parameters will be transmitted over the network to an external endpoint.
This code performs an HTTP request to an external domain using the user-supplied stock code as a query parameter. While the network access is central to the script's purpose, there is no explicit user-facing notice, prompt, or comment in this file disclosing that input will be transmitted to a remote service.
This markdown file presents all user-facing instructions exclusively in Chinese. Under the language/locale policy rule, forcing a single language without opt-in or justification can be a natural-language policy violation.
This markdown file states that the script saves a file to a local path and returns the saved location, but it does not include any user warning about writing to disk or possible overwrite/storage effects. Under the markdown-file criteria for SQP-2, behaviors affecting user data or system state should be disclosed.
No suspicious patterns detected.