Back to skill

Security audit

Xiaozhi AI Media

Security checks for vulnerabilities and agentic risk

Overview

The media tools match their stated purpose, but setup asks you to expose a reusable account API key in chat.

Configure XIAOZHI_API_KEY through a protected local secret-entry method instead of pasting it into chat. Rotate any key already shared. Submitted content goes to xzai.me, and generation consumes account credits.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (6)

Tainted flow: 'req' from os.environ.get (line 60, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/xiaozhi.py (reported line 62)May include surrounding context.

python
data = json.dumps(payload or {}).encode()
    req = urllib.request.Request(url, data=data, headers=headers)
    try:
        with urllib.request.urlopen(req, timeout=timeout) as r:
            return json.loads(r.read().decode())
    except urllib.error.HTTPError as e:
        body = e.read().decode(errors="replace")

Tainted flow: 'req' from os.environ.get (line 181, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/xiaozhi.py (reported line 182)May include surrounding context.

python
def cmd_models(_):
    req = urllib.request.Request(BASE + "/v1/models", headers={"Authorization": "Bearer " + need_key()})
    with urllib.request.urlopen(req, timeout=30) as r:
        d = json.loads(r.read().decode())
    for m in d.get("data", []):
        print(m.get("id"))

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, network.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

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

export XIAOZHI_BASE_URL="https://xzai.me" # optional, this is the default

text

**No key yet?** Run any command anyway — the CLI prints the URL
`https://xzai.me` and a 4-step guide (register → 个人中心 → API接口 → copy
key → send it back to the agent). No browser popup; the agent relays the
URL and saves the key once the user provides it.

The submission workflow lacks a privacy warning about sending user content to Xiaozhi's third-party API.

Medium
Category
Output Handling
Confidence
92% confidence
Finding

The procedure instructs the agent to submit generation jobs, which transmit user-provided prompts and any supplied reference-image URLs to Xiaozhi. Although the skill identifies the API provider and warns about credit consumption, it does not warn that submitted content leaves the user's environment or advise against including sensitive information.

Content

No source excerpt is available for this finding.

Credential setup guidance instructs the user to disclose their API key in the agent conversation.

Medium
Category
Data Exfiltration
Confidence
99% confidence
Finding

The setup guidance explicitly asks users to send their API key in the agent conversation, unnecessarily exposing a reusable credential to conversation history and potentially associated logging or retention systems. An exposed key could allow unauthorized API usage and consumption of the user's credits; although authentication is necessary for this skill, disclosing the key in chat is not.

Content

No source excerpt is available for this finding.