Back to skill

Security audit

02 联网搜索

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent web-search skill with local caching and normal Python dependency risks, but no artifact-backed deception, exfiltration, destructive behavior, or hidden high-impact authority.

Before installing, be aware that searches and returned snippets are cached locally in ~/.ai_search_cache.db, so avoid sensitive queries unless local search history is acceptable. Install in a virtual environment, avoid running the installer as an administrator, and prefer pinned or locked dependencies for stronger supply-chain control.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned Third-Party Dependencies Installed Without Integrity Verification

Content
View full analysis
=4.0.0 # 维基百科搜索(可选) wikipedia>=1.4.0 # HTTP请求 requests>=2.31.0 ``` ### Technical Analysis The installation script invokes `pip` against the environment's configured package index and installs dependencies constrained only by minimum versions. No exact versions, lock file, package hashes, or trusted index are enforced. Constraints such as `duckduckgo-search>=4.0.0` permit any later release selected by the resolver. Consequently, the reviewed source tree does not uniquely determine the code that will be installed. A future compromised release, compromised package index, or malicious package supplied through a misconfigured index could be installed without integrity verification. Python packages may execute build backend or setup logic during installation, and their imported runtime code executes when `web_search.py` loads them. There is no evidence in the reviewed project that the currently published dependencies are malicious; the vulnerability is the absence of dependency provenance and reproducibility controls. ### Attack Path 1. An attacker compromises a permitted future release of one of the listed packages, its distribution account, or a package source configured in the victim's pip environment. 2. The victim runs `install.sh`. 3. `pip install -r requirements.txt` resolves a version satisfying the unrestricted lower-bound constraint. 4. Because no expected artifact hash or exact reviewed version is required, pip accepts and installs the attacker-controlled distribution. 5. Malicious code executes during package installation or later whe ...[truncated 570 chars]
Remediation
View remediation
wikipedia== requests== ``` 2. Generate a lock file containing hashes for all direct and transitive dependencies using a tool such as `pip-tools`. 3. Install with mandatory hash verification: ```bash python3 -m pip install --require-hashes -r requirements.lock ``` 4. Invoke pip through the selected interpreter (`python3 -m pip` or `venv/bin/python -m pip`) rather than relying on whichever `pip` executable appears first in `PATH`. 5. Configure and enforce a trusted package index instead of inheriting arbitrary user or system pip index settings. 6. Run dependency vulnerability and provenance checks in CI, review dependency updates before changing the lock file, and avoid running installation with administrative privileges. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented purpose understates actual behavior: the skill persists search data locally in the user's home directory, describes broader engine/API support than is actually implemented, and appears to expose CLI-style interaction not clearly declared in scope. This mismatch can mislead users and host systems about data handling and execution surfaces, which is a security-relevant transparency failure.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

The documentation includes a raw shell deletion command for removing the cache file. In an agentic context, presenting destructive shell commands as troubleshooting steps can lead to unsafe execution, path expansion mistakes, or command reuse patterns that normalize shell access beyond the skill's stated purpose.

Content

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

解决:

python
# 清除缓存
rm ~/.ai_search_cache.db

问题3:搜索结果不相关

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises networked search behavior and also references shell-capable behavior, but it does not declare any explicit tool scope such as permissions or allowed-tools. Missing capability declarations weaken policy enforcement and user consent, making it easier for a skill to invoke higher-risk actions than expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation mentions caching but does not clearly warn that user queries and possibly retrieved results are written to a persistent local database file. Search terms may contain sensitive personal or business information, so silent persistence creates privacy and disclosure risk, especially on shared systems.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script contains multiple user-facing strings in Chinese, such as the title and error messages, but does not provide any opt-in, fallback, or indication that the skill is intended only for Chinese-speaking users. That creates a language/locale policy concern because the skill effectively forces a specific language on all users.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The tool is described as a 'safe web search tool', but it persistently stores user queries and returned results in a local SQLite database without clearly disclosing that behavior. This mismatch can cause users or downstream agents to submit sensitive searches under a false privacy assumption, leading to unintended local data exposure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code defines an allowed-domain list for search engines but never enforces it in URL validation; validate_url only checks for http/https. This creates a false sense of network restriction and could allow untrusted or unexpected result URLs to be accepted and surfaced to users or other agent components.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Search queries and results are written to a local cache database by default without any user-facing warning or consent. In an agent context, users may include secrets, health data, internal project names, or incident-response terms in queries, which then become silently persistent on disk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The cache stores raw search queries and result payloads in plaintext SQLite, and retains them for up to 24 hours or longer until cleanup is run. Anyone with local access to the user account, backups, or harvested home-directory files could recover sensitive search history and associated content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code explicitly sets the Wikipedia client language to Chinese via wikipedia.set_lang("zh"). This is a natural-language/locale policy concern because the user is not offered a language choice or opt-in, and the file does not document a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This requirements file contains natural-language comments exclusively in Chinese, which can impose a language preference on users or maintainers without opt-in. The policy allows fixed language only when choice or clear locale-specific justification is provided, which is not present here.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
91% confidence
Finding

Using duckduckgo-search with only a minimum version allows future installs to resolve to different, unreviewed releases. This creates supply-chain risk because a later compromised or breaking version could be pulled into the skill without code changes, which is especially relevant for a network-search tool that handles external content and outbound requests.

Content

Scanner excerpt · requirements.txt (reported line 4)May include surrounding context.

text
# AI联网搜索技能依赖

# DuckDuckGo搜索(推荐)
duckduckgo-search>=4.0.0

# 维基百科搜索(可选)
wikipedia>=1.4.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
89% confidence
Finding

The wikipedia package is not pinned, so installations are not reproducible and may pull in newer releases that have not been security-reviewed for this skill. While the package is optional and lower risk than core transport libraries, it still introduces avoidable supply-chain uncertainty.

Content

Scanner excerpt · requirements.txt (reported line 7)May include surrounding context.

text
duckduckgo-search>=4.0.0

# 维基百科搜索(可选)
wikipedia>=1.4.0

# HTTP请求
requests>=2.31.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

Leaving requests unpinned is more dangerous because it is a core HTTP library directly exposed to untrusted network interactions in a web-search skill. A fresh install may select a vulnerable or behavior-changing release, increasing the chance of credential leakage, TLS/verification issues, or other request-handling flaws affecting outbound connections.

Content

Scanner excerpt · requirements.txt (reported line 10)May include surrounding context.

text
wikipedia>=1.4.0

# HTTP请求
requests>=2.31.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The manifest includes requests without a fixed version even though the package has multiple known advisories across releases, so the security posture of actual installs cannot be verified. In the context of a web-search skill that performs HTTP requests, this uncertainty is more dangerous because transport-layer or credential-handling bugs can be directly exposed during normal operation.

Content

No source excerpt is available for this finding.