Back to skill

Security audit

Yinian Zwds

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its astrology-chart purpose, but it can silently use shared API credentials and send sensitive birth-chart data to DeepSeek without clear user consent.

Install only if you are comfortable providing birth details for astrology use and with remote AI interpretation through DeepSeek. Use a dedicated DeepSeek key rather than a shared OpenClaw or OpenAI key, avoid running the AI paths until the provider/credential handling is fixed, and patch the web dependencies before exposing the web app publicly.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ai_engine.py:29
Finding

OpenAI API credentials may be transmitted to the DeepSeek endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_engine.py:29-59, 75-108
Vulnerability Type: Cross-provider credential disclosure
Risk Level: Critical

Vulnerable Code

python
def _resolve_api_key():
    """解析API Key,优先DeepSeek"""
    # 1. DeepSeek环境变量
    ds_env = os.environ.get("DEEPSEEK_API_KEY", "")
    if ds_env:
        return ds_env
    
    # 2. OpenClaw配置中的DeepSeek Key
    _cfg_path = os.path.expanduser("~/.openclaw/openclaw.json")
    if os.path.exists(_cfg_path):
        try:
            with open(_cfg_path) as _f:
                _cfg = json.load(_f)
            _providers = _cfg.get("models", {}).get("providers", {})
            _key = _providers.get("deepseek", {}).get("apiKey", "")
            if _key:
                return _key
        except:
            pass
    
    # 3. 降级到OpenAI(但仅当key不是sk-proj-格式时才用)
    oa_env = os.environ.get("OPENAI_API_KEY", "")
    if oa_env and not oa_env.startswith("sk-proj-"):
        return oa_env
    
    return ""

AI_API_KEY = _resolve_api_key()
AI_BASE_URL = "https://api.deepseek.com/v1"
AI_MODEL = "deepseek-chat"
python
api_key = AI_API_KEY
base_url = AI_BASE_URL
model = AI_MODEL

if not api_key:
    return "⚠️ 未找到AI API Key,请配置 DEEPSEEK_API_KEY 或 OPENAI_API_KEY"

if "deepseek" in model:
    system_prompt = system_prompt.replace("【", "<").replace("】", ">")

payload = {
    "model": model,
    "messages": [
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": user_prompt},
    ],
    "temperature": temperature,
    "max_tokens": max_tokens,
}

data = json.dumps(payload).encode("utf-8")
req = urllib.request.Request(
    f"{base_url}/chat/completions",
    data=data,
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {api_key}",
    },
    method="POST",
)

try:
 
...[truncated 2015 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove the OPENAI_API_KEY fallback unless the request is also switched to the official OpenAI endpoint and a compatible OpenAI model.
  • Resolve provider configuration as an inseparable structure containing:
    • provider name;
    • API key;
    • base URL;
    • model name.
  • Reject configurations in which the selected credential type does not match the selected endpoint.
  • Prefer an explicit provider setting rather than inferring the provider from available secrets.
  • Use separate functions or typed configuration objects for DeepSeek and OpenAI requests.
  • Add tests confirming that OpenAI credentials can never appear in requests to DeepSeek domains.
  • Rotate any OpenAI key that may already have been processed by this implementation.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/ai_engine.py:35
Finding

The Skill automatically reads a shared OpenClaw credential store

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_engine.py:35-45
Vulnerability Type: Undeclared access to credentials outside the Skill boundary
Risk Level: Medium

Vulnerable Code

python
_cfg_path = os.path.expanduser("~/.openclaw/openclaw.json")
if os.path.exists(_cfg_path):
    try:
        with open(_cfg_path) as _f:
            _cfg = json.load(_f)
        _providers = _cfg.get("models", {}).get("providers", {})
        _key = _providers.get("deepseek", {}).get("apiKey", "")
        if _key:
            return _key
    except:
        pass

Technical Analysis

Importing scripts/ai_engine.py initializes AI_API_KEY by calling _resolve_api_key(). That function automatically opens the user-level ~/.openclaw/openclaw.json file and extracts a shared DeepSeek provider credential.

This access is not documented in SKILL.md, and the user is not asked to authorize reuse of a credential stored in the broader Agent configuration. The Skill's local chart-calculation functionality does not require access to this file. External AI interpretation may require a provider credential, but least privilege calls for a dedicated, explicitly supplied secret rather than silent access to a shared configuration store.

The broad exception handler also suppresses malformed-file and permission errors, making this behavior less visible during operation and review.

Attack Path

  1. A caller imports or executes scripts/ai_engine.py.
  2. Module initialization invokes _resolve_api_key().
  3. The function checks for ~/.openclaw/openclaw.json.
  4. If present and readable, the Skill parses the shared Agent configuration.
  5. It extracts the DeepSeek API key and retains it in the module-level AI_API_KEY variable.
  6. Subsequent AI calls use that credential without a separate user authorization step.

Impact Assessment

The Skill obtains access to a provider credential outside its own ...[truncated 472 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove automatic access to ~/.openclaw/openclaw.json.
  • Require a dedicated, Skill-scoped credential supplied through an explicit configuration field or narrowly scoped environment variable.
  • Ask for explicit authorization before using a shared Agent credential.
  • Resolve credentials only when the user requests external AI interpretation, not during module import.
  • Keep local chart calculation available without any credential or network permission.
  • Document the required provider, credential source, endpoint, and data-processing behavior in SKILL.md.
  • Replace the broad except: clause with specific exception handling and safe diagnostic messages that never include secret values.
  • Apply provider-side quota limits and use a restricted API key where the provider supports such controls.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ai_engine.py:142
Finding

Sensitive birth-chart data is sent to DeepSeek without explicit disclosure or opt-in consent

Content
View full analysis

Vulnerability Details

File Location: scripts/ai_engine.py:142-150, 89-108; related prompt construction in scripts/prompts.py:256-259
Vulnerability Type: Undisclosed external transmission of personal-profile data
Risk Level: Medium

Vulnerable Code

python
result = generate_standard_report(
    date_str, hour, gender, is_lunar, target_year, model_type="deepseek"
)
if not result["success"]:
    return {"success": False, "error": result.get("error", "排盘失败")}

system_prompt = result["system_prompt"]
user_prompt = result["ai_prompt"]

ai_raw = call_llm(system_prompt, user_prompt)
python
fp = chart_data.get("four_pillars", {})
lines.append(f"📅 命主:{fp.get('year', '')} {fp.get('month', '')} {fp.get('day', '')} {fp.get('hour', '')}")
lines.append(f"🐉 生肖:{chart_data.get('zodiac', '')} 五行:{chart_data.get('five_elements', '')}")
lines.append(f"🏠 命宫:{chart_data.get('palaces', [{}])[0].get('name_cn', '')}")
lines.append("")
python
payload = {
    "model": model,
    "messages": [
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": user_prompt},
    ],
    "temperature": temperature,
    "max_tokens": max_tokens,
}

data = json.dumps(payload).encode("utf-8")
req = urllib.request.Request(
    f"{base_url}/chat/completions",
    data=data,
    headers={
        "Content-Type": "application/json",
        "Authorization": f"Bearer {api_key}",
    },
    method="POST",
)

try:
    with urllib.request.urlopen(req, timeout=120) as resp:
        result = json.loads(resp.read().decode("utf-8"))
        content = result["choices"][0]["message"]["content"]
        return content
except Exception as e:
    return f"⚠️ AI调用失败: {str(e)}"

Technical Analysis

The Skill collects birth date, birth hour, and gender, computes a detailed astrological chart, and embeds derived birth pillars, zodiac, element ...[truncated 2072 chars]

Remediation
View remediation

Remediation Suggestions

  • Present a clear consent prompt before the first external AI request.
  • Explicitly identify DeepSeek as the recipient and list the transmitted data categories.
  • Make local-only chart generation the default behavior.
  • Provide a separate, clearly labeled action for third-party AI interpretation.
  • Send only the minimum chart attributes required for interpretation; omit exact source birth data where derived chart values are sufficient.
  • Document applicable third-party logging, retention, regional processing, and deletion policies.
  • Avoid logging prompts, request bodies, or birth details in application and reverse-proxy logs.
  • Add a configurable provider abstraction so administrators can select an approved processor or disable external processing entirely.
  • Update SKILL.md and ETHICS.md so the privacy statement covers external transmission, not merely local persistence.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (62)

Known Vulnerable Dependency: next==15.5.15 — 16 advisory(ies): CVE-2026-44575 (Next.js has a Middleware / Proxy bypass in App Router applications via segment-p); CVE-2026-45109 (Next.js has a Middleware / Proxy bypass in App Router applications via segment-p); GHSA-2xp9-vwfh-vxw4 (Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AV) +13 more

Critical
Category
Supply Chain
Confidence
93% confidence
Finding

The project depends on Next.js 15.5.15, and the listed advisories include middleware/proxy bypasses and a potentially critical Image Optimization API issue. Because this skill is a web application, framework-level vulnerabilities are highly relevant: if affected features are enabled, an attacker could bypass request handling protections, access unintended routes, or potentially achieve more severe compromise depending on deployment configuration.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: next==15.5.15 — 16 advisory(ies): CVE-2026-44575 (Next.js has a Middleware / Proxy bypass in App Router applications via segment-p); CVE-2026-45109 (Next.js has a Middleware / Proxy bypass in App Router applications via segment-p); GHSA-2xp9-vwfh-vxw4 (Next.js: Unauthenticated Remote Code Execution in Image Optimization API when AV) +13 more

Critical
Category
Supply Chain
Confidence
98% confidence
Finding

The manifest resolves Next.js to a version identified by the scanner as having multiple published advisories, including middleware/proxy bypass issues and potential unauthenticated remote code execution in the Image Optimization API. In a web-facing Next.js application, these flaws can directly affect request handling and server-side functionality, making compromise of confidentiality, integrity, or availability plausible if the vulnerable features are exposed.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Claiming a domain-specific astrology skill while shipping only framework configuration or unrelated code undermines security review and user trust. The danger is contextual here because the skill also solicits sensitive birth data; users may disclose that information believing it is processed locally for charting, while the actual implementation may do something entirely different.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Claiming a domain-specific astrology skill while shipping only framework configuration or unrelated code undermines security review and user trust. The danger is contextual here because the skill also solicits sensitive birth data; users may disclose that information believing it is processed locally for charting, while the actual implementation may do something entirely different.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claiming a domain-specific astrology skill while shipping only framework configuration or unrelated code undermines security review and user trust. The danger is contextual here because the skill also solicits sensitive birth data; users may disclose that information believing it is processed locally for charting, while the actual implementation may do something entirely different.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Claiming a domain-specific astrology skill while shipping only framework configuration or unrelated code undermines security review and user trust. The danger is contextual here because the skill also solicits sensitive birth data; users may disclose that information believing it is processed locally for charting, while the actual implementation may do something entirely different.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/prompts.py (reported line 344)May include surrounding context.

python
pass  # 默认格式就适合
    # Claude默认格式即Markdown最优
    
    return prompt


if __name__ == "__main__":

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
91% confidence
Finding

The handler returns the raw output of read_astrolabe(chart_json) directly to the user, which appears to be an AI prompt rather than a finalized, constrained response. Exposing internal prompts can leak hidden system instructions, chain-of-thought-style scaffolding, implementation details, or prompt templates that make downstream prompt injection and model manipulation easier.

Content

Scanner excerpt · scripts/tg_bot_handler.py (reported line 244)May include surrounding context.

python
return "❌ 请先排盘(/zwds),再使用 /read 解盘"
    
    prompt = read_astrolabe(chart_json)
    return prompt


def handle_star_command(star_name: str) -> str:

Known Vulnerable Dependency: nanoid==3.3.11 — 3 advisory(ies): CVE-2026-67214 (nanoid: non-secure generators can loop indefinitely with negative size); CVE-2026-67213 (nanoid: custom generators can loop indefinitely when size is zero); CVE-2026-73086 (nanoid: Integer Overflow or Wraparound)

High
Category
Supply Chain
Confidence
82% confidence
Finding

The lockfile pins nanoid 3.3.11, and the cited advisories describe denial-of-service style failure modes such as infinite loops or integer wraparound in specific generator/size usage patterns. This is a real supply-chain risk, but from the lockfile alone there is no evidence the vulnerable code paths are directly exposed to untrusted input in this skill, so impact is lower than the package-level advisory severity suggests.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: postcss==8.4.31 — 4 advisory(ies): CVE-2026-45623 (PostCSS: Arbitrary file read and information disclosure via attacker-controlled ); CVE-2026-69153 (PostCSS: incomplete fix of GHSA-6g55-p6wh-862q — attacker-controlled sourceMappi); CVE-2026-41305 (PostCSS has XSS via Unescaped </style> in its CSS Stringify Output) +1 more

High
Category
Supply Chain
Confidence
88% confidence
Finding

The lockfile includes postcss 8.4.31, which is associated with advisories for arbitrary file read, incomplete source map fixes, and XSS in CSS stringify output. In a Next.js web stack this is plausibly reachable during build or styling flows, especially if attacker-influenced CSS, source maps, or style content can be processed, though exploitability depends on actual application behavior.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: sharp==0.34.5 — 2 advisory(ies): GHSA-f88m-g3jw-g9cj (sharp inherited vulnerabilities in libvips: CVE-2026-33327, CVE-2026-33328, CVE-); GHSA-rgj7-g3m4-5g8c (sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545)

High
Category
Supply Chain
Confidence
84% confidence
Finding

The application includes sharp 0.34.5, and the advisories indicate inherited vulnerabilities from native image-processing libraries such as libvips/libheif. In a web app, image parsing libraries can become attack surfaces when processing attacker-supplied files, potentially leading to denial of service, memory corruption, or information disclosure depending on the underlying flaw and runtime usage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The title and the rest of the document are entirely in Chinese, and the file does not indicate that users may choose another language or that the skill is intentionally limited to Chinese-speaking users. Under the stated policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill documentation instructs use of an execution tool to run a local Python script, yet the skill declares no explicit tool scope or permission boundary. When executable behavior exists without clear allowed-tools/permissions, the host may expose broader environment or network capabilities than users expect, increasing the risk of unintended command execution, data access, or outbound communication.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Overly broad trigger keywords can cause accidental invocation in ordinary conversation, leading the skill to activate when the user did not intend it. In this skill, accidental activation is more concerning because it may prompt for sensitive birth date, time, and gender information or steer the interaction into script execution unnecessarily.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill requests full birth date, birth time, and gender, which are sensitive personal attributes, without a clear upfront privacy warning at the point of collection. This creates unnecessary privacy risk because users may not understand the sensitivity, retention expectations, or whether the data will be processed by scripts or external systems.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill file is written in Chinese and does not indicate that the user may choose another language or that the content is intentionally limited to a Chinese-speaking audience. Under the policy, a skill that effectively forces a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language content throughout the file, including module description, prompts, system messages, and user-facing output strings, is fixed in Chinese. This enforces a specific language/locale without any opt-in or documented justification, which matches the policy-violation category.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code retrieves API credentials from both environment variables and a user-local OpenClaw config file, expanding its access to secrets beyond what an astrology skill strictly needs to expose in its public behavior. While this is likely intended to support LLM access, reading credentials from an undisclosed local file creates unnecessary secret reach and can surprise users or platform operators about what local data the skill inspects.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The code is hard-wired to transmit data to an external DeepSeek API endpoint, which introduces a real data egress channel. In this skill’s context, that matters because the transmitted content includes personal birth information and generated interpretations, increasing privacy exposure if users are not clearly informed.

Content

Scanner excerpt · scripts/ai_engine.py (reported line 58)May include surrounding context.

python
AI_API_KEY = _resolve_api_key()
# DeepSeek API(国内可直连)
AI_BASE_URL = "https://api.deepseek.com/v1"
AI_MODEL = "deepseek-chat"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function sends prompts containing birth details and derived chart data to an external LLM endpoint without any consent check, redaction, or just-in-time notice. Birth date, hour, gender, and computed astrological profile are sensitive personal data, so transmitting them to a third party can create privacy, retention, and regulatory risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The function passes birth date, birth hour, and gender into AI prompt-generation logic, which constitutes sensitive personal data processing without any visible consent, notice, minimization, or handling constraints in this code path. In an astrology skill, these fields are core inputs, but sending them into downstream AI components still creates privacy risk if users are not clearly informed or if prompts are logged, retained, or transmitted to third-party models.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

generate_standard_report is documented as a full pipeline including '调用AI' and returning report / report_text, which suggests an end-to-end reading generation. The actual implementation stops after generating chart data, deep data, and prompts, and returns no AI response or parsed report fields.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The system prompt is entirely written in Chinese and mandates a specific output style, including fixed Chinese phrasing and formatting requirements. This creates a language policy concern because the skill does not indicate any user opt-in or alternative locale/language option.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The /api/reading endpoint returns internal prompt material, including ai_prompt and system_prompt, directly to callers. Exposing system and prompt-engineering internals can leak hidden instructions, enable prompt-injection tuning, reveal proprietary logic, and make downstream model behavior easier to manipulate or replicate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The prompt explicitly mandates the model's output style and wording in Chinese, including fixed phrasing requirements, without offering a language or locale choice. This is a natural-language locale policy issue because the skill enforces a specific language experience rather than letting the user opt in or choose.

Content

No source excerpt is available for this finding.