Back to skill

Security audit

Openclaw Skill

Security checks for vulnerabilities and agentic risk

Overview

This writing skill uses a hosted service and includes under-scoped account, email, command, and file-write behavior that should be reviewed before installation.

Install only if you are comfortable sharing your email address and writing topics with prose-kit.com. Before use, the skill should require explicit consent for registration/network calls and replace the raw shell/Python snippets with a safer implementation that escapes inputs, validates API responses, and confines output files to the intended directory.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:24
Finding

Command and Python Code Injection Through Unsafe Value Interpolation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:24-56
Vulnerability Type: Command injection and Python source injection
Risk Level: High

The Skill instructs the agent to substitute user-controlled email and topic values directly into shell commands. It also inserts the topic and an API-provided task identifier directly into a Python program executed through python3 -c.

bash
curl -s -X POST https://prose-kit.com/v1/register \
  -H "Content-Type: application/json" \
  -d '{"email": "{用户的邮箱}"}'
bash
curl -s -X POST https://prose-kit.com/v1/generate \
  -H "Authorization: Bearer $PROSE_KIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"topic": "{用户的主题}", "with_scoring": false}'
bash
python3 -c "
import json, time, urllib.request, os

task_id = '{task_id}'
api_key = os.environ['PROSE_KIT_API_KEY']
topic = '{topic}'

Technical Analysis

The documented workflow relies on textual substitution rather than passing values through a non-executable data channel.

In the curl examples, an attacker can include shell metacharacters and quote characters in the email or topic. A single quote can terminate the JSON argument, after which additional shell syntax may be interpreted by the shell.

The polling script is additionally vulnerable because both {topic} and {task_id} are embedded inside single-quoted Python string literals within a double-quoted shell argument. Crafted values can terminate either the Python literal or the surrounding shell command. The topic is directly controlled by the user, while the task identifier is controlled by the external API response.

JSON escaping alone would not fully address the Python command issue because values must also be protected from the shell and Python parser. Untrusted data should never be inserted into generated executable source.

Attack Path

  1. An attacker supplies a writing topic or registration email co ...[truncated 1119 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not construct shell commands or Python source code through textual replacement.
  • Implement the workflow as a fixed script and pass the email, topic, and task identifier through command-line arguments or environment variables.
  • Construct request bodies with json.dumps() rather than manually assembling JSON:
    python
    payload = json.dumps({
        "topic": topic,
        "with_scoring": with_scoring,
    }).encode("utf-8")
    
  • Use subprocess.run() with an argument array and shell=False if an external command is required.
  • Prefer a Python HTTP client or urllib.request so that no shell is involved.
  • Validate API task identifiers against a restrictive expected format, such as an allowlist of ASCII letters, digits, hyphens, and underscores.
  • Apply reasonable length limits to email and topic values.
  • Treat server responses as untrusted even when received over HTTPS.
  • Avoid placing the API key in command-line arguments, logs, generated files, or error messages.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:72
Finding

Path Traversal and File Overwrite Through Unsanitized Output Names

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:72-79
Vulnerability Type: Path traversal and arbitrary relative file write
Risk Level: Medium

The output filename is constructed from the user-controlled topic and the API-controlled seed_type field without sanitization or containment validation.

python
os.makedirs('prose-kit-output', exist_ok=True)
essays = data.get('essays', [])
summary = []
for i, e in enumerate(essays):
    slug = e.get('seed_type', f'v{i+1}')
    fname = f'prose-kit-output/{topic}-{slug}.md'
    with open(fname, 'w') as f:
        f.write(e.get('markdown', e.get('content', '')))

Technical Analysis

Both topic and slug are incorporated directly into a filesystem path. Values containing absolute-path syntax, directory separators, or .. traversal components can cause the resolved pathname to leave prose-kit-output.

The call to open(fname, 'w') creates the destination file if it does not exist and truncates it if it already exists. No canonicalization, basename conversion, safe slug generation, or post-resolution containment check is performed.

The user directly controls the topic, and the remote service controls both seed_type and the content written to disk. Consequently, either a malicious input or a compromised service could influence the write destination.

Attack Path

  1. An attacker provides a topic containing traversal components, or the external API returns a malicious seed_type.
  2. The value is concatenated with prose-kit-output/ to produce fname.
  3. The operating system resolves embedded .. components or directory separators.
  4. The resulting path escapes the intended output directory.
  5. open(..., 'w') creates or truncates the selected writable file.
  6. API-provided essay content is written to that location.

Exploitation remains subject to operating-system permissions and to the filename suffix introduced by the template, but ...[truncated 433 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not use the raw topic or API-provided seed_type as a filename.
  • Generate local filenames from trusted identifiers, such as a sequential number or a random UUID.
  • If descriptive names are required, normalize them to a strict allowlist such as ASCII letters, digits, hyphens, and underscores.
  • Remove directory separators, traversal components, control characters, and platform-specific reserved characters.
  • Resolve and verify every destination before writing:
    python
    from pathlib import Path
    
    output_dir = Path("prose-kit-output").resolve()
    output_dir.mkdir(parents=True, exist_ok=True)
    
    destination = (output_dir / safe_filename).resolve()
    if output_dir not in destination.parents:
        raise ValueError("Output path escapes the designated directory")
    
  • Use exclusive file creation where overwriting is unnecessary, or explicitly require confirmation before replacing an existing file.
  • Treat all fields returned by the external API as untrusted input.
  • Apply filename length limits to prevent filesystem errors and denial-of-service conditions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill is presented as a prose-generation tool, but its documented behavior includes account creation, usage inspection, pricing, and payment upgrade flows. That mismatch increases the chance that users and reviewers underestimate the operational scope and permit actions involving external services, billing, and account state changes that are outside the declared core purpose.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrase includes ordinary language such as asking to write prose about a topic, which can match normal conversation and invoke the skill unexpectedly. Because this skill can contact external services and request personal data, broad triggering raises the risk of accidental activation and unintended data transmission.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs the agent to collect a user's email and create an external account as part of normal execution, even though account registration is not necessary to explain or draft prose locally. This expands data collection and causes the agent to initiate an external identity-linked action on the user's behalf without an explicit warning about privacy, consent, or trust in the third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions tell the agent to ask for the user's email and send it to a remote registration API, but they do not require a clear warning that personal data will leave the local environment. This is dangerous because users may provide contact information without informed consent, and the agent would facilitate third-party data collection under the guise of a writing tool.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

This command performs external transmission of the user's email to a third-party registration endpoint. In context, the transmission is more dangerous because it is tied to account creation for a service not essential to the skill's stated purpose, and it lacks explicit safeguards around consent, data handling, or verification of the remote service.

Content

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

如果不存在,问用户要邮箱,帮他注册:

bash
curl -s -X POST https://prose-kit.com/v1/register \
  -H "Content-Type: application/json" \
  -d '{"email": "{用户的邮箱}"}'