Back to skill

Security audit

Claude Code WebSearch

Security checks for vulnerabilities and agentic risk

Overview

This web-search skill is mostly coherent, but its Codex fallback may run a broader nested agent than users expect for simple search.

Review before installing. This does not look malicious, but use it only if you are comfortable sending search queries through your authenticated Claude Code or Codex CLI. Avoid secrets, credentials, private customer data, or proprietary internal questions. Prefer the Claude backend or a clearly sandboxed Codex configuration, and be careful with broad automatic activation for generic search requests.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/websearch.sh:24
Finding

Overprivileged Codex Fallback Exposes the Host to Prompt-Driven Agent Actions

Content
View full analysis
/dev/null; then BACKEND="claude" elif command -v codex &>/dev/null; then BACKEND="codex" else echo "Error: neither 'claude' nor 'codex' CLI found in PATH." >&2 exit 1 fi fi case "$BACKEND" in claude) claude -p "$PROMPT" --allowedTools "WebSearch" 2>/dev/null ;; codex) # Codex needs --skip-git-repo-check outside a git repo # Runs from /tmp to avoid workspace context loading delay TMPDIR_SEARCH=$(mktemp -d) cd "$TMPDIR_SEARCH" codex --search -c reasoning_effort=low exec --skip-git-repo-check "$PROMPT" 2>/dev/null ``` ### Technical Analysis The script directly embeds the user-controlled `QUERY` and `MAX_RESULTS` values into an instruction passed to a nested AI agent. The values are shell-quoted, so this is not conventional shell command injection. However, they remain untrusted natural-language instructions and can contain prompt-injection content intended to override the search task. The Claude backend explicitly limits tools with `--allowedTools "WebSearch"`. The Codex fallback does not establish an equivalent web-search-only tool allowlist or an explicit least-privilege sandbox. Running Codex from a newly created temporary directory reduces accidental workspace context loading, but it does not by itself guarantee that the process cannot access other host paths, execute tools, or perform operations allowed by the local Codex configuration. Consequently, a malicious query may persuade the nested Codex agent to perform actions beyond web search. The actual exp ...[truncated 1620 chars]
Remediation
View remediation
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · scripts/websearch.sh (reported line 44)May include surrounding context.

sh
case "$BACKEND" in
  claude)
    claude -p "$PROMPT" --allowedTools "WebSearch" 2>/dev/null
    ;;
  codex)
    # Codex needs --skip-git-repo-check outside a git repo

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README instructs users to send arbitrary search queries through an authenticated Claude Code or Codex CLI backend but does not clearly disclose that those queries are transmitted to an external third-party service. This can lead users to submit sensitive internal data, secrets, or proprietary questions under the assumption that the search is local or merely a wrapper, creating an avoidable privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation phrases are broad enough to match ordinary user requests like 'search the web' or '搜一下', which can cause the skill to trigger in many contexts without strong user intent disambiguation. In an agent setting, overly permissive activation can route requests to this skill unexpectedly, expanding tool use and increasing the chance of unintended external queries or data exposure through web-search operations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The guidance says to use the skill for 'any web search need' and includes loose examples like 'search for X' and '查一下X', which creates ambiguous trigger scope. That makes the skill more likely to activate as a default behavior, potentially causing unnecessary external requests, policy bypass of preferred tools, or unintended transmission of user-provided content to a CLI web-search backend.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.