Back to skill

Security audit

Google SERP Search Mobile API

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Just Serp search API wrapper, but it handles the API key through command-line arguments and sends search/location data to a third-party API without a clear privacy warning.

Review this skill before installing if your searches, locations, business identifiers, or SERP targets are sensitive. Prefer a version that reads JUST_SERP_API_KEY directly from the environment instead of a command-line argument, and avoid sending precise location or confidential query data unless you intend to share it with Just Serp API.

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

Warning
Location
SKILL.md:60
Finding

API Key Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:60-68, bin/run.mjs:240-255, and bin/run.mjs:307-326
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: Medium

Vulnerable Code

SKILL.md:60

bash
node {baseDir}/bin/run.mjs --operation "searchMobile" --api-key "$JUST_SERP_API_KEY" --params-json '{"query":"<query>"}'

bin/run.mjs:240-255

javascript
if (!args.apiKey) {
  fail("Missing required --api-key argument.");
}

const params = parseParams(args.paramsJson);
applyDefaults(operation, params);
validateRequired(operation, params);

const baseUrl = manifest.baseUrl;
const url = new URL(operation.path, ensureBaseUrl(baseUrl));
applyPathParams(operation, params, url);
applyQueryParams(operation, params, url);

const requestInit = {
  headers: {
    "accept": "application/json",
    "X-API-Key": args.apiKey,
  },

bin/run.mjs:307-326

javascript
function parseArgs(argv) {
  const parsed = { apiKey: null, operation: null, paramsJson: "{}" };
  for (let index = 0; index < argv.length; index += 1) {
    const flag = argv[index];
    const value = argv[index + 1];
    if (flag === "--operation") {
      parsed.operation = value;
      index += 1;
      continue;
    }
    if (flag === "--params-json") {
      parsed.paramsJson = value;
      index += 1;
      continue;
    }
    if (flag === "--api-key") {
      parsed.apiKey = value;
      index += 1;
      continue;
    }
    fail(`Unknown argument "${flag}".`);
  }

Technical Analysis

The documented invocation expands JUST_SERP_API_KEY in the shell and passes its value to Node.js as the value of --api-key. The application then obtains the secret from process.argv and places it in the outbound X-API-Key header.

Although the outbound request uses a fixed HTTPS endpoint, passing a secret through command-line ...[truncated 1641 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the --api-key command-line option and read the credential directly from the environment inside run.mjs:

    javascript
    const apiKey = process.env.JUST_SERP_API_KEY;
    if (!apiKey) {
      fail("Missing required JUST_SERP_API_KEY environment variable.");
    }
    
  2. Use the environment-derived value only when constructing the authentication header:

    javascript
    const requestInit = {
      headers: {
        accept: "application/json",
        "X-API-Key": apiKey,
      },
      method: operation.method,
    };
    
  3. Update the documented invocation so that no secret is included in the argument vector:

    bash
    JUST_SERP_API_KEY="$JUST_SERP_API_KEY" node {baseDir}/bin/run.mjs \
      --operation "searchMobile" \
      --params-json '{"query":"<query>"}'
    

    If the variable is already exported, omit the assignment entirely.

  4. Avoid printing the key in errors, debug output, telemetry, or request logs. If request diagnostics are added later, explicitly redact X-API-Key.

  5. Rotate any API key suspected of having been exposed through process inspection or command logging, and apply quota and usage alerts to reduce the impact of future disclosure.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill invokes a network-capable helper (node {baseDir}/bin/run.mjs) and requires an API key, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates a policy/visibility gap: a host may not clearly constrain or surface the skill's outbound network behavior, increasing the risk of unintended external requests or misuse of user-supplied query parameters against a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code sends the user's query and optional localization parameters such as location, country, and language to an external API via fetch. The file contains no confirmation prompt, visible log/print disclosure before transmission, or other user-facing warning that user-provided data is being sent off-box.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This skill sends user-provided search queries and optional localization data such as location, country, UULE, and business/entity identifiers to a third-party service at api.justserpapi.com, but the manifest text shown does not provide any user-facing privacy disclosure or consent warning. Search terms and location signals can reveal sensitive interests, identity, or whereabouts, so silent transmission to an external provider creates a real privacy risk even if the API behavior is otherwise legitimate.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation describes a search operation that transmits user-supplied query and localization parameters to an external third-party API, but it does not clearly warn users that their inputs may leave the local system and be processed externally. This can lead to unintended disclosure of sensitive searches, locations, or business identifiers if an agent passes user data without explicit notice or consent.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.