T09 · Insecure Skill Coding Practices
- Location
scripts/update-papers.py:92- Finding
Shell Command Injection Through Untrusted Paper Metadata
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a coherent paper-portal purpose, but its scheduled paper-ingestion script can execute shell commands from untrusted paper metadata.
Review before installing. Run the scripts only under a dedicated low-privilege account, do not schedule them until the shell=True LLM invocation is fixed, and use a trusted local or protected ComfyUI endpoint. The website template should also validate paper URLs and render paper fields as text before serving data from external paper sources.
scripts/update-papers.py:92Shell Command Injection Through Untrusted Paper Metadata
assets/index.html:438Stored DOM-Based Cross-Site Scripting and Unsafe Link Injection
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
from_date = (datetime.now() - timedelta(days=30)).strftime("%Y-%m-%d")
url = f"{OPENALEX_BASE}/works?search={kw}&filter=from_publication_date:{from_date}&sort=cited_by_count:desc&per_page={max_results}"
resp = requests.get(url, headers=headers, timeout=30)
data = resp.json()
for work in data.get("results", []):
This mismatch is security-relevant because the skill text proposes external shell invocation for LLM processing while the description does not clearly disclose that command execution behavior. Hidden or under-disclosed shell execution increases the chance that users approve the skill for content aggregation without realizing it can run commands on the host.
This mismatch is security-relevant because the skill text proposes external shell invocation for LLM processing while the description does not clearly disclose that command execution behavior. Hidden or under-disclosed shell execution increases the chance that users approve the skill for content aggregation without realizing it can run commands on the host.
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
API.md - OpenAlex/arXiv API 使用说明COMFYUI.md - ComfyUI Flux2 工作流说明使用 OpenClaw cron 或系统 crontab:
# OpenClaw cron
openclaw cron add --name "论文更新" --schedule "0 5 * * *" --script "update-papers.py"
openclaw cron add --name "网站发布" --schedule "0 8 * * *" --script "daily-publish.py"
# 或系统 crontab
0 5 * * * python /path/to/update-papers.py
0 8 * * * python /path/to/daily-publish.py
paper-index.json 和 pending-papers.json| 问题 | 解决方案 |
|---|---|
| 论文数据为空 | 检查关键词拼写,确认 API 可访问 |
| 图片生成失败 | 检查 ComfyUI 服务状态,确认模 |
The subprocess call permits tool-parameter abuse because llm_command is concatenated into a shell command and executed with shell=True. If llm_command is ever influenced by configuration, future refactoring, or upstream input, an attacker could replace the intended LLM invocation with arbitrary commands; combined with untrusted prompt content, the execution surface is especially dangerous in this content-ingestion script.
概述:xxx"""
try:
result = subprocess.run(
f'{llm_command} "{prompt}"',
shell=True,
capture_output=True,
The skill document describes capabilities that involve shell execution, filesystem modification, network access, and scheduled tasks, but it does not declare any explicit tool scope or permissions. That creates a transparency and least-privilege problem: an operator or runtime may allow broader access than users expect, increasing the risk of unintended command execution or server changes.
Broad trigger phrases can cause unintended activation for generic academic website requests, leading the agent to perform deployment-oriented actions when the user only wanted advice or content. In a skill that can write files, call networks, and configure publishing workflows, accidental invocation materially increases risk.
The skill instructs deployment, web server configuration, and scheduled publishing but does not prominently warn that it will modify system state on the user's server. This is dangerous because users may invoke it expecting content help, not realizing it can alter server configuration and establish recurring automated tasks.
The document root sets lang="zh-CN", and the UI text throughout the page is Chinese-only, which imposes a specific language/locale on all users. Under the policy criteria, this is a natural-language locale restriction without visible opt-in or explanation that the skill is region-specific.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
url = "https://api.openalex.org/works"
params = {
"search": "thermoelectric",
"sort": "cited_by_count:desc",
The file's headings and instructional content are all presented in Chinese, and there is no indication that the skill supports other languages or that Chinese-only output is an intentional, justified locale constraint. This can violate language/locale policy when a specific language is effectively forced without user opt-in.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
response = requests.post(url, json={"prompt": workflow}) prompt_id = response.json()["prompt_id"]
This file presents all operational instructions and troubleshooting guidance exclusively in Chinese. Under the policy rule for language/locale, forcing a specific language without user opt-in or a documented justification is a natural-language policy violation.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
# 编辑 crontab
crontab -e
# 添加任务
0 5 * * * /usr/bin/python3 /path/to/update-papers.py
This code file contains natural-language strings entirely in Chinese, including the module docstring and runtime status messages, with no indication that the skill is region-specific or that users can opt into the locale. Under the policy rules, forcing a specific language without user choice is a natural-language policy violation.
The file-level natural-language description and user-facing messages are entirely in Chinese, which imposes a specific language/locale without any opt-in or documented regional justification. This matches the policy concern for language or locale constraints that are not optional.
The script sends generated prompts and workflow data to an external ComfyUI server over HTTP, which can expose research metadata and image-generation content to a remote service. Because the default URL uses plain HTTP and there is no authentication, transport security, or host validation, a misconfigured or non-local server could leak data or be intercepted on the network.
def submit_task(workflow):
"""提交工作流到 ComfyUI"""
try:
resp = requests.post(f"{COMFYUI_URL}/prompt", json={"prompt": workflow}, timeout=30)
data = resp.json()
return data.get("prompt_id")
except Exception as e:
The manifest describes collecting papers, generating AI background images, and publishing a portal site; invoking arbitrary shell commands via subprocess with shell=True introduces a general command-execution capability unrelated to simple paper aggregation. While LLM-based enrichment may fit the product goal, implementing it as shell execution grants a much broader capability than the skill's stated purpose requires.
The function builds a prompt from paper metadata and excerpt text, then invokes an external CLI via subprocess, which may transmit that content to a remote LLM service. Although the code comments say it uses an LLM for translation, there is no explicit warning about sending fetched content outside the local process or any confirmation step before doing so.
The natural-language prompt explicitly requires a Chinese title and summary, and the script stores the result in Chinese-specific fields. There is no option for the user to choose another language or opt in to the locale constraint, which matches the policy's language/locale violation criteria.
The code builds a shell command from a dynamic prompt and executes it with shell=True. Because paper titles and abstracts come from external APIs and are inserted directly into the command string, shell metacharacters or quotes in that content can break out of the intended argument and trigger arbitrary command execution on the host.
概述:xxx"""
try:
result = subprocess.run(
f'{llm_command} "{prompt}"',
shell=True,
capture_output=True,
该文档全文以中文呈现,标题和说明均未提供可选语言、双语说明或对语言限制的合理化说明。根据语言/locale 政策,若技能内容强制单一语言而无用户选择或明确理由,属于自然语言层面的政策风险。
The documentation shows code that downloads image data and writes it directly to output.png. In this markdown file, there is no accompanying warning that running the example will create or overwrite a local file, which is a user-data-impacting behavior covered by the missing-warnings rule for markdown files.
The script reads and then overwrites paper-index.json, writes generated image files under assets/images, and deletes temporary PNG files. Although there are progress prints, there is no explicit user-facing warning or confirmation that metadata will be changed and files will be created and removed on disk.