Back to skill

Security audit

multi-search-zh

Security checks for vulnerabilities and agentic risk

Overview

This search skill appears purpose-built for AISA-powered research, but it exposes broader remote query and URL-processing capabilities than the main skill instructions clearly disclose.

Install only if you are comfortable sending research queries, supplied URLs, and synthesis payloads to AISA using your AISA_API_KEY. Use a dedicated low-privilege API key if available, avoid confidential prompts or signed/private URLs, and be aware that the bundled script exposes extract and sonar commands beyond the main multi-search workflow.

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

Bearer API Key May Be Forwarded Across HTTP Redirects

Content
View full analysis

Vulnerability Details

File Location: scripts/search_client.py, lines 40–59
Vulnerability Type: Authenticated request follows redirects without validating the destination origin
Risk Level: Medium

python
def aisa_post(api_key: str, path: str, body: dict[str, Any]) -> dict[str, Any]:
    url = f"{AISA_BASE}{path}"
    data = json.dumps(body).encode()
    req = urllib.request.Request(
        url,
        data=data,
        headers={
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json",
            "Accept": "application/json",
        },
        method="POST",
    )
    try:
        with urllib.request.urlopen(req, timeout=60) as resp:
            return json.loads(resp.read().decode())
    except urllib.error.HTTPError as e:
        body_text = e.read().decode() if e.fp else ""
        print(f"API error {e.code} on {path}: {body_text}", file=sys.stderr)
        return {"error": str(e), "status": e.code}

Technical Analysis

The client creates an HTTP request containing the AISA_API_KEY in an Authorization: Bearer header and submits it through urllib.request.urlopen(). Python's standard URL opener follows supported HTTP redirects by default. The code does not disable redirects or validate that a redirect remains on the original HTTPS origin, api.aisa.one.

Under redirect behavior where request headers are retained, an API response that redirects the request to another origin can cause the bearer credential to be transmitted to that destination. The implementation also has no explicit protection against an HTTPS-to-HTTP downgrade.

The initial use of HTTPS is appropriate, and transmitting the API key to AISA is necessary for the declared remote-search functionality. The flaw is the absence of a least-privilege boundary governing where that credential may be sent after the initial request.

Exploitation requires control or compromise of the authenticated API endpoint or other trusted i ...[truncated 1354 chars]

Remediation
View remediation

Remediation Suggestions

  1. Disable automatic redirects for bearer-authenticated requests and handle redirect responses explicitly.
  2. If redirects are operationally required, resolve each destination and permit it only when:
    • The URL scheme is https.
    • The normalized hostname is exactly api.aisa.one.
    • The destination port is the expected HTTPS port.
    • User information and ambiguous hostname encodings are absent.
  3. Strip the Authorization header before following any cross-origin redirect. Do not restore it unless the destination passes an explicit same-origin allowlist check.
  4. Reject HTTPS-to-HTTP redirects unconditionally.
  5. Apply a small redirect limit to prevent loops and unexpected request chains.
  6. Add automated tests covering same-origin redirects, cross-origin redirects, subdomain confusion, alternate ports, and HTTPS downgrade attempts.
  7. Document that search queries, extraction URLs, retrieved results, and the API credential are transmitted to AISA as part of the Skill's remote-search operation.
  8. Rotate the API key if logs or runtime evidence indicate that an unexpected redirect may already have occurred.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares required environment access and uses a Python client that likely performs outbound network requests, but it does not explicitly declare a tool scope such as permissions or allowed-tools. This weakens policy enforcement and reviewability because an agent may invoke code with broader capabilities than are apparent from the skill contract, increasing the risk of unintended secret exposure or network misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill name, title, descriptions, and examples are entirely in Chinese, with no indication that users may choose another language or that the locale restriction is optional. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest sets "language": "zh", which indicates the skill is constrained to Chinese. In this file there is no accompanying opt-in, user choice, or justification showing that the locale restriction is required for a region-specific purpose.

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 · scripts/search_client.py (reported line 28)May include surrounding context.

python
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Any

AISA_BASE = "https://api.aisa.one/apis/v1"


def get_api_key() -> str:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

aisa_post transmits user queries, URLs, and potentially extracted content to api.aisa.one over the network, but the script provides no explicit disclosure or confirmation about outbound sharing. In a search skill, external transmission is expected, but silent forwarding of arbitrary queries and URLs still creates privacy and compliance risk, especially if users paste confidential material.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The standalone extract command expands the skill from multi-source search/synthesis into arbitrary URL content retrieval and display. That materially changes the data-access surface: a user may cause third-party page contents or sensitive internal URLs to be sent to an external extraction API, which is riskier than the manifest suggests and can enable unintended data exfiltration or policy bypass.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The sonar command provides a generic external research/chat capability unrelated to the stated purpose of AISA multi-source evidence search. This broadens the skill into an unscoped proxy to third-party model endpoints, increasing the chance that users send sensitive prompts or data to an external provider without understanding the capability or trust boundary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The natural-language request for synthesis includes a fixed locale setting of "language": "en", which enforces English regardless of user preference. The file provides no opt-in, locale selection flag, or documented justification for this restriction, making it a language/locale policy violation under the stated rules.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The code reads the AISA_API_KEY environment variable to authenticate outbound requests. Although the docstring says the variable is required, it does not explicitly disclose that the script will use that credential to authorize requests to a remote service, which is the kind of sensitive credential handling covered by this rule.

Content

No source excerpt is available for this finding.