Back to skill

Security audit

Custom Grok Search

Security checks for vulnerabilities and agentic risk

Overview

This skill is useful for Grok search and chat, but it can mix user-level API credentials with workspace-controlled endpoints, which deserves careful review before installation.

Install only if you trust the workspaces where it will run and the endpoint you configure. Prefer official xAI endpoints with an explicitly provided key, avoid using sensitive prompts or images with third-party proxies, and do not let untrusted projects supply .env values such as XAI_BASE_URL.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/shared.mjs:23
Finding

Overbroad Access to Shared Credential Files

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/shared.mjs:47
Finding

Workspace-Controlled API Endpoint Can Receive a Separately Sourced Official Credential and Private User Data

Content
View full analysis
Remediation
View remediation
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Reading process.cwd()/.env gives the skill access to any secrets present in the current working directory, not just keys dedicated to this integration. In an agent environment, that can unintentionally expose unrelated credentials and expands the blast radius far beyond simple search functionality.

Content

Scanner excerpt · scripts/shared.mjs (reported line 25)May include surrounding context.

js
export function loadEnvFiles() {
  const candidates = [
    path.join(process.cwd(), ".env"),
    path.join(os.homedir(), ".openclaw", ".env"),
  ];
  const loaded = {};

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

Reading ~/.openclaw/.env accesses persistent user-level secrets outside the skill boundary. Combined with support for custom Grok-compatible proxies, this can enable silent reuse of a user's API key with a third-party service, creating a significant credential exposure risk.

Content

Scanner excerpt · scripts/shared.mjs (reported line 26)May include surrounding context.

js
export function loadEnvFiles() {
  const candidates = [
    path.join(process.cwd(), ".env"),
    path.join(os.homedir(), ".openclaw", ".env"),
  ];
  const loaded = {};
  for (const p of candidates) {

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises functionality that uses environment variables and outbound network access, but the manifest does not declare any tool scope or permission boundaries. This weakens reviewability and policy enforcement because an agent or operator cannot easily see that the skill may read credentials and send data to external services before use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation encourages use of public-benefit sites or third-party Grok-compatible proxies, but does not clearly warn that prompts, search queries, images, metadata, and possibly API credentials may be disclosed to untrusted operators. In this skill's context, users may send sensitive research terms or uploaded images through those intermediaries, creating a meaningful privacy and data-handling risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/config.md (reported line 17)May include surrounding context.

text

默认值:
- base URL:`https://api.x.ai/v1`
- model:`grok-4-1-fast`

## 2)公益站 / 第三方 Grok 兼容代理模式

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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/shared.mjs (reported line 74)May include surrounding context.

js
```

默认值:
- base URL:`https://api.x.ai/v1`
- model:`grok-4-1-fast`

## 2)公益站 / 第三方 Grok 兼容代理模式

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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/shared.mjs (reported line 75)May include surrounding context.

js
```

默认值:
- base URL:`https://api.x.ai/v1`
- model:`grok-4-1-fast`

## 2)公益站 / 第三方 Grok 兼容代理模式

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation explicitly encourages use of third-party or public proxy endpoints for Grok-compatible APIs and instructs users to place proxy API keys in automatically loaded .env files, but it provides no warning that prompts, search queries, account metadata, and credentials may be exposed to untrusted operators. In this skill context, that omission materially increases the chance that users will unknowingly route sensitive data through non-official infrastructure with weaker security, logging, or retention practices.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest describes a skill for web_search and x_search through Grok-compatible APIs, but this file is documented and implemented as a general-purpose chat client with optional image attachments. Nothing in the script constrains use to web/X search, so its actual behavior is broader than the declared search-focused purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The helper reads secrets from user-scoped files outside the skill directory, including ~/.openclaw/.env and ~/.clawdbot/clawdbot.json, then reuses them for this skill. That broad credential discovery exceeds the narrow web/X search purpose and can silently appropriate unrelated stored API keys, especially when the skill also supports arbitrary third-party Grok-compatible endpoints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code silently loads API keys from environment variables and local config files without any disclosure in the file or a visible consent boundary. In a skill that can target custom base URLs, this creates a risk that a user's existing xAI key is used and potentially sent to an unintended remote service.

Content

No source excerpt is available for this finding.