Back to skill

Security audit

Custom Gift Leewow

Security checks for vulnerabilities and agentic risk

Overview

This skill’s gift-customization purpose is coherent, but its tool wiring and endpoint controls create real review-level risks around command execution and credential/file exposure.

Install only if you trust the publisher and can run it in a constrained environment. Use dedicated Leewow and Feishu credentials with minimal permissions, avoid passing untrusted text into tool parameters, do not allow arbitrary Feishu or Leewow API base URLs, and keep sensitive files outside any path the skill can upload or follow through symlinks.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
tools.json:7
Finding

Shell Command Injection Through Bash Tool Templates

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/feishu_direct.py:200
Finding

Feishu App Credentials Can Be Exfiltrated to a Caller-Controlled Endpoint

Content
View full analysis
tuple[str, str, str, str, str]: args = params or {} app_id = str(args.get("feishu_app_id") or os.getenv("FEISHU_APP_ID") or "").strip() app_secret = str(args.get("feishu_app_secret") or os.getenv("FEISHU_APP_SECRET") or "").strip() receive_id = str(args.get("feishu_target") or os.getenv("FEISHU_RECEIVE_ID") or "").strip() receive_id_type = str( args.get("feishu_receive_id_type") or os.getenv("FEISHU_RECEIVE_ID_TYPE") or DEFAULT_RECEIVE_ID_TYPE ).strip() domain = str(args.get("feishu_open_base") or os.getenv("FEISHU_OPEN_BASE") or DEFAULT_DOMAIN).strip() ``` The selected domain then receives the credentials: ```python response = requests.post( f"{self.domain}/open-apis/auth/v3/tenant_access_token/internal", json={"app_id": self.app_id, "app_secret": self.app_secret}, timeout=30, ) response.raise_for_status() payload = response.json() if payload.get("code") != 0: raise RuntimeError(f"Token API failed: {json.dumps(payload, ensure_ascii=False)}") token = payload.get("tenant_access_token") ``` ### Technic ...[truncated 2222 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/generate.py:40
Finding

Workspace Path Validation Can Be Bypassed to Upload Files Outside the Workspace

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/get_status.py:204
Finding

Unrestricted Remote Image Fetching Enables SSRF and Resource Exhaustion

Content
View full analysis
str | None: """Download preview image to workspace/previews/.""" try: resp = requests.get(image_url, timeout=30) resp.raise_for_status() ext = ".png" ct = resp.headers.get("content-type", "") if "jpeg" in ct or "jpg" in ct: ext = ".jpg" elif "webp" in ct: ext = ".webp" previews_dir = os.path.join(WORKSPACE_DIR, "previews") os.makedirs(previews_dir, exist_ok=True) filepath = os.path.join(previews_dir, f"leewow_preview_{task_id}{ext}") with open(filepath, "wb") as f: f.write(resp.content) return filepath ``` The Feishu client likewise fetches any non-file image reference without validating its destination: ```python @staticmethod def _load_image_bytes(image_ref: str) -> tuple[bytes, str]: image_path = Path(image_ref).expanduser() if image_path.is_file(): return image_path.read_bytes(), image_path.name response = requests.get(image_ref, timeout=30) response.raise_for_status() filename = Path(image_ref.split("?", 1)[0]).name or "image.png" return response.content, filename ``` Catalog cover images are handled similarly: ```python resp = requests.get(remote_url, timeout=15) resp.raise_for_status() with open(filepath, "wb") as f: f.write(resp.content) ``` ### Technical Analysis Remote image URLs ultimately originate from Leewow template or task API responses. The Skill trusts those URLs and performs server-side requests without enforcing: - HTTPS. - An allowlist of expected COS o ...[truncated 2496 chars]
Remediation
View remediation
MAX_IMAGE_BYTES: raise ValueError("Image exceeds maximum size") output.write(chunk) ``` 5. Enforce a conservative maximum size before and during the download, using `Content-Length` only as an initial check. 6. Accept only approved image MIME types and verify the downloaded file with a trusted image decoder. 7. Use non-executable cache directories and restrictive file permissions. 8. Apply the same central URL-validation and download routine in `browse.py`, `get_status.py`, `feishu_direct.py`, and `feishu_markdown_resolve.py`. 9. Restrict outbound network access at the sandbox or firewall layer so the Skill can reach only Leewow, approved COS/CDN endpoints, and the official Feishu API. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (38)

Tainted flow: 'url' from os.getenv (line 25, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
91% confidence
Finding

The STS credential endpoint is built from an environment variable and then fetched without any allowlist, scheme validation, or host verification. If an attacker can influence LEEWOW_API_BASE, they can redirect the request to an attacker-controlled server, causing the code to trust forged temporary cloud credentials and upload files to attacker-controlled storage or leak operational metadata via SSRF-style outbound requests.

Content

Scanner excerpt · scripts/cos_uploader.py (reported line 26)May include surrounding context.

python
return _sts_cache

    url = LEEWOW_API_BASE + STS_ENDPOINT
    resp = requests.get(url, timeout=15)
    resp.raise_for_status()
    data = resp.json()
    if not data.get("tmpSecretId"):

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill's stated role is customization assistance, but the described behavior includes fetching arbitrary remote image URLs, reading local files, uploading content to Feishu, and caching image metadata locally. This combination creates clear data-exfiltration and SSRF-style risk: an agent could be induced to read local images or retrieve attacker-controlled remote content and relay it into external messaging channels.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill's stated role is customization assistance, but the described behavior includes fetching arbitrary remote image URLs, reading local files, uploading content to Feishu, and caching image metadata locally. This combination creates clear data-exfiltration and SSRF-style risk: an agent could be induced to read local images or retrieve attacker-controlled remote content and relay it into external messaging channels.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The skill is coded to access a local ~/.openclaw/.env file, which is a credential/configuration source outside the immediate function's declared inputs. In a multi-skill or shared workstation environment, this creates an unauthorized credential access pattern and can expose secrets unrelated to browsing templates.

Content

Scanner excerpt · scripts/browse.py (reported line 16)May include surrounding context.

python
from pathlib import Path
from urllib.parse import urlparse

# Load environment variables from ~/.openclaw/.env
def _load_env_file():
    env_path = os.path.expanduser("~/.openclaw/.env")
    if os.path.exists(env_path):

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The existence check and subsequent read of ~/.openclaw/.env confirms intentional access to a shared secret store rather than narrowly scoped input parameters. In the context of an agent skill that also spawns child processes and performs external network actions, broad local secret access is especially dangerous because it can feed into exfiltration or unintended propagation paths.

Content

Scanner excerpt · scripts/browse.py (reported line 18)May include surrounding context.

python
# Load environment variables from ~/.openclaw/.env
def _load_env_file():
    env_path = os.path.expanduser("~/.openclaw/.env")
    if os.path.exists(env_path):
        with open(env_path, 'r') as f:
            for line in f:

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
97% confidence
Finding

Using os.environ.copy() clones the entire current environment into the child process, potentially including unrelated API keys, tokens, and local secrets loaded earlier from ~/.openclaw/.env. This is a classic over-broad credential propagation issue that expands the blast radius of any subprocess compromise or diagnostic exposure.

Content

Scanner excerpt · scripts/browse.py (reported line 239)May include surrounding context.

python
)
        batch_file = handle.name

    child_env = os.environ.copy()
    child_env["FEISHU_APP_ID"] = app_id
    child_env["FEISHU_APP_SECRET"] = app_secret
    child_env["FEISHU_RECEIVE_ID"] = receive_id

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

python
import json
import os

# Load environment variables from ~/.openclaw/.env
def _load_env_file():
    env_path = os.path.expanduser("~/.openclaw/.env")
    if os.path.exists(env_path):

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

python
# Load environment variables from ~/.openclaw/.env
def _load_env_file():
    env_path = os.path.expanduser("~/.openclaw/.env")
    if os.path.exists(env_path):
        with open(env_path, "r") as f:
            for line in f:

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

python
# Load environment variables from ~/.openclaw/.env
def _load_env_file():
    env_path = os.path.expanduser("~/.openclaw/.env")
    if os.path.exists(env_path):
        with open(env_path, "r") as f:
            for line in f:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · tools.json (reported line 139)May include surrounding context.

json
},
    {
      "name": "cos_presign_url",
      "description": "Generate a presigned URL for accessing COS (Tencent Cloud Object Storage) images. Useful for private buckets or when images need temporary access tokens.",
      "executor": "bash",
      "command": "python3 scripts/cos_presign.py '{{cos_url}}' --expired {{expired}} --json",
      "parameters": {

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises and documents capabilities that involve shell execution, filesystem access, environment-variable use, and network operations, yet it declares no explicit tool scope or permission boundaries. This makes the skill over-privileged by default and increases the chance that an agent can invoke sensitive operations such as reading workspace files, using secrets, cloning repositories, or sending data to external services without clear policy constraints.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The 'When to Use' section includes generic phrases such as 'gift ideas', 'create something personalized', and 'customize this design', which overlap with common conversation and are not tightly scoped to this specific skill. The file does not provide negative examples or explicit exclusion conditions to reduce accidental activation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill automatically reads ~/.openclaw/.env and imports any key/value pairs into its environment, even though that file may contain unrelated secrets for other skills or services. This broad credential loading violates least privilege and can expose sensitive local configuration to code paths in this skill or its child processes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The browse flow schedules continued outbound messaging in a detached subprocess after the main function returns. In an agent-skill context, background actions that continue after the triggering request can surprise users, bypass normal oversight, and make abuse or accidental over-sending harder to detect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code writes a JSON batch file to disk containing recipient identifiers and card contents before sending them later. Persisting message data to a workspace directory without access controls, encryption, or user disclosure can leak private content and metadata to other local processes or users on the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Feishu app credentials and recipient metadata are copied into the child process environment, which may be visible to local inspection tools, crash reports, or unrelated descendant code. In this skill, that risk is amplified because the subprocess is detached and opaque, reducing visibility into how long the credentials remain available.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
87% confidence
Finding

The code launches a detached subprocess to continue sending Feishu cards in the background. Although it does not invoke a shell and uses a fixed executable/argument list, it creates an execution path that persists beyond the user-visible action, suppresses stdout/stderr, and relies on inherited runtime state, which increases stealth and reduces auditability if abused or if upstream inputs are compromised.

Content

Scanner excerpt · scripts/browse.py (reported line 246)May include surrounding context.

python
child_env["FEISHU_RECEIVE_ID_TYPE"] = receive_id_type
    child_env["FEISHU_OPEN_BASE"] = domain

    subprocess.Popen(
        [sys.executable, os.path.abspath(__file__), "--send-card-batch-file", batch_file],
        stdout=subprocess.DEVNULL,
        stderr=subprocess.DEVNULL,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file is in scope for SQP-3, which applies to all file types. The hardcoded subtitles and fallback description are written in Chinese while the surrounding renderer output is otherwise English, and there is no user opt-in, locale selection, or justification for enforcing that language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code fetches temporary credentials from a remote endpoint and uploads a local file to cloud object storage, which can transmit user or system data off-host. There is no confirmation prompt, print/log statement, or inline comment/docstring in the upload function warning that local files will be sent to external services.

Content

No source excerpt is available for this finding.

Cloud Storage Exfiltration

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

This function uploads arbitrary local files to cloud object storage and returns a public URL, which can become an exfiltration path if untrusted input can control file_path or invoke the uploader on sensitive files. In a customization skill that handles user images this behavior is expected, but it is still dangerous because the code applies no path restrictions, file-type validation beyond extension-based content type, or access control checks at this layer.

Content

Scanner excerpt · scripts/cos_uploader.py (reported line 58)May include surrounding context.

python
}.get(ext.lower(), "application/octet-stream")

    with open(file_path, "rb") as fp:
        client.put_object(Bucket=bucket, Body=fp, Key=key, ContentType=content_type)

    return f"https://{bucket}.cos.{region}.myqcloud.com/{key}"

Tainted flow: 'payload' from requests.post (line 143, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/feishu_direct.py (reported line 153)May include surrounding context.

python
return self._token

    def _send_message(self, payload: dict[str, Any]) -> dict[str, Any]:
        response = requests.post(
            f"{self.domain}/open-apis/im/v1/messages",
            params={"receive_id_type": self.receive_id_type},
            headers={

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The helper accepts an arbitrary image_ref and, if it is not a local file, performs requests.get(image_ref) to any URL. That gives the skill general outbound network reach and can be abused for SSRF-style access to internal services, metadata endpoints, or other unintended hosts before relaying content onward to Feishu.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Remote image URLs are fetched server-side and then uploaded to Feishu without any visible consent, warning, or policy gate. In this skill context, that is risky because user-provided or tool-provided URLs may cause unintended third-party data transfer and conceal the fact that the service is retrieving external content on the operator's behalf.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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/feishu_direct.py (reported line 137)May include surrounding context.

python
with self._lock:
            if self.token:
                return self.token
            response = requests.post(
                f"{self.domain}/open-apis/auth/v3/tenant_access_token/internal",
                json={"app_id": self.app_id, "app_secret": self.app_secret},
                timeout=30,

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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/feishu_markdown_resolve.py (reported line 130)May include surrounding context.

python
with self._lock:
            if self.token:
                return self.token
            response = requests.post(
                f"{self.domain}/open-apis/auth/v3/tenant_access_token/internal",
                json={"app_id": self.app_id, "app_secret": self.app_secret},
                timeout=30,