Back to skill

Security audit

搜索

Security checks for vulnerabilities and agentic risk

Overview

This Brave Search skill is review-worthy because it asks for local file and command-execution authority that is broader than its search purpose needs.

Install only if you are comfortable granting this skill local read/search and command-execution tools, and preferably only in a sandbox with a narrowly scoped Brave API key. Treat search queries and context as data sent to an external API, and do not use it with secrets or confidential internal content unless your environment explicitly allows that.

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
SKILL.md:16
Finding

Excessive Local File and Command-Execution Capabilities

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:16-20
Additional Evidence: SKILL.md:184-188
Vulnerability Type: Excessive tool permissions and violation of least privilege
Risk Level: Medium

Vulnerable Code

yaml
tools:
- read
- exec
- glob
- grep

The later feature description also explicitly advertises general file-processing and system-command execution capabilities, despite the skill's stated purpose being Brave Search API access.

Technical Analysis

The skill requests arbitrary command execution, local file reading, filesystem enumeration, and content-search capabilities. These permissions are broader than those normally required to submit HTTPS requests to the Brave Search API and parse its responses.

Although the documentation recommends sandboxing and command allowlisting, it does not define a command allowlist, permitted filesystem paths, argument validation rules, or technical enforcement controls. The project contains only SKILL.md, so no implementation is available that demonstrates effective sandboxing or restriction of these capabilities.

This violates the principle of least privilege. If an agent exposes the declared tools while processing untrusted user instructions or retrieved web content, those inputs could influence the agent to inspect local files or execute commands unrelated to web search.

Attack Path

  1. A user invokes the skill to perform a web search.
  2. The agent loads the skill with access to read, glob, grep, and exec.
  3. The user supplies a malicious instruction, or retrieved web content contains instructions designed to influence the agent.
  4. The agent is induced to enumerate files with glob, locate sensitive content with grep, read local data with read, or invoke a system command with exec.
  5. Sensitive local information may be included in tool output or subsequent responses, or an unintended command may alter data withi ...[truncated 962 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove exec, read, glob, and grep unless each tool is demonstrably required for the search workflow.
  2. Replace general-purpose tools with a dedicated Brave Search API client restricted to the official HTTPS endpoint and necessary HTTP methods.
  3. Use an explicitly named credential such as BRAVE_SEARCH_API_KEY, inject it only into the API client, and prevent it from appearing in prompts, logs, errors, or responses.
  4. If local file access is necessary, restrict it to a dedicated working directory and reject absolute paths, traversal sequences, symbolic-link escapes, and access to credential files.
  5. If command execution is unavoidable, enforce a concrete executable and argument allowlist without shell interpolation. Run commands in a sandbox with minimal filesystem, network, and operating-system privileges.
  6. Treat user input and retrieved web content as untrusted data. Do not interpret search results as agent instructions or allow them to authorize tool calls.
  7. Document the exact Brave API endpoint, authentication header, accepted request fields, response-size limits, timeout behavior, redirect policy, and output-redaction rules.
  8. Add tests confirming that the skill cannot read files outside its workspace, execute unapproved commands, disclose credentials, or follow tool-use instructions embedded in search results.
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 Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Introducing system command execution in a skill whose business purpose is web search is an unjustified expansion of privilege. If an agent trusts this description, user-supplied or retrieved content could be transformed into shell actions, creating a path to command injection, local data exposure, or environment compromise.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill is presented as a Brave Search web search/content extraction tool, but the documentation broadens scope into SEO optimization, analytics, reporting, visualization, and decision-support. This kind of scope drift can cause an agent to invoke the skill in contexts far beyond user expectations, increasing the chance of unnecessary data disclosure to external services and misuse of attached capabilities.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Broad, ambiguous invocation wording weakens the boundary around when the skill should be used. In agent environments, this can lead to over-invocation on inappropriate prompts, causing external transmission of user data or activation of higher-risk capabilities outside the intended search use case.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

L013 says the skill is not suitable for streaming data processing, but L042-L045 present a paid version that supports big-data streaming, data synchronization, and incremental updates. This creates an intent-level contradiction in the skill documentation about whether such processing is within scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation fails to warn users up front that their search queries and extracted content will be sent to an external API. This is dangerous because users and calling agents may unknowingly transmit sensitive prompts, internal URLs, or proprietary content to a third party, creating privacy and compliance risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation claims file handling and command execution capabilities that exceed the stated purpose of a search skill. Overstating capabilities is dangerous because orchestration systems or operators may permit broader tool use than necessary, enabling local file access or shell execution in workflows that only required outbound search.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.