Back to skill

Security audit

投资研究报告助手

Security checks for vulnerabilities and agentic risk

Overview

This investment-analysis skill mostly matches its stated purpose, but it ships an apparent hard-coded Tavily API key and reads a shared secrets file more broadly than needed.

Review this skill before installing. Revoke or remove the shipped Tavily key, use your own key through a minimal environment variable or skill-specific secret file, and assume stock symbols, company names, and industry queries may be sent to Tavily during analysis.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
tavily_config.py:10
Finding

Hard-Coded Tavily API Credential Committed to the Repository

Content
View full analysis

Vulnerability Details

File Location: tavily_config.py:10
Vulnerability Type: Plaintext hard-coded API credential
Risk Level: High

Vulnerable Code

python
TAVILY_API_KEY = "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"

Technical Analysis

The repository contains a Tavily API credential directly embedded in source code. Anyone with access to the repository, distributed Skill package, source archive, build artifacts, or repository history can recover the credential without authentication.

The get_tavily_api_key() function returns this value to callers. Although the primary analysis implementation currently obtains its Tavily key from the environment instead of importing this configuration module, the exposed key remains independently usable. Removing the file from the latest revision would also be insufficient if the credential remains available in version-control history or previously distributed packages.

Attack Path

  1. An attacker obtains a copy of the repository or Skill package.
  2. The attacker opens tavily_config.py.
  3. The attacker extracts the plaintext Tavily API key from line 10.
  4. The attacker configures a Tavily client or sends Tavily API requests using the exposed key.
  5. Requests consume the legitimate account's quota and may incur charges or interfere with authorized service usage.
  6. Attribution becomes difficult because authorized and unauthorized requests use the same credential.

Impact Assessment

The attacker obtains the privileges assigned to this Tavily API key. Potential consequences include:

  • Unauthorized Tavily API usage.
  • Search-quota exhaustion and denial of service to legitimate users.
  • Potential billing exposure, depending on the associated account plan.
  • Access to any Tavily features authorized for the key.
  • Loss of request accountability and audit integrity.

There is no evidence that the key grants local operating-system privileges or ...[truncated 89 chars]

Remediation
View remediation

Remediation Suggestions

  1. Revoke the exposed Tavily key immediately and generate a replacement.
  2. Remove the credential from the current source tree and all version-control history.
  3. Store the replacement in an environment variable, operating-system credential store, or managed secret service.
  4. Delete tavily_config.py if it is obsolete, or replace the value with a nonfunctional placeholder.
  5. Add local secret files to .gitignore and ensure generated packages exclude them.
  6. Introduce pre-commit and continuous-integration secret scanning.
  7. Review Tavily account logs and usage records for unauthorized requests.
  8. Apply usage limits and alerts where supported by the provider.

T09 · Insecure Skill Coding Practices

Warning
Location
analyze_stock.py:49
Finding

Shared OpenClaw Environment File Is Loaded Beyond the Required Secret Scope

Content
View full analysis

Vulnerability Details

File Location: analyze_stock.py:49-57
Vulnerability Type: Excessive credential-file access and process environment exposure
Risk Level: Medium

Vulnerable Code

python
import os
from dotenv import load_dotenv
env_path = os.path.expanduser("~/.openclaw/.env")
if os.path.exists(env_path):
    load_dotenv(env_path)
api_key = os.getenv("TAVILY_API_KEY", "")
if not api_key:
    return None
return api_key

Technical Analysis

The Skill requires only TAVILY_API_KEY, but load_dotenv() parses the entire shared ~/.openclaw/.env file. Every variable contained in that file may consequently become available in the Skill process environment.

This exceeds the minimum secret-access scope needed for optional Tavily searches. Imported packages and future code executing in the same process can access unrelated credentials through os.environ. The audited implementation does not intentionally read or transmit other variables, so this finding represents unnecessary exposure and increased blast radius rather than confirmed secret exfiltration.

Attack Path

  1. A user stores TAVILY_API_KEY and unrelated service credentials in the shared OpenClaw .env file.
  2. The user invokes analyze_stock().
  3. The Skill loads every entry from the shared file into its process environment.
  4. A compromised dependency, injected module, debugging component, or later code change reads unrelated values from os.environ.
  5. Those values can then be logged, misused locally, or transmitted externally by the compromised component.

Exploitation requires additional malicious or compromised code executing in the same process; no such exfiltration code was identified in this project.

Impact Assessment

The accessible scope can include all credentials and configuration values stored in ~/.openclaw/.env, not only the Tavily key. Exposure is constrained to code running with the curre ...[truncated 268 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prefer receiving TAVILY_API_KEY through an already-minimized process environment.
  2. Use a Skill-specific configuration or secret file containing only the Tavily credential.
  3. If file-based configuration is unavoidable, parse only the required key without exporting all entries into os.environ.
  4. Validate that the extracted value has the expected format and reject malformed values.
  5. Restrict secret-file permissions to the owning user.
  6. Run the Skill with a minimal environment and only the credentials required for the current operation.
  7. Review imported dependencies and pin approved versions to reduce the likelihood of environment-variable harvesting by a compromised package.

T09 · Insecure Skill Coding Practices

Warning
Location
demo_tavily.py:15
Finding

Tavily Demo Loads All Secrets from the Shared OpenClaw Environment File

Content
View full analysis

Vulnerability Details

File Location: demo_tavily.py:15-20
Vulnerability Type: Excessive credential-file access and process environment exposure
Risk Level: Medium

Vulnerable Code

python
env_path = os.path.expanduser("~/.openclaw/.env")
if os.path.exists(env_path):
    load_dotenv(env_path)

api_key = os.getenv("TAVILY_API_KEY", "")
if not api_key:

Technical Analysis

The demonstration script needs only the Tavily API key, but it loads every variable from the shared OpenClaw environment file. This unnecessarily exposes unrelated credentials to the demo process and all imported dependencies, including the Tavily client and dotenv package.

The script sends only fixed public-company search queries to Tavily, and no code was found that intentionally sends unrelated environment variables. Nevertheless, broad secret loading violates least-privilege principles and increases the consequences of a compromised dependency or future modification.

Attack Path

  1. The shared OpenClaw .env file contains Tavily and unrelated service credentials.
  2. A user runs demo_tavily.py.
  3. load_dotenv() loads all file entries into the process environment.
  4. Any malicious or compromised module executing in that process reads unrelated credentials.
  5. The compromised component misuses or exfiltrates those credentials.

This path depends on another malicious component running in the process. The audited demo itself does not perform credential exfiltration.

Impact Assessment

Exposure may encompass every secret stored in the shared environment file. The resulting privileges depend on those unrelated credentials and could include access to external APIs or services. No local privilege escalation, persistence, or access to SSH keys was found.

Remediation
View remediation

Remediation Suggestions

  1. Remove implicit loading of the global OpenClaw .env file from the demo.
  2. Require TAVILY_API_KEY to be explicitly supplied in a minimized environment.
  3. Alternatively, use a dedicated demo configuration file containing only the Tavily key.
  4. Avoid exporting unrelated configuration entries into the process environment.
  5. Restrict local secret-file permissions and document secure setup procedures.
  6. Pin and verify dependencies that execute in the same process.
  7. Add a regression test confirming that unrelated environment-file entries are not loaded.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Static analysis suggests the skill may be oriented toward environment or dependency testing rather than the declared investment-analysis workflow. That mismatch can hide real operational behavior and causes users to over-trust the skill's outputs and external interactions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Static analysis suggests the skill may be oriented toward environment or dependency testing rather than the declared investment-analysis workflow. That mismatch can hide real operational behavior and causes users to over-trust the skill's outputs and external interactions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Static analysis suggests the skill may be oriented toward environment or dependency testing rather than the declared investment-analysis workflow. That mismatch can hide real operational behavior and causes users to over-trust the skill's outputs and external interactions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Static analysis suggests the skill may be oriented toward environment or dependency testing rather than the declared investment-analysis workflow. That mismatch can hide real operational behavior and causes users to over-trust the skill's outputs and external interactions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Static analysis suggests the skill may be oriented toward environment or dependency testing rather than the declared investment-analysis workflow. That mismatch can hide real operational behavior and causes users to over-trust the skill's outputs and external interactions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Static analysis suggests the skill may be oriented toward environment or dependency testing rather than the declared investment-analysis workflow. That mismatch can hide real operational behavior and causes users to over-trust the skill's outputs and external interactions.

Content

No source excerpt is available for this finding.

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 · SKILL.md (reported line 43)May include surrounding context.

md
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · SKILL.md (reported line 91)May include surrounding context.

md
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · SKILL.md (reported line 186)May include surrounding context.

md
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · TAVILY_README.md (reported line 29)May include surrounding context.

md
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · TAVILY_README.md (reported line 31)May include surrounding context.

md
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · TAVILY_README.md (reported line 32)May include surrounding context.

md
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · analyze_stock.py (reported line 47)May include surrounding context.

python
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · demo_tavily.py (reported line 6)May include surrounding context.

python
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · demo_tavily.py (reported line 14)May include surrounding context.

python
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · demo_tavily.py (reported line 15)May include surrounding context.

python
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · demo_tavily.py (reported line 24)May include surrounding context.

python
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · demo_tavily.py (reported line 67)May include surrounding context.

python
"""
Tavily News Search Demo - 演示如何使用 Tavily 搜索公司相关新闻

API Key 配置: ~/.openclaw/.env 中的 TAVILY_API_KEY
"""

import os

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 · analyze_stock.py (reported line 51)May include surrounding context.

python
def get_tavily_api_key():
    """从环境变量或 .env 文件获取 API Key"""
    # 尝试加载 ~/.openclaw/.env
    env_path = os.path.expanduser("~/.openclaw/.env")
    if os.path.exists(env_path):
        load_dotenv(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 · demo_tavily.py (reported line 16)May include surrounding context.

python
def get_tavily_api_key():
    """从环境变量或 .env 文件获取 API Key"""
    # 尝试加载 ~/.openclaw/.env
    env_path = os.path.expanduser("~/.openclaw/.env")
    if os.path.exists(env_path):
        load_dotenv(env_path)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill declares a tool (tavily-search) but does not declare explicit permission scope for other detected capabilities such as environment-variable access and file writing. That gap weakens transparency and least-privilege guarantees, making it easier for a user or platform to misjudge what the skill may access or modify.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation describes automatic third-party news searches using stock name, code, company, product, and industry queries, but does not clearly warn that these inputs will be transmitted to Tavily. This is a privacy and data-governance issue because portfolio interests, watchlists, or proprietary research targets can be exposed to an external service without explicit user awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README states that stock analysis will automatically perform external Tavily searches, but it does not clearly warn users that query terms such as stock codes, company names, and research interests will be transmitted to a third-party service. In an investment-research context, outbound requests can leak sensitive user intent, holdings, or proprietary watchlists, so the omission is a real privacy and transparency issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file-level description, usage text, runtime messages, and generated report content are all written in Chinese, and the skill does not offer any language or locale choice to the user. This creates a natural-language policy issue because the skill enforces a specific language rather than allowing user selection or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The stated purpose is stock investment analysis using baostock and Tavily search, but the implementation accesses a specific user-home configuration file at ~/.openclaw/.env to retrieve secrets. Reading from a hidden per-user credential store is a broader capability than ordinary market analysis logic and is not disclosed in the manifest.

Content

No source excerpt is available for this finding.