Back to skill

Security audit

Google Search Skill

Security checks for vulnerabilities and agentic risk

Overview

This Google-search skill does what it says, but its documented runtime path can execute an unpinned npm package before the reviewed code runs.

Review before installing. The search functionality itself is straightforward, but run it only in an environment where you are comfortable with queries being sent to Serper.dev and where `SERPER_API_KEY` is available. Prefer a pinned, lockfile-backed local `tsx` installation or compiled JavaScript instead of running the documented unpinned `npx tsx` commands directly.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:23
Finding

Unpinned Runtime Dependency Download and Execution via npx

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:23-34
Additional Location: README.md:55-104
Vulnerability Type: Unpinned runtime dependency execution
Risk Level: Medium

Vulnerable Code Snippet

bash
npx tsx $SCRIPT_DIR/google-search.ts search "query" [--num 10] [--time day|week|month|year] [--country us] [--lang en]
npx tsx $SCRIPT_DIR/google-search.ts news "query" [--num 10]
npx tsx $SCRIPT_DIR/google-search.ts images "query"
npx tsx $SCRIPT_DIR/google-search.ts videos "query"
npx tsx $SCRIPT_DIR/google-search.ts places "query"
npx tsx $SCRIPT_DIR/google-search.ts shopping "query"
npx tsx $SCRIPT_DIR/google-search.ts scholar "query" [--year 2023]
npx tsx $SCRIPT_DIR/google-search.ts patents "query"
npx tsx $SCRIPT_DIR/google-search.ts suggest "query"
npx tsx $SCRIPT_DIR/google-search.ts credits

The same unpinned npx tsx execution pattern appears in README.md:55-104.

The project does not declare tsx in package.json:

json
{
  "name": "google-search",
  "version": "1.0.0",
  "description": "Google Search via Serper.dev API for OpenClaw",
  "private": true
}

Technical Analysis

The documented execution path invokes tsx through npx, but the project neither declares an exact tsx dependency nor includes a lockfile. When tsx is not already installed locally, npx may resolve, download, and execute a mutable package from the configured npm registry.

Consequently, the reviewed Skill package does not fully determine the code executed when its documented commands are followed. Registry compromise, package-account compromise, dependency substitution through a malicious registry configuration, or an unexpectedly changed upstream release could introduce arbitrary code before the local search script starts.

This also conflicts with the README's “zero dependencies” claim: although no dependency is declared in package.json, executing TypeScript as documented relies on an external runtime package.

Attack

...[truncated 1402 chars]

Remediation
View remediation

Remediation Suggestions

  1. Declare tsx as an exact development or runtime dependency rather than resolving it implicitly:

    json
    {
      "devDependencies": {
        "tsx": "EXACT_REVIEWED_VERSION"
      }
    }
    
  2. Generate and commit a lockfile, and install dependencies with a deterministic command such as npm ci.

  3. Invoke the pinned local binary through a package script or explicit local path instead of allowing an undeclared package download:

    json
    {
      "scripts": {
        "search": "tsx scripts/google-search.ts"
      }
    }
    
  4. In automated or security-sensitive environments, configure npx to reject implicit package installation, or avoid npx entirely for this execution path.

  5. Prefer compiling the TypeScript sources into reviewed JavaScript during a controlled build and distributing the compiled artifact so runtime package retrieval is unnecessary.

  6. Pin and verify the dependency source using lockfile integrity metadata, trusted registry configuration, and routine supply-chain review.

  7. Update the “zero dependencies” documentation to accurately disclose the runtime tooling requirement and its installation method.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (26)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README promotes sending user search queries through Serper.dev to Google but does not clearly warn that queries and associated metadata are transmitted to a third-party service. In an agent context, prompts may contain sensitive business, personal, or credential-adjacent information, so the lack of an explicit disclosure can lead to unintentional data leakage and privacy/compliance issues.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill does not clearly warn that user queries are transmitted to the third-party Serper.dev API. This is a genuine privacy and compliance issue because users or downstream agents may disclose sensitive prompts, identifiers, or proprietary information without informed consent or awareness of external processing.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation guidance is overly broad: 'Use this skill for any Google search request' encourages invocation for a very wide range of user prompts without meaningful scoping or consent checks. In agent contexts, broad triggers can cause unnecessary data sharing with a third-party search provider and increase the chance of the skill being selected when a safer/local alternative would suffice.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The skill instructs use of npx tsx without pinning an exact package version, which can cause execution of whatever version resolves at runtime from the local/project/npm context. That creates a supply-chain and reproducibility risk: a compromised or incompatible tsx package version could be fetched or invoked unexpectedly when the skill is used.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The documented command relies on unpinned npx tsx, which means the executed tool version is not fixed. In a skill that may be run automatically, this increases supply-chain exposure and can lead to arbitrary code execution through a malicious or unexpected package resolution path.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

Using npx tsx without an exact version allows the runtime environment to decide what package version is executed. This undermines integrity and reproducibility and can expose users to compromised upstream packages or unexpected behavior changes.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The command at this line invokes npx tsx without version pinning, leaving package selection to mutable external state. Because npx may download or run packages dynamically, this presents a meaningful supply-chain risk for anyone following the skill instructions.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

This usage of unpinned npx tsx creates a trust boundary with the npm ecosystem at execution time. A compromised package release or environment manipulation could result in unintended code execution or inconsistent behavior across systems.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The command depends on an unversioned tsx runner, which is a real supply-chain weakness rather than a mere style issue. In the context of agent skills, users may execute commands verbatim, so mutable package resolution increases the chance of unsafe code being run.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

At this line, npx tsx is referenced without version control, which permits unexpected or malicious package versions to be executed. This is particularly relevant because the skill is operational documentation intended to be copied and run directly.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The skill's command uses unpinned npx tsx, exposing consumers to runtime dependency substitution and upstream package compromise risks. Because this is repeated across multiple invocation examples, the unsafe pattern is systemic in the skill guidance.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

This command again relies on unpinned npx tsx, which can fetch or resolve package code dynamically from npm-related sources. That creates a practical supply-chain risk and weakens assurance that the documented script execution is stable and trusted.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The final command example repeats the same unpinned npx tsx execution pattern, preserving the risk of arbitrary or unexpected package code being run. Since the skill encourages direct command execution, users are likely to inherit this unsafe dependency practice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The helper reads a sensitive credential from the SERPER_API_KEY environment variable, but the file does not include any comment, docstring, or user-facing notice explaining this sensitive dependency. Under the rule, access to credentials should have some form of disclosure unless already documented elsewhere.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/lib/serper.ts:4