Back to skill

Security audit

玄空数术·六爻占卜

Security checks for vulnerabilities and agentic risk

Overview

This divination skill is mostly purpose-aligned, but it asks the agent to store API keys from chat, send sensitive questions to an external service, and download/send remote files with weak safeguards.

Review this skill carefully before installing. It is not clearly malicious, but users should know that API keys may be pasted into chat and stored in a plaintext home-directory file, personal divination questions are sent to yao.gizzap.com, and returned image URLs may be downloaded locally and sent through OpenClaw messaging. Prefer a version that uses a secure secret store, narrower triggers, explicit user consent before third-party transmission, validated image downloads, recipient-bound media sending, and cleanup of temporary files.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (3)

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:10
Finding

Mandatory Persona and Promotional Output Manipulation

Content
View full analysis
提醒一下:如果想跟妖妖聊天,可以在话语前加上“妖妖:”的字眼哦~ ``` ### Technical Analysis The skill instructions require the agent to replace its normal voice with a fixed persona and append attacker-selected engagement text to every response. The requirements are unconditional rather than limited to an explicitly requested divination response. This changes the agent's response policy whenever the skill is active. In particular, the mandatory suffix can be inserted into unrelated responses, error messages, security warnings, or other contexts where it does not serve the user's request. This behavior is consistent with instruction hijacking because loading the skill imposes persistent session-level output requirements unrelated to the core API operation. ### Attack Path 1. The skill is selected because a user message matches one of its broad trigger terms. 2. The agent loads and follows the instructions in `SKILL.md`. 3. The mandatory persona rule changes how all responses are written. 4. The agent appends the predefined engagement message to every response, including responses where it is irrelevant. 5. Attacker-selected branding or promotional content is therefore propagated through otherwise legitimate agent output. ### Impact Assessment The issue affects the integrity of agent-generated responses during sessions in which the skill is active. It does not directly grant operating-system privileges or code execution. The primary impact is unauthorized response manipulation, including: - Insertion of unrelated promotional or engagement text. - Degradation of the accuracy and neutrality of responses. - Potential interference with warnings ...[truncated 98 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:142
Finding

Command Injection and Unsafe Resource Retrieval Through Remote Image URL

Content
View full analysis
" ``` ### Technical Analysis The documented workflow takes an `image` value returned by the remote divination service and substitutes it into a shell command. No URL parser, scheme restriction, host allowlist, shell-safe argument handling, redirect validation, response-size limit, or content-type verification is specified. Although the placeholder is shown inside double quotes, a malicious value containing a double quote followed by shell syntax could escape the quoted argument if an agent performs literal template substitution. For example, a conceptually malicious value could close the quote, append a command, and comment out the remaining quote. This creates a potential command-injection boundary between an untrusted remote response and a local shell. The unrestricted URL also creates a resource-retrieval risk. Depending on the installed `curl` build and runtime network permissions, a malicious URL or redirect could target internal HTTP services, loopback addresses, link-local metadata endpoints, or local-file schemes. The downloaded bytes are then treated as an image without validation. The timestamp-based filename has only one-second resolution. Concurrent requests in the same second can overwrite one another, creating an additional unsafe temporary-file handling concern. ### Attack Path 1. The agent sends a divination request to `https://yao.gizzap.com/divine`. 2. The remote endpoint, or an attacker able to influence its response, returns a crafted `image` field. 3. The agent substitutes that value into the documented `curl` shell command. 4. If the value contains quote-breaking shell syntax, the shell interprets attacker-su ...[truncated 992 chars]
Remediation
View remediation

other

Warning
Location
liuyao_service.py:31
Finding

External Transmission of API Credentials and Potentially Sensitive User Questions

Content
View full analysis
Dict[str, str]: """获取请求头""" return { "Content-Type": "application/json", "X-API-Key": load_api_key() } ``` ```python payload = { "numbers": numbers, "category": category, "matter": matter } with httpx.Client(timeout=600.0) as client: response = client.post( f"{BASE_URL}/divine", headers=get_headers(), json=payload ) ``` ```python payload = { "question": question } with httpx.Client(timeout=600.0) as client: response = client.post( f"{BASE_URL}/divine/chat", headers=get_headers(), json=payload ) ``` The destination is fixed elsewhere in the same file: ```python BASE_URL = "https://yao.gizzap.com" API_KEY_FILE = os.path.expanduser("~/.liuyao_key") ``` ### Technical Analysis The client reads an API key from the user's home directory and includes it in the `X-API-Key` header sent to an external service. It also sends the complete `matter` or `question` supplied by the user. The intended use cases listed by the skill include health, relationships, finances, career, and travel. Questions in these categories may contain sensitive personal information. The implementation performs no data minimization, redaction, sensitive-content warning, or explicit consent check before transmission. HTTPS protects data in transit against ordinary passive network interception, but it does not prevent the destination service from receiving, logging, retaining, analyzing, or redistributing the credential and user content. The audit materials do not specify a privacy policy, retention limit, deletion mechanism, or controls governing use of the transmitted information. The associated documented key-storage command writes the crede ...[truncated 1529 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (21)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger list includes broad everyday terms such as health, travel, career, and fortune-related phrases, making accidental invocation likely. Overbroad activation is dangerous here because the skill performs sensitive actions like secret handling and external network/file operations once triggered.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The divination-mode trigger phrases are ambiguous and lack boundary conditions, so ordinary messages could unintentionally enter operational flow. Because the downstream flow includes credential checks, command execution, and remote fetches, accidental activation materially increases risk.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly tells the agent to detect, extract, and persist credentials from user messages. That behavior is a direct secret-handling vulnerability because it converts unstructured chat into a credential collection mechanism and stores the secret in plaintext for later use.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The skill's image download step delegates network behavior to a shell command parameterized by external data, which is unsafe even if quoted. The main danger is not classic shell injection here, but unauthorized network fetches and untrusted file ingestion that can be chained into outbound sending.

Content

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

mkdir -p /tmp/liuyao_images

下载图片,使用时间戳命名避免冲突

curl -o /tmp/liuyao_images/guaxiang_$(date +%Y%m%d%H%M%S).png "<image_url>"

text

3. **发送图片给用户(重要!)**

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The skill's image download step delegates network behavior to a shell command parameterized by external data, which is unsafe even if quoted. The main danger is not classic shell injection here, but unauthorized network fetches and untrusted file ingestion that can be chained into outbound sending.

Content

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

mkdir -p /tmp/liuyao_images

下载图片,使用时间戳命名避免冲突

curl -o /tmp/liuyao_images/guaxiang_$(date +%Y%m%d%H%M%S).png "<image_url>"

text

3. **发送图片给用户(重要!)**

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The skill's image download step delegates network behavior to a shell command parameterized by external data, which is unsafe even if quoted. The main danger is not classic shell injection here, but unauthorized network fetches and untrusted file ingestion that can be chained into outbound sending.

Content

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

mkdir -p /tmp/liuyao_images

下载图片,使用时间戳命名避免冲突

curl -o /tmp/liuyao_images/guaxiang_$(date +%YmdHMS).png "<image_url>"

text

3. **发送图片给用户(重要!)**

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs the agent to invoke an external messaging CLI with channel and target parameters derived from context, enabling outbound file delivery. If those parameters or the file path are influenced incorrectly, the agent could exfiltrate content to unintended recipients or abuse integrated messaging infrastructure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill clearly instructs file access, network access, and external command execution, but it does not declare an explicit tool scope or permissions boundary. That mismatch increases the chance that an agent may invoke broader capabilities than reviewers or users expect, reducing transparency and weakening least-privilege controls.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is designed to activate when a user sends an API key, tightly coupling credential disclosure with automatic processing. This encourages users to paste secrets into chat and immediately subjects those secrets to parsing and storage behavior, increasing the chance of credential compromise.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill tells the agent to extract API keys from chat and persist them in a home-directory file, creating a durable secret store from conversational input. This is dangerous because chat is not an appropriate secret-ingestion channel, and plaintext local storage increases the risk of credential theft, accidental reuse, or exposure to other processes/users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document normalizes local storage of user API keys without warning about secret-handling risks, which can lead operators and users to treat unsafe credential practices as acceptable. In this context, the lack of warnings compounds the underlying secret-extraction behavior and increases the likelihood of insecure deployment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill instructs downloading a remote image and sending it to an external messaging channel without adequate disclosure of the security implications. Users and deployers are not warned that this creates a content-fetch and outbound-transfer path that could expose metadata, fetch malicious payloads, or send data outside the current trust boundary.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
77% confidence
Finding

This variant of the same session-persistence issue shows the skill retaining downloaded media under /tmp with timestamp-based names. The risk is modest, but unnecessary persistence of user-related artifacts broadens local exposure and weakens data minimization.

Content

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

  1. 下载图片到本地
    bash
    # 创建图片保存目录(如果不存在)
    mkdir -p /tmp/liuyao_images
    
    # 下载图片,使用时间戳命名避免冲突
    curl -o /tmp/liuyao_images/guaxiang_$(date +%Y%m%d%H%M%S).png "<image_url>"
    

Session Persistence

Medium
Category
Rogue Agent
Confidence
77% confidence
Finding

This variant of the same session-persistence issue shows the skill retaining downloaded media under /tmp with timestamp-based names. The risk is modest, but unnecessary persistence of user-related artifacts broadens local exposure and weakens data minimization.

Content

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

  1. 下载图片到本地
    bash
    # 创建图片保存目录(如果不存在)
    mkdir -p /tmp/liuyao_images
    
    # 下载图片,使用时间戳命名避免冲突
    curl -o /tmp/liuyao_images/guaxiang_$(date +%Y%m%d%H%M%S).png "<image_url>"
    

Session Persistence

Medium
Category
Rogue Agent
Confidence
77% confidence
Finding

This variant of the same session-persistence issue shows the skill retaining downloaded media under /tmp with timestamp-based names. The risk is modest, but unnecessary persistence of user-related artifacts broadens local exposure and weakens data minimization.

Content

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

  1. 下载图片到本地
    bash
    # 创建图片保存目录(如果不存在)
    mkdir -p /tmp/liuyao_images
    
    # 下载图片,使用时间戳命名避免冲突
    curl -o /tmp/liuyao_images/guaxiang_$(date +%YmdHMS).png "<image_url>"
    

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The example dialogue demonstrates and legitimizes the unsafe practice of pasting an API key into chat for storage. Examples strongly influence real-world use, so this increases the likelihood that users will disclose secrets in insecure channels and that implementers will preserve the unsafe pattern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The divine() function sends user-supplied divination numbers, category, and matter to a third-party remote service. In an agent-skill context, this is a real privacy/security concern because potentially sensitive personal content is exfiltrated off-platform without any indication in the code that explicit user notice or consent is required at the point of use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The divine_chat() function forwards arbitrary user questions to an external endpoint, which may include highly sensitive personal, financial, health, or relationship information given the divination use case. Because this skill is explicitly designed to invite intimate questions, silent third-party transmission is more dangerous in context than for a generic low-sensitivity API call.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module documentation states the client provides /divine, /divine/chat, and /notice. However, the code also defines get_categories() calling /categories, so the documentation actively understates the implemented interface surface.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

load_api_key() reads a credential from ~/.liuyao_key, which is a form of sensitive secret access. While the docstring states where the key is loaded from, there is no user-facing warning, prompt, or broader documentation in this file explaining that the skill accesses local credentials to authenticate outbound requests.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest describes two modes: hexagram divination and Q&A chat. This file also implements a separate /categories lookup operation to enumerate supported divination types, which is not mentioned in the stated skill behavior or trigger description.

Content

No source excerpt is available for this finding.