Back to skill

Security audit

DashScope Web Search (Feishu)

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly purpose-aligned, but its Feishu image pipeline handles secrets, uploads content, and sends chat messages using unsafe network and token-storage practices.

Install only if you are comfortable sending search queries to DashScope and image content to Feishu. Before using the image mode, the publisher should re-enable TLS verification, restrict and validate image URLs, add response size/type checks, store Feishu tokens in a private per-user cache, and require clear confirmation before sending images to a chat.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
scripts/feishu_image.py:109
Finding

Arbitrary Image URL Fetching Enables Server-Side Request Forgery and Data Disclosure

Content
View full analysis
{image_key}", file=sys.stderr) except Exception as e: print(f"[feishu_image] upload failed: {e}", file=sys.stderr) ``` ### Technical Analysis Markdown image URLs are extracted from model-generated search output and passed directly to `urllib.request.urlopen`. The implementation does not validate: - The URL scheme. - The destination hostname or resolved IP address. - Whether the address belongs to a loopback, private, link-local, reserved, or cloud metadata range. - Redirect targets. - The response MIME type. - The response size. - Whether the response is actually an image. Consequently, ...[truncated 1780 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/feishu_image.py:28
Finding

TLS Certificate and Hostname Verification Is Globally Disabled

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/feishu_image.py:76
Finding

Feishu Tenant Access Token Is Cached in an Unsafe Predictable Temporary File

Content
View full analysis
time.time() + 60: return cache["token"] except (json.JSONDecodeError, KeyError): pass payload = json.dumps({ "app_id": app_id, "app_secret": app_secret, }).encode("utf-8") req = urllib.request.Request( FEISHU_TOKEN_URL, data=payload, headers={"Content-Type": "application/json; charset=utf-8"}, method="POST", ) with urllib.request.urlopen(req, timeout=10, context=_ssl_ctx) as resp: data = json.loads(resp.read()) if data.get("code") != 0: raise RuntimeError(f"Failed to get token: {data}") token = data["tenant_access_token"] expire = data.get("expire", 7200) with open(TOKEN_CACHE_PATH, "w") as f: json.dump({"token": token, "expire_at": time.time() + expire}, f) return token ``` ### Technical Analysis The tenant access token is stored at the fixed path `/tmp/feishu_token.json`. The implementation does not: - Securely create the file with exclusive creation semantics. - Explicitly set permissions to `0600`. - Verify file ownership. - Reject symbolic links or unexpected file types. - Atomically replace the cache. - Separate caches by operating-system user or Feishu app ID. - Bind the cached token to the current app ID. The process first checks the path and later opens it, creating a time-of-check/time-of-use condition. ...[truncated 1852 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:59
Finding

Unpinned Third-Party Dependency Installation Creates Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (18)

Tainted flow: 'req' from os.environ.get (line 169, credential/environment) → urllib.request.urlopen (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 · scripts/feishu_image.py (reported line 93)May include surrounding context.

python
headers={"Content-Type": "application/json; charset=utf-8"},
        method="POST",
    )
    with urllib.request.urlopen(req, timeout=10, context=_ssl_ctx) as resp:
        data = json.loads(resp.read())

    if data.get("code") != 0:

Tainted flow: 'req' from os.environ.get (line 169, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
99% confidence
Finding

The script downloads arbitrary input-derived image URLs with TLS certificate verification and hostname checking explicitly disabled. This enables SSRF to internal or sensitive endpoints and makes interception or spoofing of HTTPS downloads feasible, especially because the skill processes untrusted Markdown from stdin.

Content

Scanner excerpt · scripts/feishu_image.py (reported line 114)May include surrounding context.

python
req = urllib.request.Request(url, headers={
            "User-Agent": "Mozilla/5.0 (compatible; FeishuImageBot/1.0)",
        })
        with urllib.request.urlopen(req, timeout=15, context=_ssl_ctx) as resp:
            with open(dest, "wb") as f:
                f.write(resp.read())
        return True

Tainted flow: 'req' from os.environ.get (line 169, credential/environment) → urllib.request.urlopen (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 · scripts/feishu_image.py (reported line 151)May include surrounding context.

python
},
        method="POST",
    )
    with urllib.request.urlopen(req, timeout=30, context=_ssl_ctx) as resp:
        data = json.loads(resp.read())

    if data.get("code") != 0:

Tainted flow: 'req' from os.environ.get (line 169, credential/environment) → urllib.request.urlopen (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 · scripts/feishu_image.py (reported line 178)May include surrounding context.

python
},
        method="POST",
    )
    with urllib.request.urlopen(req, timeout=15, context=_ssl_ctx) as resp:
        data = json.loads(resp.read())

    if data.get("code") != 0:

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · README.md (reported line 62)May include surrounding context.

pip install openai

text

### 5. Update SKILL.md paths

Replace `{{SKILL_DIR}}` with the actual install path:

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented purpose is simple web search, but the detected behavior includes downloading arbitrary image URLs, sending content to Feishu chats, reading credentials from environment or local config, and caching tokens in /tmp. This mismatch is dangerous because users and reviewers may authorize the skill for low-risk retrieval while it actually performs credential handling and outbound content delivery with materially higher security and privacy impact.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The activation guidance is extremely broad and tells the agent to invoke the skill proactively for many common factual requests. In combination with network access and chat-delivery features, this can cause over-invocation, unnecessary data transmission, and use of external services without a clear user opt-in or need-to-know boundary.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script can send outbound Feishu chat messages, a materially broader capability than passive web search. In an agent-skill context, this increases the blast radius from information retrieval to external action, enabling unreviewed data exfiltration, spam, or unintended communications if the skill is invoked or chained improperly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README states that search-result images are automatically downloaded, uploaded to Feishu, and sent as messages, but it does not clearly warn that user queries, fetched content, and image URLs/media may be transmitted to multiple third-party services. In a chat-agent context, this can cause unintended disclosure of potentially sensitive prompts or externally retrieved content, especially when the skill activates proactively.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 32)May include surrounding context.

md
### 3. Configure Feishu Credentials

Create a Feishu app at [Feishu Open Platform](https://open.feishu.cn/app/) and get your App ID and App Secret.

**Required permissions** (add in Feishu Developer Console):
- `im:message:send_as_bot` — Send messages as bot

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares no explicit tool scope or permission boundaries even though its documented behavior implies access to environment variables, local files, network resources, and message delivery workflows. In an agent setting, missing scope restrictions increases the chance the skill is invoked with broader capabilities than users expect, especially because it also encourages proactive use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instructions describe a pipeline that automatically sends images to a Feishu chat, but they do not require an explicit warning or confirmation that user queries and fetched image content will be transmitted to external services and posted into a chat. This creates privacy and integrity risk, especially if the agent chooses image mode based on ambiguous phrasing or uses the wrong chat identifier.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script fetches user/input-derived image URLs and then uploads the resulting image contents to Feishu without any explicit notice or consent boundary. In this skill context, that means externally sourced and potentially sensitive content may be transmitted to third parties automatically, which raises privacy, compliance, and data-handling risks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a skill for searching the web for real-time information and returning results optimized for Feishu, including visual references. This file does substantially more than search or format results: it loads Feishu app credentials, uploads downloaded images to Feishu, and can send messages directly to Feishu chats, which are separate operational capabilities not implied by merely performing web search.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

Reading fallback credentials from local openclaw.json files expands the credential surface beyond documented environment variables and may silently consume secrets from the host environment. In a skill ecosystem, this is dangerous because it creates unexpected privilege inheritance and can couple the skill to unrelated local deployments or secrets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This script sends the user's raw query to the external DashScope API for every search, but it provides no user-facing notice or confirmation at execution time that the prompt content will leave the local environment. In a skill explicitly designed to be invoked proactively for arbitrary user requests, this increases the chance that sensitive user data, internal context, or confidential terms are transmitted to a third-party service without informed consent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The docstring states 'Load credentials from env vars, with fallback to openclaw.json,' which partially describes behavior, but the broader module documentation above presents credentials as being read from environment variables without disclosing file-based secret loading. This creates a documentation-level mismatch around how credentials are actually sourced.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The script reads sensitive credentials from environment variables and also searches local config files for Feishu secrets. Although this is functionally necessary, there is no explicit warning in the user-facing interface that credentials will be sourced from the environment or local files, which falls under sensitive credential access for code files.

Content

No source excerpt is available for this finding.