Back to skill

Security audit

Smart Search Fallback

Security checks for vulnerabilities and agentic risk

Overview

The skill is a search fallback helper, but its bundled script can execute crafted query text as Python code during one fallback path.

Install only if you are comfortable with automatic searches being sent to several third-party tools, and do not use this version with untrusted or sensitive query text until the fallback script is fixed to pass queries as data rather than embedding them in Python source.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fallback-search.sh:6
Finding

Arbitrary Python Code Execution Through an Unsanitized Search Query

Content
View full analysis
[count]}" ``` ```bash # T3: multi-search-engine (via crawl4ai - 爬百度) echo "Trying T3: crawl4ai → 百度..." if python3 -c " import asyncio from crawl4ai import AsyncWebCrawler async def main(): async with AsyncWebCrawler() as c: r = await c.arun(url='https://www.baidu.com/s?wd=$QUERY') print(r.markdown[:3000]) asyncio.run(main()) " 2>/dev/null; then ``` ### Technical Analysis The script accepts the first command-line argument as `QUERY` and interpolates it directly into Python source supplied to `python3 -c`. Shell quoting does not make the value safe within the generated Python program. An attacker-controlled query containing a single quote and additional Python statements can terminate the URL string and inject arbitrary Python code. For example, a query structurally resembling the following can escape the intended string: ```text '); __import__('os').system(''); # ``` The resulting text is parsed as part of the Python program rather than treated exclusively as search data. The use of `python3 -c` therefore creates a local arbitrary-code-execution primitive. This vulnerability is reachable only when the script proceeds to the T3 fallback, such as after the T1 and T2 search mechanisms fail. That condition does not mitigate the underlying injection issue and may be intentionally induced or occur naturally because of unavailable dependencies, network failures, exhausted quotas, or provider errors. ### Attack Path 1. An attacker supplies or persuades the Agent to use a crafted search query containing Python syntax. 2. The script stores the untrusted argument in `QUERY`. 3. T1, `web-search-plus`, fails or is unavailable. 4. T2, the OpenCLI Google search, also f ...[truncated 1206 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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 (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared description presents a broad, intelligent search orchestration layer with scenario-based tool selection and comprehensive automatic degradation across multiple tool classes. The code actually performs a simpler sequential fallback search script with a small fixed set of tools. While it is related to the declared purpose at a high level, key described capabilities are absent: there is no scenario-aware routing, no use of several named tools/modes (web_fetch, remote browser, direct fetch, multi-engine aggregation in any meaningful sense), and one fallback stage is explicitly not automated. This is a material description-versus-behavior gap, even though the code does support basic fallback search behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The activation scope is extremely broad ('any scenario requiring online information'), which can cause the skill to trigger on ordinary user requests and route prompts to multiple external services without clear minimization. In a search skill, overbroad activation increases the chance of unnecessary data exposure, accidental externalization of sensitive prompts, and surprising tool use.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 4)May include surrounding context.

md
#!/usr/bin/env bash
# Fallback search script - tries tools in priority order T1→T7
# Usage: ./fallback-search.sh "query" [count]
# No API keys in this script - reads from .env files in respective skill directories

set -uo pipefail

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/fallback-search.sh (reported line 4)May include surrounding context.

sh
#!/usr/bin/env bash
# Fallback search script - tries tools in priority order T1→T7
# Usage: ./fallback-search.sh "query" [count]
# No API keys in this script - reads from .env files in respective skill directories

set -uo pipefail

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill routes queries across several third-party search, crawling, and browser services, but the description does not clearly warn that user input may be sent to multiple external systems during fallback. This weak transparency and consent, and in context is more dangerous because the skill is designed to automatically retry through a chain of providers, expanding the disclosure surface of any query.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · SKILL.md (reported line 151)May include surrounding context.

md
- Serper Key: `skills/web-search-plus/.env`
- Firecrawl Key: `skills/firecrawl-cli/.env`
- 多引擎配置: 见 `skills/multi-search-engine/SKILL.md`

## Token 安全

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script contains user-facing/commented text in Chinese, including references like "免 Key", "爬百度", and output naming Baidu specifically. This reflects a locale/language preference embedded in the skill without any user choice or documented justification, which matches the policy category for language/locale constraints.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.