T09 · Insecure Skill Coding Practices
- Location
run.py:199- Finding
OS Command Injection in the Automatic Publishing Flow
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill mostly matches a social-content creation purpose, but it can publish to Xiaohongshu and contains unsafe command and TLS handling that need review before installation.
Review this skill carefully before installing. Use it only if you are comfortable sending topic queries to Jina services and potentially publishing to a linked Xiaohongshu account. Do not enable auto-publish until the shell=True publishing path, disabled TLS verification, and missing final confirmation are fixed.
run.py:199OS Command Injection in the Automatic Publishing Flow
run.py:15HTTPS Certificate and Hostname Verification Disabled
The README describes a materially different behavior from the skill metadata: instead of finding same-day real hot topics, it presents an evergreen tips/content-generation workflow. This mismatch can mislead users and reviewers about what the skill actually does, undermining informed consent and making it harder to assess downstream posting or scraping behavior.
The README explicitly says v3.0 no longer produces hot-topic summaries, which directly contradicts the manifest's stated purpose of searching real daily hot topics. Such contradiction is dangerous because it obscures the skill's true operational scope and can conceal data flow or automation risks from users enabling the tool.
The documented purpose materially understates the skill's behavior: it performs undeclared external network requests, writes local files, and can trigger external publishing through a subprocess/tool, while also overstating its verification of 'real same-day hot topics.' This combination is dangerous because users may consent to a content-generation workflow without realizing it can exfiltrate data externally, persist artifacts locally, or post to external accounts automatically.
The manifest explicitly advertises automatic publishing but does not disclose user-facing safeguards, consent prompts, draft mode, or account-impact warnings. In the context of a skill connected to the xiaohongshu MCP, this creates a real risk of unintended posts, reputational harm, spam, or misuse of a linked social-media account if the skill is triggered accidentally or behaves unexpectedly.
This is a true tool-parameter abuse issue because untrusted content is serialized into a shell command that invokes a privileged publishing action. Since the skill can auto-publish externally, a crafted topic/title/content could manipulate the shell command or the downstream tool invocation, causing unintended publication, command execution, or abuse of the connected platform.
cmd = f"mcporter call 'xiaohongshu.publish_content(title: \"{title}\", content: \"{safe_content}\", images: {json.dumps(images)})'"
try:
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=90)
if result.stdout and ('成功' in result.stdout or 'Success' in result.stdout):
print(f"✅ 发布成功:{result.stdout}")
return {"status": "success", "message": result.stdout}
The README advertises automatic publishing to Xiaohongshu via an auto-publish flag, but it does not prominently warn that enabling it may post content to an external public platform. Users may trigger unintended public disclosure, account actions, or reputational impact without fully understanding the consequence.
The documented workflow focuses on scraping webpages for practical tips and generating structured content, not on selecting and elaborating a current hot topic as advertised in metadata. This inconsistency increases the chance of users authorizing actions under false assumptions about what sources are queried and what content is produced.
The skill metadata does not declare any tool restrictions even though the skill behavior requires network access, local file writes, and shell/subprocess execution. This weakens least-privilege controls and prevents users or the platform from understanding and constraining what the skill can do before execution.
The skill advertises automatic publishing but does not warn that it may post content to a user's external account or describe the consequences of incorrect, low-quality, or unintended posts. In this context, that omission is risky because the skill is designed to generate topical content from web results and then publish it, creating account-integrity, reputational, and compliance risks if output is wrong or manipulated.
The trigger phrases are generic enough to match ordinary content-generation requests, increasing the chance that the skill activates when the user did not explicitly intend to use this specific workflow. In this skill, unintended activation is more dangerous because the declared behavior includes searching live topics and proceeding toward automated publishing, which can cause account-impacting actions from an ambiguous prompt.
Natural-language strings throughout the file, including the main docstring and CLI output, are exclusively in Chinese with no language-selection mechanism. This can violate language/locale policy when the skill imposes one language without offering the user an explicit choice.
The skill sends user-provided queries and URLs to external Jina services without explicit disclosure or consent, creating a data-exposure risk. In this skill context, keywords/topics may reveal user interests, campaign plans, or unpublished content strategy, and outbound transmission to third parties can violate privacy or organizational policy.
The manifest and module docstring say the skill searches for '当天真实热门话题' and then does deep creation on one selected topic. In practice, the code only collects titles from Jina search results (L249-L257) and never uses the page-reading function defined at L037-L048, so the 'deep' article is templated text based on a title string rather than sourced topic content.
The code builds a shell command with untrusted values (title, content, and potentially user-controlled topic/keyword data) and executes it with subprocess.run(..., shell=True). Escaping only double quotes and newlines is insufficient because shell metacharacters and quote-breaking payloads can still alter the command, leading to command injection or malformed tool invocations.
cmd = f"mcporter call 'xiaohongshu.publish_content(title: \"{title}\", content: \"{safe_content}\", images: {json.dumps(images)})'"
try:
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=90)
if result.stdout and ('成功' in result.stdout or 'Success' in result.stdout):
print(f"✅ 发布成功:{result.stdout}")
return {"status": "success", "message": result.stdout}
This code saves generated content to /home/admin/openclaw/workspace/temp/... using open(..., 'w'), which creates or overwrites a file. Although it prints a message after saving, there is no advance warning, confirmation prompt, or earlier disclosure in the file docstring that the skill will write user-visible output to disk.
The README says webpages are read through Jina Reader but does not clearly disclose that URLs and fetched content may be sent to an external network service. This can expose user-selected targets, browsing intent, or third-party content to an outside provider without adequate notice.
Natural-language fields such as the display name, description, triggers, and examples are all Chinese-only, with no indication that users may choose another language or that the skill is restricted to a Chinese-language audience for a documented reason. This can conflict with organizational language-choice policies when no opt-in or justification is provided.
The inline documentation for fetch_jina_read states it reads webpage content, suggesting the workflow will consume source material for topic creation. However, main() never calls this function and the produced article is generated entirely from templates, creating an intent/documentation mismatch about how content is derived.