T09 · Insecure Skill Coding Practices
- Location
scripts/init_collection_run.py:193- Finding
Output-root escape through an unsanitized run name
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s arXiv collection workflow is coherent, but unsafe path handling can let crafted inputs read or write files outside the intended collection folder.
Review before installing or running. Use only trusted run names, query labels, selection JSON, and cached query-result files; keep output roots in a dedicated disposable directory; avoid running it where overwriteable important JSON or Markdown files are nearby. The package does not show credential theft or deceptive behavior, but the path traversal bugs should be fixed before use in shared or untrusted workflows.
scripts/init_collection_run.py:193Output-root escape through an unsanitized run name
scripts/fetch_query_metadata.py:523Query-label path traversal permits writes outside the query-results directory
scripts/merge_selected_papers.py:391Selection labels allow unintended JSON reads outside query-results
scripts/merge_selected_papers.py:454Insufficient arXiv ID validation allows paper-directory traversal
The skill instructs the agent to run local Python scripts, read and write files under arbitrary paths, and make network calls to the arXiv API, but it declares no explicit tool scope or permission boundaries. Without an allowlist such as permissions or allowed-tools, an integrating agent may grant broader shell, filesystem, and network access than necessary, increasing the blast radius if the skill is misused, modified, or prompt-injected through surrounding workflow context.
This markdown file documents that repeated merge runs will remove previously generated paper directories when they are no longer selected. Because this is a destructive file operation affecting stored outputs, the skill description should clearly warn users that rerunning or changing selections can delete prior artifacts.
The code sets default_language to params.language if present, otherwise falls back to the literal value "English". This is a natural-language locale policy issue because it forces a specific language by default rather than prompting for or preserving user choice.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if args.print_commands:
print(f"[CMD {idx}/{query_count}] " + " ".join(shlex.quote(x) for x in cmd))
proc = subprocess.run(cmd, text=True, capture_output=True)
parsed = parse_last_json_block(proc.stdout)
entry: dict[str, Any] = {
The normalize_language function maps a small set of Chinese identifiers to "zh" and returns "en" for all other values. This creates a forced language policy in which unsupported or unexpected user locale inputs are silently coerced to English without explicit user opt-in or choice.
The language normalization logic maps only a small set of Chinese identifiers to 'zh' and defaults every other value to 'en'. This means a user-supplied language such as French, Spanish, or another locale is silently overridden to English, which is a natural-language policy concern because it imposes a language choice without explicit opt-in.
The language normalization logic maps several Chinese variants to 'zh' and defaults every other input to 'en'. This enforces an English output locale for unspecified or unsupported languages rather than preserving user choice or clearly documenting that only English and Chinese are supported.
The script captures full stdout/stderr from each subprocess and embeds them in the final JSON summary, which may disclose sensitive query terms, local paths, API/debug output, or downstream script data to logs or calling systems. In an agent workflow that may persist or surface run artifacts automatically, this creates an information exposure risk even if the data is not secret by design.
No suspicious patterns detected.