Back to skill

Security audit

AIsa Youtube Search

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward YouTube search API client that sends user queries to AIsa using a user-provided API key, with no hidden persistence or unrelated local access found.

Install only if you intend to use AIsa's YouTube search API. Your search terms and AISA_API_KEY are sent to api.aisa.one, so use a dedicated key, monitor credit usage, and prefer a version that rejects or safely handles authenticated redirects.

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/youtube_client.py:45
Finding
Cross-Origin Redirects May Disclose the API Bearer Token<![CDATA[ ## Vulnerability Details **File Location**: `scripts/youtube_client.py`, lines 45–61 **Vulnerability Type**: Authorization header exposure through unrestricted HTTP redirects **Risk Level**: Medium ### Vulnerable Code ```python headers = { "Authorization": f"Bearer {self.api_key}", "Content-Type": "application/json", "User-Agent": "OpenClaw-YouTube/1.0", "Accept": "application/json" } request_data = None if data: request_data = json.dumps(data).encode("utf-8") if method == "POST" and request_data is None: request_data = b"{}" req = urllib.request.Request(url, data=request_data, headers=headers, method=method) try: with urllib.request.urlopen(req, timeout=60) as response: ``` ### Technical Analysis The client places the `AISA_API_KEY` credential in the HTTP `Authorization` header and sends the request through `urllib.request.urlopen`. The default `urllib` opener automatically processes HTTP redirects, but the client does not validate that a redirect remains on the original `https://api.aisa.one` origin. Authorization headers associated with a redirected request may be propagated by the redirect handling path. Consequently, a cross-origin redirect could cause the bearer token to be sent to a server outside the intended AIsa API trust boundary. Sending the bearer token to the documented AIsa API is necessary for the Skill's declared YouTube search functionality. Allowing that credential to accompany an unrestricted cross-origin redirect is not necessary and exceeds the minimum network privilege required. Exploitation depends on the legitimate API endpoint, its infrastructure, or its DNS/routing path returning an attacker-controlled redirect. No evidence was found that the project itself deliberately redirects credentials or communicates with an undeclared destination. ### Attack Path 1. A user configures `AISA_API_KEY` and invokes one of the documented search commands. 2. The client creates a request to `https://ap ...[truncated 1122 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Implement an explicit redirect policy rather than relying on the default `urllib` behavior: 1. Permit redirects only when the destination uses HTTPS. 2. Require the destination hostname to remain exactly `api.aisa.one`. 3. Reject redirects containing unexpected credentials, ports, or hostname variations. 4. Strip the `Authorization` header before following any cross-origin redirect. 5. Set a small maximum redirect count to prevent redirect loops. 6. Log rejected redirects without logging the bearer token. 7. Rotate the API key if credential exposure is suspected. A strict redirect handler can reject all automatic redirects: ```python class NoRedirectHandler(urllib.request.HTTPRedirectHandler): def redirect_request(self, req, fp, code, msg, headers, newurl): raise urllib.error.HTTPError( req.full_url, code, "Redirects are not permitted for authenticated API requests", headers, fp, ) opener = urllib.request.build_opener(NoRedirectHandler()) with opener.open(req, timeout=60) as response: return json.loads(response.read().decode("utf-8")) ``` If redirects are operationally required, parse each redirect destination with `urllib.parse.urlparse`, verify that its scheme is `https` and hostname is exactly `api.aisa.one`, and construct a fresh request. Never copy the `Authorization` header to a destination that fails the same-origin check. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill declares it needs environment access and performs network requests, but it does not define an explicit tool scope such as permissions or allowed-tools. That omission can cause the host agent to grant broader execution capability than users expect, increasing the chance of unintended outbound requests or use of secrets like the API key.

External Transmission

Medium
Category
Data Exfiltration
Content
class YouTubeClient:
    """OpenClaw YouTube - YouTube SERP Scout API Client."""
    
    BASE_URL = "https://api.aisa.one/apis/v1"
    
    def __init__(self, api_key: Optional[str] = None):
        """Initialize the client with an API key."""
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
class YouTubeClient:
    """OpenClaw YouTube - YouTube SERP Scout API Client."""
    
    BASE_URL = "https://api.aisa.one/apis/v1"
    
    def __init__(self, api_key: Optional[str] = None):
        """Initialize the client with an API key."""
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
class YouTubeClient:
    """OpenClaw YouTube - YouTube SERP Scout API Client."""
    
    BASE_URL = "https://api.aisa.one/apis/v1"
    
    def __init__(self, api_key: Optional[str] = None):
        """Initialize the client with an API key."""
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
class YouTubeClient:
    """OpenClaw YouTube - YouTube SERP Scout API Client."""
    
    BASE_URL = "https://api.aisa.one/apis/v1"
    
    def __init__(self, api_key: Optional[str] = None):
        """Initialize the client with an API key."""
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
class YouTubeClient:
    """OpenClaw YouTube - YouTube SERP Scout API Client."""
    
    BASE_URL = "https://api.aisa.one/apis/v1"
    
    def __init__(self, api_key: Optional[str] = None):
        """Initialize the client with an API key."""
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
class YouTubeClient:
    """OpenClaw YouTube - YouTube SERP Scout API Client."""
    
    BASE_URL = "https://api.aisa.one/apis/v1"
    
    def __init__(self, api_key: Optional[str] = None):
        """Initialize the client with an API key."""
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
class YouTubeClient:
    """OpenClaw YouTube - YouTube SERP Scout API Client."""
    
    BASE_URL = "https://api.aisa.one/apis/v1"
    
    def __init__(self, api_key: Optional[str] = None):
        """Initialize the client with an API key."""
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
90% confidence
Finding
This code sends the supplied search query and bearer API key to a remote service, but the runtime flow provides no confirmation prompt or user-facing notice that input data will be transmitted off-system. The module docstring describes the client generally, but it does not explicitly warn users that their query data is sent to a third-party API endpoint.

Static analysis

No suspicious patterns detected.