Back to skill

Security audit

Local Guide - Food & Travel

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed local recommendation helper, but it includes an unsafe fallback search command that can execute attacker-supplied shell input.

Review this skill before installing. The recommendation and Feishu features are mostly disclosed, but the bundled search fallback should be fixed to avoid shell=True and pass arguments safely before using it with untrusted location or recommendation text. Configure Exa and Feishu credentials only if you trust the skill and understand that searches and Feishu cards send data to external services.

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

Error
Location
scripts/search_module.py:59
Finding

OS Command Injection in Exa Search Fallback

Content
View full analysis

Vulnerability Details

File Location: scripts/search_module.py, lines 59–61
Vulnerability Type: OS command injection through user-controlled search input
Risk Level: High

Vulnerable Code

python
# 兜底实现
import subprocess
cmd = f"mcporter call exa.web_search_exa query='{query}' numResults={num_results}"
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
return result.stdout

Technical Analysis

The fallback search implementation embeds query directly into a shell command and executes it with shell=True. The query is derived from location and recommendation-type values supplied to the Skill. Wrapping the value in single quotes does not make it safe because an attacker can include a single quote to terminate the quoted argument, followed by shell operators and an arbitrary command.

This path is reachable when the preferred skill_orchestrator integration is unavailable and SEARCH is therefore None. No validation or shell escaping is performed before execution.

Attack Path

  1. An attacker supplies a crafted location or recommendation type containing a closing quote, shell operators, and an operating-system command.
  2. multi_round_search() incorporates that value into one or more search queries.
  3. search_exa() receives the resulting attacker-influenced query.
  4. If SEARCH is unavailable, the fallback constructs a command string using the query.
  5. subprocess.run(..., shell=True) passes that string to the system shell.
  6. The shell interprets the injected operators and executes the attacker’s command with the privileges of the Agent process.

A conceptual malicious value could terminate the quoted query argument and append a command using ;, &&, command substitution, or similar shell syntax.

Impact Assessment

Successful exploitation permits arbitrary command execution under the account running the Skill. Depending on that account’s permissions, an attacker could:

  • Read or modify ...[truncated 498 chars]
Remediation
View remediation

Remediation Suggestions

Eliminate shell interpretation and pass each argument directly to the subprocess:

python
result = subprocess.run(
    [
        "mcporter",
        "call",
        "exa.web_search_exa",
        f"query={query}",
        f"numResults={num_results}",
    ],
    capture_output=True,
    text=True,
    check=True,
    timeout=30,
)
return result.stdout

Additional hardening should include:

  1. Validate that query is a string and impose a reasonable maximum length.
  2. Constrain num_results to an integer within an expected range.
  3. Use an absolute, trusted path for mcporter where practical to reduce executable path-hijacking risk.
  4. Handle subprocess.TimeoutExpired and subprocess.CalledProcessError without exposing sensitive process details.
  5. Run the Skill under a least-privileged account with restricted filesystem and network access.
  6. Add regression tests containing quotes, semicolons, command substitutions, newlines, and other shell metacharacters to verify they remain literal argument content.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (21)

Tainted flow: 'APP_ID' from os.environ.get (line 12, 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 · scripts/feishu_card.py (reported line 21)May include surrounding context.

python
print("❌ 未配置飞书应用信息,请设置环境变量 FEISHU_APP_ID 和 FEISHU_APP_SECRET", file=sys.stderr)
        return None
    
    r = requests.post(
        "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal",
        json={"app_id": APP_ID, "app_secret": APP_SECRET}
    )

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

�压后放置 unzip 刘雨鑫-美食探店.skill -d ~/.openclaw/skills/local-guide

text

## ⚙️ 配置

使用前需配置以下环境变量:

### EXA 搜索引擎(必需)

```bash
# 1. 注册获取 API Key:https://exa.ai
# 2. 配置环境变量

# Linux/Mac
export EXA_API_KEY=your-api-key-here

# Windows
set EXA_API_KEY=your-api-key-here

# 添加到 ~/.bashrc 或 ~/.zshrc 永久保存
echo 'export EXA_API_KEY=your-api-key-here' >> ~/.bashrc

飞书卡片(可选)

如需飞书卡片输出功能:

bash
export FEISHU_APP_ID=your-feishu-app-id
export FEISHU_APP_SECRET=your-feishu-app-secret

🚀 使用示例

text
# 美食推荐
本地通 美食 南海桂城
本地通推荐 小吃 佛山市南海区桂城
本地通 糖水 广州天河

# 景点推荐
本地通 好玩 佛山南海
本地通推荐 景点 广州市番禺区
本地通 小众景点 深圳

# 停车场推荐
本地通 停车 佛山南海千灯湖公园
本地通推荐 停车场 广州天河城

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to perform broad search and recommendation generation, but the described implementation instead consumes external input and forwards it to Feishu recipients using CLI parameters. This hidden forwarding capability is risky because it can route untrusted or sensitive content to arbitrary destinations without that being obvious from the skill’s stated purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims to perform broad search and recommendation generation, but the described implementation instead consumes external input and forwards it to Feishu recipients using CLI parameters. This hidden forwarding capability is risky because it can route untrusted or sensitive content to arbitrary destinations without that being obvious from the skill’s stated purpose.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

The code passes attacker-controllable tool parameters through a shell command, allowing parameter abuse to become arbitrary command execution. In an agent skill context, this is especially dangerous because inputs may originate from natural-language prompts, tool chains, or other skills, widening the path for indirect prompt-to-command exploitation.

Content

Scanner excerpt · scripts/search_module.py (reported line 59)May include surrounding context.

python
# 兜底实现
    import subprocess
    cmd = f"mcporter call exa.web_search_exa query='{query}' numResults={num_results}"
    result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
    return result.stdout

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill declares no explicit tool scope while its instructions require shell execution, network access, and use of environment-backed credentials. That creates an unnecessary capability gap: the runtime may permit more access than users or reviewers expect, increasing the chance of unintended command execution or credential misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description, trigger phrases, and examples are entirely specified in Chinese, presenting the skill as operating in a single language with no opt-in or alternative locale behavior. Under the policy rule, forcing a specific language without user choice is a natural-language policy concern unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Requiring execution of an external script via shell adds a code-execution surface unrelated to the core recommendation task. Shell invocation combined with piped JSON and runtime arguments can become an abuse path for command misuse, unsafe argument handling, or unintended data disclosure if the surrounding system does not strictly sandbox execution.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill's stated purpose is local recommendation and search, but this module adds Feishu enterprise messaging capability that is not necessary for that function. Extra outbound communication features expand the attack surface and can be abused to send unreviewed content, spam, or leak recommendation results and user-derived data to external chats.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This file extends behavior beyond search/recommendation into external enterprise message delivery, creating a capability mismatch with the advertised skill. In an agent setting, such hidden or unnecessary side-effecting actions are risky because they enable data egress and remote communications unrelated to the core task.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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_card.py (reported line 21)May include surrounding context.

python
print("❌ 未配置飞书应用信息,请设置环境变量 FEISHU_APP_ID 和 FEISHU_APP_SECRET", file=sys.stderr)
        return None
    
    r = requests.post(
        "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal",
        json={"app_id": APP_ID, "app_secret": APP_SECRET}
    )

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_card.py (reported line 21)May include surrounding context.

python
print("❌ 未配置飞书应用信息,请设置环境变量 FEISHU_APP_ID 和 FEISHU_APP_SECRET", file=sys.stderr)
        return None
    
    r = requests.post(
        "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal",
        json={"app_id": APP_ID, "app_secret": APP_SECRET}
    )

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This request sends card content and recipient identifiers to Feishu's messaging API, enabling external data transmission and message delivery. In the context of a local recommendation skill, that outbound messaging path is more dangerous because it can relay user data or generated content to enterprise chats without being clearly tied to the stated purpose.

Content

Scanner excerpt · scripts/feishu_card.py (reported line 67)May include surrounding context.

python
url = f"https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type={receive_id_type}"
        body = {"receive_id": receive_id, "msg_type": "interactive", "content": json.dumps(card)}

    r = requests.post(url, headers=headers, json=body)
    result = r.json()
    
    if result.get("code") == 0:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Docstrings and printed user messages are presented only in Chinese, with no indication that the user can choose another language. This constitutes a language-policy concern because the skill imposes a specific locale on all users rather than offering opt-in or fallback behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The fallback search implementation executes an external shell command even though the skill's purpose is only to perform local-recommendation searches. This unnecessarily expands the attack surface from web querying to local command execution, and in this implementation the raw query is embedded into the shell command, enabling command injection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The fallback search path builds a shell command containing the user's query and executes it via subprocess, which will send search content to an external tool/service. Although missing EXA configuration is disclosed elsewhere, this execution/data-transmission path itself has no user-facing warning, confirmation, or explanatory comment beyond a generic fallback note.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

The fallback path builds a shell command with untrusted input (query) and executes it with shell=True, creating a classic command-injection sink. Because the skill is search-facing and queries may come from users or upstream agents, an attacker could inject shell metacharacters and execute arbitrary local commands in the agent environment.

Content

Scanner excerpt · scripts/search_module.py (reported line 59)May include surrounding context.

python
# 兜底实现
    import subprocess
    cmd = f"mcporter call exa.web_search_exa query='{query}' numResults={num_results}"
    result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
    return result.stdout

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documented trigger formats and supported types are entirely Chinese, and the file does not indicate that users may invoke the skill in other languages or that Chinese is a required locale. This can violate a language/locale policy when a skill implicitly mandates one language without user opt-in or justification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest and main description present the skill as a recommendation generator. These lines add channel-specific behavior—JSON transformation and card sending for Feishu—which changes the operational behavior from content generation to integration with an external delivery mechanism.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The skill directs the agent to keep output fully consistent across Feishu, webchat, group chat, and private chat, but nowhere provides for language or locale selection by the user. Combined with the rest of the Chinese-only instructions, this reinforces a fixed-language behavior across contexts rather than an opt-in choice.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The inline comment says the code will 'directly use mcporter' as a fallback, which suggests a straightforward library or executable invocation. The implemented behavior instead constructs a shell command string and executes it with shell=True, adding a materially different execution model and capability.

Content

No source excerpt is available for this finding.