Back to skill

Security audit

Keyapi Google Search

Security checks for vulnerabilities and agentic risk

Overview

This Google search skill is functional, but it bundles a broader KeyAPI MCP runner that can use the API token with non-Google tools and stores tokens/results locally.

Review before installing. Use only explicit --platform google commands with web_search or image_search, avoid entering sensitive searches unless you are comfortable with local caching, clear .keyapi-cache when needed, and protect or avoid the plaintext .env token file. A Google-only runner with an allowlist would be safer.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill requires access to the KEYAPI_TOKEN environment variable via metadata but does not declare explicit permissions in a way that transparently communicates its sensitive capability surface. This matters because the skill also instructs users to run Node-based commands against a remote MCP endpoint, so undisclosed env access can expose secrets to code paths the user may not expect.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documented behavior claims a narrow Google search skill, but the finding indicates the underlying workflow can enumerate tools, inspect schemas, invoke arbitrary MCP tools, save output to local paths, and operate across platforms. That mismatch is dangerous because users may grant trust and secrets based on the stated limited purpose while the actual capability set is substantially broader, enabling unintended data access, remote actions, or local data persistence.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The runner is a generic MCP client that can invoke arbitrary tools and is not constrained to Google web/image search as the skill metadata claims. This creates a clear scope mismatch: a consumer expecting a narrow Google-search skill could instead gain broad remote capability through the same token and server, increasing the attack surface and enabling misuse beyond the declared purpose.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The code performs secondary calls to a cover-image conversion tool that are unrelated to the stated Google search functionality. Hidden auxiliary network actions can expand data exposure and capabilities beyond what users expect from a search-only skill, especially when arbitrary remote content is processed and rewritten.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
Listing all remote tools and retrieving arbitrary schemas gives the skill introspection capability that is unnecessary for a narrowly scoped Google search integration. This can expose additional server capabilities to users or downstream agents, making it easier to pivot into unintended tool use and undermining least privilege.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The arbitrary --platform option lets the caller construct MCP URLs for non-Google services, directly contradicting the stated Google-search purpose of the skill. In context, this materially increases risk because the skill can be repurposed to access unrelated remote platforms and tools under the same trusted wrapper.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill instructs the user to cache API responses under .keyapi-cache but does not warn that both search queries and returned content will be written to disk. Search queries may contain sensitive research topics, company plans, credentials pasted by mistake, or regulated data, and persisted responses can remain accessible to other local users, backups, or later processes.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The code persists the API token to a local .env file automatically after interactive entry, which can leave credentials stored on disk longer than the user expects. In shared environments, repositories, or poorly permissioned directories, this increases the chance of credential disclosure and subsequent unauthorized API use.

Missing User Warnings

Medium
Confidence
83% confidence
Finding
API responses are written to a local cache by default, but the user is not clearly warned that remote data will be retained on disk. Search queries and returned content may include sensitive or proprietary information, so silent persistence increases privacy and data-handling risk, especially on shared systems.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Content
Execute tool calls and persist responses to the local cache to avoid redundant API calls.

**Calling a tool:**

```bash
# Single call with pretty output
Confidence
91% confidence
Finding
The workflow text describes calling a generic <tool_name> and the finding flags tool:* access, which suggests the operator can invoke any tool exposed by the remote MCP server rather than only the two search endpoints. In the context of a skill advertised as a Google search helper, unrestricted tool access materially increases risk because a compromised, expanded, or misunderstood MCP server could expose unrelated capabilities that read data, perform actions, or write files.

Static analysis

No suspicious patterns detected.