Back to skill

Security audit

OpenClaw Tavily Search (lym)

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Tavily web-search helper that uses a Tavily API key and sends search queries to Tavily, with the credential behavior disclosed.

Install this only if you intend to use Tavily search. Prefer providing TAVILY_API_KEY through the environment or a secret manager; if you use ~/.openclaw/.env, understand the skill can read that file to extract the Tavily key. Search queries and the Tavily API key are sent to Tavily as part of normal operation.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (6)

Tainted flow: 'req' from os.environ.get (line 51, 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/tavily_search.py (reported line 58)May include surrounding context.

python
method="POST",
    )

    with urllib.request.urlopen(req, timeout=30) as resp:
        body = resp.read().decode("utf-8", errors="replace")

    try:

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

Accessing ~/.openclaw/.env is credential access behavior and broadens the skill's access to local secrets beyond what is strictly necessary for a simple search wrapper. In an agent ecosystem, local secret-file reads are sensitive because they create an opportunity for accidental overreach and weaken least-privilege boundaries even if the current code only extracts TAVILY_API_KEY.

Content

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

python
if key:
        return key.strip()

    env_path = pathlib.Path.home() / ".openclaw" / ".env"
    if env_path.exists():
        try:
            txt = env_path.read_text(encoding="utf-8", errors="ignore")

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/tavily_search.py (reported line 37)May include surrounding context.

python
key = load_key()
    if not key:
        raise SystemExit(
            "Missing TAVILY_API_KEY. Set env var TAVILY_API_KEY or add it to ~/.openclaw/.env"
        )

    payload = {

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill invokes a Python script that uses environment secrets, reads a local .env file path, and performs outbound network access, but the manifest declares no explicit tool scope or permissions. This creates an authorization gap where an agent or reviewer cannot easily determine what capabilities the skill requires, increasing the risk of unintended secret access and external data exfiltration.

Content

No source excerpt is available for this finding.

External Transmission

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

python
import sys
import urllib.request

TAVILY_URL = "https://api.tavily.com/search"


def load_key():

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill expands its privilege surface by reading credentials from ~/.openclaw/.env, which is broader than a narrowly scoped web-search helper needs if the runtime can inject secrets via environment variables. Reading a general local credential file creates unnecessary file-access capability and may expose unrelated secrets if the file format or parsing changes, especially in agent environments where least privilege matters.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.