T09 · Insecure Skill Coding Practices
- Location
scripts/batch_search.py:141- Finding
Arbitrary File Write Through Unsanitized Batch Query Names
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The arXiv research skill is mostly coherent, but crafted input files can make it write JSON files outside the chosen output directory.
Review this skill before installing if you will process JSON or JSONL files from other people. Run it in a scratch output directory, avoid --no-skip-existing unless replacement is intended, prefer trusted metadata/query files only, and pin dependencies in your own environment.
scripts/batch_search.py:141Arbitrary File Write Through Unsanitized Batch Query Names
scripts/summarize.py:397Arbitrary JSON File Write Through Unvalidated Metadata arXiv IDs
scripts/download.py:117Unrestricted Output Path in the Paper Downloader API
All user-facing documentation in this file is presented in Chinese, while no opt-in, alternative language, or justification for a Chinese-only experience is provided. The policy requires flagging language or locale constraints when the skill effectively forces a specific language without user choice.
This markdown file applies to SQP-2, and it describes a destructive option: --no-skip-existing will overwrite existing files. Although the option is shown, the documentation does not include any explicit warning that existing PDFs may be replaced, which could affect user data.
This file hard-codes user-facing descriptions and help text in Chinese, including the module docstring and argparse help strings. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 执行模块
import subprocess
return subprocess.call([sys.executable] + new_argv)
if __name__ == "__main__":
SQP-3 applies to all file types and covers language or locale policy violations. This file presents its natural-language interface, help text, and operational messages in Chinese only, with no opt-in, alternative locale, or justification that the tool is region-specific.
This file presents its module description, CLI help text, and operational messages entirely in Chinese. Under the policy, forcing a specific language without offering a user choice or documenting a justified locale constraint is a natural-language policy violation.
This file's user-facing natural-language interface and help text are presented only in Chinese, including the module description and CLI argument documentation. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.
SQP-3 applies to all file types and covers language or locale policy violations in natural-language strings. The module docstring, CLI help text, and runtime messages are presented only in Chinese, with no opt-in or alternative language support, which can violate an organizational policy requiring language choice.
This markdown file documents operations that download papers and save outputs to local files and directories, including batch downloads and generated metadata/summaries. Under the markdown-specific warning rule, the description should disclose that the skill writes data to disk and may create or populate output directories so users understand the impact on their filesystem.
SQP-3 applies to all file types and includes language or locale policy violations. This file presents all instructional content in Chinese and does not indicate that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context.
The natural-language comments are entirely in Chinese ('示例 arXiv ID 列表', '每行一个 ID,可以包含版本号或完整 URL') with no indication that language choice is optional or region-specific. This can violate language/locale policy when a skill or resource imposes a specific language without user opt-in.
This requirements file uses Chinese-only natural-language comments such as '核心 arXiv API', 'HTTP 请求', and similar labels throughout. For a general skill file, this imposes a specific language on maintainers or reviewers without offering a language choice or documenting a justified locale constraint.
Using a lower-bounded but unpinned dependency for arxiv allows future installs to resolve to newer, unreviewed versions with different behavior or newly introduced vulnerabilities. This weakens build reproducibility and increases supply-chain risk, especially for agent skills that may be deployed repeatedly in different environments.
# arXiv Search Skill Dependencies
# 核心 arXiv API
arxiv>=1.4.8
# HTTP 请求
requests>=2.28.0
An unpinned requests dependency permits installation of arbitrary newer releases at deployment time, making the runtime version non-deterministic. Because this library handles outbound HTTP and authentication-related features, version drift can expose the skill to known or future security issues and behavior changes.
arxiv>=1.4.8
# HTTP 请求
requests>=2.28.0
urllib3>=1.26.0
# 数据处理
The manifest does not pin requests, so it is impossible to verify whether deployed environments will get a patched or vulnerable version despite known advisories affecting some releases. Because requests is used for HTTP interactions, unresolved version ambiguity can expose the skill to credential leakage, TLS-validation issues, or other network-security defects depending on the resolved version.
Using urllib3 with only a minimum version allows dependency resolution to pull in later releases without review, reducing reproducibility and complicating vulnerability management. Since urllib3 is a core HTTP transport component, weaknesses in it can affect TLS handling, redirects, proxy behavior, and response processing.
# HTTP 请求
requests>=2.28.0
urllib3>=1.26.0
# 数据处理
pandas>=1.5.0
urllib3 has known advisories, but the requirement is not pinned, so the actual security posture of any deployment cannot be verified from this manifest. Since urllib3 underpins HTTP transport, vulnerable versions can affect redirect handling, proxy behavior, decompression, or TLS-related logic in ways that increase attack surface.
An unpinned pandas dependency creates non-reproducible builds and may bring in future versions with security or compatibility regressions. While pandas is less security-sensitive than networking libraries in this context, dependency drift still increases supply-chain uncertainty.
urllib3>=1.26.0
# 数据处理
pandas>=1.5.0
numpy>=1.23.0
# YAML 配置
Because pandas is not pinned, the manifest cannot prove that installations avoid advisory-affected versions. In this skill, pandas is likely used for local data handling, so the direct security impact is lower, but the unverifiable version still represents supply-chain uncertainty.
Specifying numpy with only a lower bound means the installed version can vary across environments and over time. This is primarily a supply-chain and reproducibility concern, with lower direct security impact here than for network-facing libraries.
# 数据处理
pandas>=1.5.0
numpy>=1.23.0
# YAML 配置
PyYAML>=6.0
The unpinned numpy requirement means a deployment may install a version with known issues, and that cannot be ruled out from this file alone. Although numpy is not the most exposed component here, unverifiable dependency versions still undermine secure and reproducible builds.
An unpinned PyYAML dependency is risky because YAML parsers have a history of unsafe-deserialization issues and parser-related vulnerabilities. Without a fixed reviewed version, deployments may resolve to versions with different security properties or expose the skill to known vulnerable releases indirectly.
numpy>=1.23.0
# YAML 配置
PyYAML>=6.0
# 并行处理
tqdm>=4.64.0
PyYAML has a history of serious deserialization and input-validation issues, and the lack of a pinned version makes it impossible to know whether deployments are safe. In an agent skill context where configuration may be loaded dynamically, that ambiguity makes this more concerning than a generic utility package.
Leaving tqdm unpinned allows version drift and reduces reproducibility, which can matter if CLI-related vulnerabilities or argument-handling bugs exist in some releases. In this file, the security impact is limited but still a valid supply-chain hygiene issue.
PyYAML>=6.0
# 并行处理
tqdm>=4.64.0
# PDF 处理
PyPDF2>=3.0.0
tqdm has known advisories in some versions, and because the requirement is unpinned, the manifest cannot establish whether a deployment will be affected. The practical impact in this skill is limited unless tqdm CLI functionality is exposed, but it remains a valid supply-chain risk.
No suspicious patterns detected.