Back to skill

Security audit

grok-search

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed xAI/Grok API wrapper for web/X search plus optional chat, vision, and model listing, with no evidence of hidden persistence or destructive behavior.

Install only if you are comfortable sending prompts, search queries, filters, and any explicitly provided images to xAI using your XAI_API_KEY. Avoid using it with secrets, private documents, or sensitive images unless that third-party API use is acceptable, and consider narrowing triggers if accidental invocation would be a problem.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill invokes bundled Node scripts that require environment access and make outbound API calls, yet the manifest does not declare any explicit tool scope such as permissions or allowed-tools. This creates a transparency and policy-enforcement gap: an agent or reviewer may treat the skill as lower risk than it is, increasing the chance of unintended secret access or external data transmission.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest presents the skill as search-oriented, but the documentation exposes materially broader capabilities: freeform chat, vision chat, and model listing. This scope mismatch can mislead operators and upstream agents into routing arbitrary prompts or images to an external model when they only intended web/X search, increasing data-exposure and misuse risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill does not clearly warn users that their queries, prompts, and possibly image inputs are transmitted to the external xAI Responses API. Without an explicit disclosure, users or calling agents may send sensitive data under the false assumption that processing is local, leading to avoidable third-party data exposure.

Content

No source excerpt is available for this finding.

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
70% confidence
Finding

Shadow Command Trigger: 'search x' conflicts with built-in command 'search'

Content

No source excerpt is available for this finding.

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
70% confidence
Finding

Shadow Command Trigger: 'search twitter' conflicts with built-in command 'search'

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest trigger list includes generic phrases such as "grok", "xai", "find tweets", and "twitter search" without any exclusion conditions or scope constraints. These are broad enough to match ordinary user language and could cause unintended invocation of this skill.

Content

No source excerpt is available for this finding.

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
70% confidence
Finding

Shadow Command Trigger: 'find tweets' conflicts with built-in command 'find'

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implementation materially exceeds the declared skill scope: instead of a constrained search tool using server-side web_search/x_search, it provides general-purpose Grok chat. Scope drift is dangerous because users and orchestrators may trust the manifest and route broader prompts or sensitive content into a capability they did not intend to expose, undermining least privilege and policy enforcement.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script adds local image ingestion and uploads image contents to the remote API, even though the skill is described as a web/X search utility. This expands the data-exfiltration surface beyond user expectations and can cause accidental transmission of sensitive local files if an operator assumes the skill only sends search queries.

Content

No source excerpt is available for this finding.

External Transmission

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

js
store: false,
};

const res = await fetch("https://api.x.ai/v1/responses", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",

External Transmission

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

js
store: false,
};

const res = await fetch("https://api.x.ai/v1/responses", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code transmits the user's query, selected search mode, and filtering parameters to an external network service via an HTTP POST request. Although the file header describes the tool as an xAI search wrapper, there is no runtime warning, confirmation, or explicit user-facing notice that the provided query data will be sent off-box to a third-party API.

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 · scripts/chat.mjs (reported line 127)May include surrounding context.

js
let data;
try {
  data = await fetchJson("https://api.x.ai/v1/language-models");
} catch {
  data = await fetchJson("https://api.x.ai/v1/models");
}

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/grok_search.mjs (reported line 226)May include surrounding context.

js
let data;
try {
  data = await fetchJson("https://api.x.ai/v1/language-models");
} catch {
  data = await fetchJson("https://api.x.ai/v1/models");
}

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/models.mjs (reported line 70)May include surrounding context.

js
let data;
try {
  data = await fetchJson("https://api.x.ai/v1/language-models");
} catch {
  data = await fetchJson("https://api.x.ai/v1/models");
}

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/models.mjs (reported line 72)May include surrounding context.

js
let data;
try {
  data = await fetchJson("https://api.x.ai/v1/language-models");
} catch {
  data = await fetchJson("https://api.x.ai/v1/models");
}

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access, suspicious.exposed_secret_literal

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/selftest.mjs:18

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/chat.mjs:34

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/chat.mjs:110

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/grok_search.mjs:130

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/models.mjs:51