Back to skill

Security audit

知乎草稿写手 Zhihu Draft Writer

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for drafting Zhihu answers, but its documented curl workflow can turn untrusted Zhihu or user text into shell execution if followed literally.

Install only if you are comfortable giving the skill control of a logged-in Zhihu browser session and sending selected Zhihu question/comment data to zhihuiapi. The curl request construction should be fixed before use so untrusted page text is passed via stdin, a secure request file, or a structured HTTP client rather than interpolated into shell source. Use a dedicated browser profile and review saved drafts before publishing manually.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:153
Finding

Shell Command Injection Through Untrusted JSON Interpolation

Content
View full analysis
` with the escaped JSON string, and read the API key from the `ZHIHUIAPI_KEY` environment variable: curl https://cc.zhihuiapi.top/v1/chat/completions \ -s \ -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${ZHIHUIAPI_KEY}" \ -d '{ "model": "claude-sonnet-4-6", "max_tokens": 2400, "response_format": {"type": "json_object"}, "messages": [ { "role": "system", "content": "" }, { "role": "user", "content": } ] }' ``` ### Technical Analysis The workflow requires the agent to substitute `` directly into a single-quoted shell argument passed to `curl`. The substituted object includes data originating from untrusted sources, including: - User-supplied topic keywords and writing-style instructions. - Zhihu question titles, excerpts, and URLs. - Zhihu comment text and author names. - Other externally controlled page content collected by the browser. Correct JSON escaping does not provide shell escaping. In particular, a single quote is valid inside a JSON string but terminates a single-quoted shell argument. If an untrusted value contains a single quote followed by shell syntax, the shell can interpret the remaining characters as commands rather than request data. The instruction to use an “escaped JSON string” does not define a safe shell-encoding procedure, nor ...[truncated 2287 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

The skill explicitly transmits scraped Zhihu question content, excerpts, URLs, and top comments to an external API endpoint via curl for answer generation. This creates a data-exfiltration path from the user's authenticated browsing session to a third party, with limited provenance and no user consent flow, data minimization, or trust boundary controls described.

Content

Scanner excerpt · SKILL.md (reported line 17)May include surrounding context.

md
env:
        - ZHIHUIAPI_KEY
      bins:
        - curl
---

# Zhihu Draft Writer

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs the agent to skip any comment not written in Chinese, and nearby generation rules require Chinese output. This is a language/locale restriction embedded in the skill behavior, but the file does not offer the user a language choice or clearly justify the restriction as a region-specific compliance requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instruction explicitly requires the model to answer as a Chinese-language Zhihu user, which imposes a specific language/locale on all outputs. The file does not offer opt-in, fallback, or any justification that this skill is intentionally region-specific, so it conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This JSON schema is a manifest/config-type file, so natural-language policy checks apply. The description string explicitly requires the generated answer body to be 'in Chinese', which forces a specific language without indicating user choice or a documented region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The test requires the report to show the exact Chinese string "完成草稿:1 / 1", which implies a fixed output language expectation. Because the file does not document any user opt-in or justified locale restriction, this appears to enforce a specific language and may violate language/locale policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The requirement to display the exact status string "已跳过(历史重复)" suggests the skill is expected to emit Chinese-only user-facing text. Without an explicit statement that the skill is region- or platform-specific and therefore intentionally Chinese-language, this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The default writing_style.summary is specified entirely in Chinese and describes a Zhihu-specific Chinese writing style, while the file also instructs the workflow to use defaults directly when the user provides no explicit parameters. This can force a specific language/locale choice without giving the user an option to choose another language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file documents that the skill writes and updates data/history.json, including appending entries and handling file-write failures. The checklist does not include any explicit warning to users that the skill modifies local filesystem state, which is a safety-relevant behavior for markdown under the missing-warnings rule.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.