Back to skill

Security audit

serper

Security checks for vulnerabilities and agentic risk

Overview

This web-search skill is mostly transparent about its purpose, but it automatically fetches search-result pages without enough destination safeguards.

Review before installing if you run agents on a machine with access to private networks, local admin panels, cloud metadata services, or sensitive intranet sites. Use a restricted network environment where possible, keep the Serper key in a private skill-local file, avoid sensitive search queries, and prefer pinned dependencies.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/search.py:90
Finding

Unrestricted Fetching of Search Result URLs Enables SSRF

Content
View full analysis
Optional[str]: """Fetch a URL and extract clean readable text using trafilatura.""" try: downloaded = trafilatura.fetch_url(url, config=_traf_config) if not downloaded: return None return trafilatura.extract(downloaded, include_links=False, include_images=False, include_tables=True, deduplicate=True) or None except Exception: return None ``` Search-result URLs are submitted to this function concurrently: ```python for i, r in enumerate(results): if r.get("url"): futures[i] = pool.submit(_extract_content, r["url"]) ``` ### Technical Analysis The Skill downloads URLs supplied in Serper API responses without validating their scheme, hostname, resolved address, port, or redirect destination. Full-page retrieval is necessary for the declared content-extraction feature, but unrestricted destination access exceeds the minimum network privileges required. An attacker who can influence an indexed search result, compromise a result page, or otherwise affect the API response could provide a URL that directly or indirectly targets a service reachable from the machine running the Skill. The implementation contains no checks blocking loopback, private, link-local, reserved, multicast, or cloud metadata addresses. Redirects are also not revalidated by the Skill. The three-second downloader timeout limits request duration but does not prevent connection attempts or disclosure of quickly returned content. ### Attack Path 1. An attacker causes a malicious page to appear in results for a query likely to be submitted through the Skill. 2. Serper returns the attacker-controlled URL as an organic or news result. 3. The attacke ...[truncated 1059 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:33
Finding

Unpinned Third-Party Dependency Creates Supply-Chain Exposure

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
README.md:51
Finding

API Key Setup May Create a Broadly Readable Shared Plaintext File

Content
View full analysis
> ~/.openclaw/.env ``` ``` ### Technical Analysis The setup command appends the API key to a plaintext file without first creating the file with restrictive permissions or verifying its existing ownership and mode. If the file does not exist, its permissions depend on the user's `umask`; under a permissive configuration, other local users may be able to read it. The global `~/.openclaw/.env` location also has broader scope than the skill-local `.env` loaded by `scripts/search.py`. Storing the key in a shared environment file may expose it to unrelated OpenClaw components that read the same file. The application itself only selects `SERPER_API_KEY` or `SERP_API_KEY` for transmission to the fixed Serper HTTPS endpoints. No evidence was found that unrelated values from the `.env` file are transmitted. ### Attack Path 1. A user follows the documented `echo` command. 2. The global `.env` file is created under a permissive `umask`, already has permissive permissions, or is consumed by unrelated components. 3. Another local user or unrelated process reads the file or inherits its contents. 4. The Serper API key is recovered and used without authorization. ### Impact Assessment An attacker who obtains the key could: - Consume the victim's Serper query quota. - Cause rate limiting or service charges associated with the account. - Use the key from another system until it is revoked or expires. This finding does not expose operating-system administrator privileges. Its scope is primarily the Serper account, associated quota, and any usage records tied to the ...[truncated 18 chars]
Remediation
View remediation
> ~/.openclaw/skills/serper/.env ``` 3. Verify that the parent directory is owned by the intended user and is not writable by other users. 4. Refuse to use a credential file that is owned by another user or has group/world-readable permissions. 5. Avoid displaying the real key in terminal history where practical; provide an interactive setup command or secret-manager integration. 6. Document key rotation and revocation procedures. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (11)

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

md
# =============================================================================
# Auto-load .env from skill directory
# =============================================================================
def _load_env_file():
    env_path = Path(__file__).parent.parent / ".env"

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

md
# =============================================================================
# Auto-load .env from skill directory
# =============================================================================
def _load_env_file():
    env_path = Path(__file__).parent.parent / ".env"

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

md
# =============================================================================
# Auto-load .env from skill directory
# =============================================================================
def _load_env_file():
    env_path = Path(__file__).parent.parent / ".env"

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

python
# =============================================================================
# Auto-load .env from skill directory
# =============================================================================
def _load_env_file():
    env_path = Path(__file__).parent.parent / ".env"

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

python
# =============================================================================
# Auto-load .env from skill directory
# =============================================================================
def _load_env_file():
    env_path = Path(__file__).parent.parent / ".env"

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

python
# Auto-load .env from skill directory
# =============================================================================
def _load_env_file():
    env_path = Path(__file__).parent.parent / ".env"
    if env_path.exists():
        with open(env_path) as f:
            for line in f:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README explicitly advertises that user queries are sent to the Serper API and that returned URLs are then fetched for full-page extraction, but it does not warn users that their queries and subsequent third-party page requests may disclose sensitive research interests, identifiers, or internal browsing context. In a search/scraping skill, this omission is meaningful because the core functionality inherently transmits data off-box and interacts with untrusted external sites.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises network access and use of an API key from the environment, but it does not declare any explicit tool scope or permissions boundaries. That creates an authorization and transparency gap: an agent may invoke a capability that sends user queries off-box and accesses secrets without clear policy controls or user-visible restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states that it performs a Serper API search and then fetches third-party pages for full-text extraction, but it does not warn users that their queries will be transmitted to an external service and that content will be retrieved from arbitrary websites. This is a privacy and data-handling risk because sensitive prompts, identifiers, or internal research topics could be disclosed to outside parties without informed consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The locale rules force non-English and region-specific behavior automatically, which can silently alter where queries are sent and what jurisdiction's results are retrieved without user choice. While not an exploit by itself, this can create privacy, bias, and expectation issues by inferring language/location context and transmitting it to external services.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The locale section says the default is global with English results, which imposes a language preference by default. The documentation does allow overrides with --hl and --gl, but it does not present language choice as an explicit opt-in before defaulting to English.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.