Back to skill

Security audit

AIDSO 虾搜 GEO内容生产

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with AIDSO content generation, but its API-key binding flow handles the credential in an unsafe and under-disclosed way.

Review this skill before installing. Use a dedicated, low-privilege AIDSO API key, rotate it if already used with this binding flow, and avoid sharing the skill directory or committing its .env file. The content-generation workflow itself is disclosed, but the credential-binding design should be fixed to send the key only as authentication and store it with stricter protections.

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

Warning
Location
bind_api_key.py:86
Finding

API Key Transmitted as Application Content and Stored Insecurely

Content
View full analysis

Vulnerability Details

File Location: bind_api_key.py:86-107, bind_api_key.py:181, and bind_api_key.py:204-206
Vulnerability Type: Excessive credential transmission and insecure plaintext secret handling
Risk Level: Medium

Vulnerable Code

python
def request_bind_check(api_key: str) -> Dict[str, Any]:
    payload = {
        "content": api_key,
        "brand_name": api_key,
    }

    headers = {
        "x-api-key": api_key,
        "Content-Type": "application/json",
    }

    try:
        response = requests.post(
            BIND_URL,
            headers=headers,
            data=json.dumps(payload, ensure_ascii=False).encode("utf-8"),
            timeout=30,
        )
python
save_env_value(ENV_KEY, api_key)
python
parser.add_argument(
    "--api-key",
    required=True,
    help="AIDSO API Key",
)

The persistence operation ultimately uses:

python
content = "\n".join(f"{k}={v}" for k, v in env_data.items()) + "\n"
ENV_FILE.write_text(content, encoding="utf-8")

Technical Analysis

The API key is legitimately required in the x-api-key authentication header when communicating with the declared AIDSO service. However, request_bind_check() also places the same secret into the content and brand_name request-body fields and transmits it to:

text
https://api.aidso.com/openapi/skills/save_content/md

Sending the key as application content is not required for header-based authentication and exceeds the minimum credential exposure necessary for the declared binding operation. It can cause the secret to be retained in request bodies, content records, application logs, analytics systems, debugging traces, or error reports.

The key is also supplied through a command-line argument. Depending on the operating environment, command-line values may be retained in shell history or exposed through process inspect ...[truncated 2228 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the API key from content and brand_name. Send it only through the authentication header:

    python
    headers = {
        "x-api-key": api_key,
        "Content-Type": "application/json",
    }
    payload = {}
    
  2. Use a dedicated credential-validation endpoint rather than a content-storage endpoint. Ensure the validation API neither persists nor echoes authentication secrets.

  3. Avoid accepting secrets directly through command-line arguments. Prefer a masked prompt or standard input:

    python
    from getpass import getpass
    
    api_key = getpass("AIDSO API Key: ")
    

    Alternatively, require the user to set AIDSO_GEO_API_KEY through an appropriate secret-management mechanism.

  4. If local persistence is required, create and maintain .env with owner-only permissions such as 0600. Use an atomic write procedure and verify permissions after replacement.

  5. Add .env to .gitignore and package-exclusion rules so credentials cannot be committed or distributed accidentally.

  6. Do not include raw provider responses in user-visible or routinely logged failure results unless they have been sanitized. This reduces the risk if an upstream service echoes request content.

  7. Document the credential lifecycle, including where the key is stored, which domain receives it, how it can be rotated, and how users can securely remove it.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (31)

Tainted flow: 'headers' from os.getenv (line 119, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
98% confidence
Finding

The code sends the API key directly to a remote service in both the x-api-key header and the JSON body. This is a real secret-exfiltration risk because the function is presented as a local 'bind/check' operation, but it transmits the credential to an external endpoint, increasing exposure through the remote service, logs, and any intermediaries.

Content

Scanner excerpt · bind_api_key.py (reported line 125)May include surrounding context.

python
}

    try:
        response = requests.post(
            BIND_URL,
            headers=headers,
            data=json.dumps(payload, ensure_ascii=False).encode("utf-8"),

Tainted flow: 'headers' from os.getenv (line 84, credential/environment) → requests.post (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 · geo_content_tool.py (reported line 86)May include surrounding context.

python
def request_post(url: str, api_key: str, payload: Dict[str, Any], timeout: int = 180) -> Dict[str, Any]:
    headers = {"x-api-key": api_key, "Content-Type": "application/json"}
    try:
        response = requests.post(
            url,
            headers=headers,
            data=json.dumps(payload, ensure_ascii=False).encode("utf-8"),

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill explicitly stores the API key in a local .env file within the skill directory and prioritizes reading secrets from local storage. Persisting credentials in a workspace file raises the risk of accidental disclosure through file reads, logs, backups, or other skills/processes that can access the directory.

Content

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

check_api_key.py bind_api_key.py geo_content_tool.py .env

text

`.env` 用于保存绑定成功后的 API Key。

Credential Access

High
Category
Privilege Escalation
Confidence
87% confidence
Finding

The code stores the API key in a plain-text .env file in the skill directory without setting restrictive permissions or using a secure credential store. If the directory is shared, backed up, committed, or readable by other local users/processes, the key can be exposed.

Content

Scanner excerpt · bind_api_key.py (reported line 79)May include surrounding context.

python
def save_env_value(key: str, value: str) -> None:
    """
    写入当前 skill 目录下的 .env 文件。
    已存在同名 key 时覆盖。
    """
    env_data = load_env_file()

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bind_api_key.py (reported line 52)May include surrounding context.

python
def load_env_file() -> dict:
    """
    读取当前 skill 目录下的 .env 文件
    """
    result = {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bind_api_key.py (reported line 95)May include surrounding context.

python
def load_env_file() -> dict:
    """
    读取当前 skill 目录下的 .env 文件
    """
    result = {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · check_api_key.py (reported line 32)May include surrounding context.

python
def load_env_file() -> dict:
    """
    读取当前 skill 目录下的 .env 文件
    """
    result = {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · check_api_key.py (reported line 62)May include surrounding context.

python
def load_env_file() -> dict:
    """
    读取当前 skill 目录下的 .env 文件
    """
    result = {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · check_api_key.py (reported line 77)May include surrounding context.

python
def load_env_file() -> dict:
    """
    读取当前 skill 目录下的 .env 文件
    """
    result = {}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bind_api_key.py (reported line 28)May include surrounding context.

python
import requests

ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bind_api_key.py (reported line 105)May include surrounding context.

python
import requests

ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · bind_api_key.py (reported line 207)May include surrounding context.

python
import requests

ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · check_api_key.py (reported line 23)May include surrounding context.

python
import requests

ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · check_api_key.py (reported line 84)May include surrounding context.

python
import requests

ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · geo_content_tool.py (reported line 17)May include surrounding context.

python
import requests

ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · geo_content_tool.py (reported line 79)May include surrounding context.

python
import requests

ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill documents executable scripts that can read environment variables, write files, and make network requests, but it declares no explicit tool restrictions or permissions. This increases the attack surface because an agent may invoke broader capabilities than users expect, including handling secrets and persisting data locally.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The supposed API-key binding check uses an endpoint named /save_content/md and populates content and brand_name fields with the API key, which is inconsistent with credential validation. This mismatch strongly suggests the secret may be stored, processed, or logged as content rather than merely verified, making the design unsafe in the context of a credential-binding utility.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The comment claims the function performs a binding-check API call, but the implementation posts to a content-save endpoint and sends the API key as content fields. That discrepancy is dangerous because it can mislead reviewers and users into believing a harmless validation occurs when the code actually transmits a secret to a likely storage-oriented API.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code transmits the user's API key to a remote endpoint without any explicit warning, interactive confirmation, or clear indication in the CLI output that the secret will leave the local environment. In a skill-installation or tooling context, this reduces informed consent and makes inadvertent secret disclosure more likely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The failure message instructs the user in Chinese to send a specific binding phrase, which imposes a language-specific interaction pattern. There is no opt-in, alternative language, or justification indicating that this skill is intentionally restricted to Chinese-speaking users.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · bind_api_key.py (reported line 30)May include surrounding context.

python
ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

SUPPORTED_PLATFORMS = {

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · geo_content_tool.py (reported line 19)May include surrounding context.

python
ENV_KEY = "AIDSO_GEO_API_KEY"
ENV_FILE = Path(__file__).resolve().parent / ".env"

CONTENT_URL = "https://api.aidso.com/openapi/skills/run_realtime_report"
POINT_COST = 6

SUPPORTED_PLATFORMS = {

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The user-facing message is hardcoded in Chinese, and the file consistently presents prompts and operational messages only in Chinese. This can constitute a language-policy violation because the skill does not offer any user opt-in or language selection despite enforcing a specific locale in natural-language outputs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The tool sends user-provided brand and issue text to an external service for processing, but the code path does not clearly disclose that transmission at execution time beyond a points-consumption confirmation. In a skill context, this can expose potentially sensitive business prompts or proprietary marketing queries to a third party without sufficiently explicit user awareness.

Content

No source excerpt is available for this finding.