Back to skill

Security audit

public-opinion-insights

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to perform the advertised public-opinion analysis, but it sends API credentials and user queries over unencrypted HTTP.

Review before installing. Do not submit confidential subjects, secrets, or sensitive internal material unless the service is moved to HTTPS and the API key is provisioned through a secure channel or secret manager. Rotate any key that may already have been used over an untrusted network.

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
scripts/insights.py:7
Finding

Plaintext Transmission of API Credentials and User Queries

Content
View full analysis

Vulnerability Details

File Location: scripts/insights.py, lines 7-53
Vulnerability Type: Sensitive data transmitted over unencrypted HTTP
Risk Level: High

Vulnerable Code

python
# Service root URL
API_BASE_URL = "http://intra-znjs-yqt-agent-wx-beta.midu.cc".rstrip("/")


def _resolve_api_key(base_url: str) -> str:
    """Prefer MIDU_API_KEY; otherwise GET {base}/apiKey."""
    key = os.environ.get("MIDU_API_KEY")
    if key and key.strip():
        return key.strip()
    url = f"{base_url}/apiKey"
    response = requests.get(url, timeout=60)
    response.raise_for_status()
    text = response.text.strip()
    if not text:
        return ""
    try:
        data = json.loads(text)
        if isinstance(data, dict):
            for k in ("key", "api_key", "token", "data"):
                v = data.get(k)
                if isinstance(v, str) and v.strip():
                    return v.strip()
    except json.JSONDecodeError:
        pass
    return text
python
root = API_BASE_URL
api_key = _resolve_api_key(root)
chat_url = f"{root}/api/chat"
headers = {
    "Content-Type": "application/json",
    "podName": "public-opinion-insights-skill-user",
    "podNameSpace": "beta-nlp",
}
if api_key:
    headers["Authorization"] = "Bearer %s" % api_key

body = {"messages": [{"role": "user", "content": message}]}
response = requests.post(
    chat_url,
    json=body,
    headers=headers,
    timeout=1200
)

The same insecure endpoint is documented in SKILL.md line 22 and references/apikey-fetch.md line 7:

text
http://intra-znjs-yqt-agent-wx-beta.midu.cc/apiKey

Technical Analysis

The hardcoded service root uses HTTP rather than HTTPS. Consequently, both API-key provisioning through GET /apiKey and authenticated analysis requests through POST /api/chat lack transport encryption and cryptographic server authentica ...[truncated 2637 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the service root with an HTTPS endpoint and require TLS for both /apiKey and /api/chat.
  2. Fail closed if the configured URL does not use the https scheme.
  3. Preserve normal certificate and hostname verification; do not disable requests TLS verification.
  4. Reject redirects from HTTPS to HTTP and preferably restrict redirects to an explicit trusted host allowlist.
  5. Remove the unauthenticated runtime /apiKey fallback where possible. Require MIDU_API_KEY to be provisioned through an approved secret manager or protected OpenClaw configuration.
  6. If remote key provisioning is operationally required, protect it with authenticated TLS and validate a strict response schema rather than accepting arbitrary response text.
  7. Ensure API keys are narrowly scoped, short-lived where possible, and revocable. Rotate any credential that may already have crossed an untrusted network.
  8. Update SKILL.md and references/apikey-fetch.md to contain only the secure HTTPS endpoint and document the confidentiality implications of submitted queries.
  9. Minimize transmitted query data and warn users not to include secrets or unrelated personal information.
  10. Add automated tests or static checks that reject plaintext service URLs for credential-bearing requests.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill invokes a Python script that requires environment access to MIDU_API_KEY and performs network calls, but the manifest does not declare an explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and can lead to overbroad execution authority, making review and runtime enforcement harder if the skill is modified or abused.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description is primarily written in Chinese and presents the skill as operating through Chinese-language analysis dimensions, with no indication that users may choose another language. This can violate language/locale policy when a skill implicitly constrains interaction language without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The instruction says users can write natural language in message, but all surrounding guidance and examples are Chinese-only, which implies a language restriction. No explicit user choice or rationale for limiting language/locale is provided in the documentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The guide instructs users to retrieve an API key over plain HTTP from an internal host and then store that credential in a local config file, but it provides no warning about interception, spoofing, or local secret exposure. An attacker on the network path or with access to the workstation could capture or replace the key, leading to unauthorized API use and possible compromise of downstream analysis workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill retrieves an API key from a remote endpoint over plain HTTP, which exposes the credential to interception or modification by any attacker with network visibility or a man-in-the-middle position. Because the key is then used as a bearer token, compromise of this value can enable unauthorized use of the backend service and potentially broader access depending on token scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The fetch_insights function sends the provided message to a remote HTTP API, but the code contains no print/log statement, confirmation, or user-facing warning that input content will leave the local environment. This is a network transmission of user data and should be disclosed under the missing user warnings rule.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The code transmits user-supplied message content and potentially an authorization bearer token to an external service using a base URL configured with plain HTTP. In this context, the danger is not merely external transmission but insecure transmission, which can leak sensitive prompts, analysis targets, and credentials or allow tampering with responses.

Content

Scanner excerpt · scripts/insights.py (reported line 55)May include surrounding context.

python
headers["Authorization"] = "Bearer %s" % api_key

    body = {"messages": [{"role": "user", "content": message}]}
    response = requests.post(chat_url, json=body, headers=headers, timeout=1200)
    response.raise_for_status()
    data = response.json()
    if "result" not in data:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The heading and instructions are entirely in Chinese and state the names are to be used in natural-language requests, which implies a language-specific interaction model. There is no indication that users may choose another language or that the Chinese-only constraint is required for a region-specific purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This file contains operational instructions in Chinese while other parts are in English, effectively imposing a language assumption on the reader. There is no opt-in, alternative language path, or statement that the skill is intended only for a Chinese-speaking audience or locale-specific deployment.

Content

No source excerpt is available for this finding.