Back to skill

Security audit

锋哥智能搜索

Security checks for vulnerabilities and agentic risk

Overview

This is a simple search helper that contacts Bing or DuckDuckGo as advertised, with privacy and result-labeling caveats but no hidden persistence or destructive behavior.

Install only if you are comfortable sending search queries to Bing or DuckDuckGo. Avoid using it for secrets, credentials, private project names, or sensitive personal data, and treat its official or quality labels as heuristic rather than verified trust signals.

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

Warning
Location
skill.py:46
Finding
Spoofable Trusted-Domain Classification<![CDATA[ ## Vulnerability Details **File Location**: `skill.py`, lines 46–52 **Vulnerability Type**: Improper domain validation through substring matching **Risk Level**: Medium ### Vulnerable Code ```python def calc_domain_score(url, engine='bing'): if not url: return 0.5 domain = urlparse(url).netloc.lower() for good, score in HIGH_QUALITY.items(): if good in domain: return score ``` ### Technical Analysis The function classifies a result as high quality when a trusted-domain token occurs anywhere within the parsed network location: ```python if good in domain: ``` This is not an origin or registrable-domain check. An attacker can register or control a hostname containing a trusted token, such as: - `github.com.attacker.example` - `official.attacker.example` - `wiki-malware.example` These hostnames can match entries in `HIGH_QUALITY` even though they are unrelated to the intended trusted services. Generic entries such as `docs`, `official`, and `wiki` make false classification particularly easy. The resulting score is used to sort search results and generate labels such as `【官方】` (“official”) or high-quality indicators. Therefore, attacker-controlled content can be displayed more prominently and with an unjustified trust signal. ### Attack Path 1. An attacker creates a web page on a controlled hostname containing one of the trusted substrings. 2. The attacker causes the page to be indexed by Bing or DuckDuckGo for a query relevant to the victim. 3. A user invokes the skill with that query. 4. The search engine includes the attacker-controlled page in its response. 5. `calc_domain_score()` extracts the hostname and performs substring matching. 6. The crafted hostname matches a trusted token and receives an elevated score. 7. The skill sorts the result above lower-scored results and presents it with an official or high-quality label. 8. A user who relies on that label may visit the attacker-controlled page and ...[truncated 648 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace substring matching with exact hostname or DNS subdomain-boundary matching: ```python def hostname_matches(domain, trusted): domain = domain.rstrip(".").lower() trusted = trusted.rstrip(".").lower() return domain == trusted or domain.endswith("." + trusted) ``` 2. Apply the helper only to specific, fully qualified trusted domains: ```python for trusted, score in HIGH_QUALITY.items(): if hostname_matches(domain, trusted): return score ``` 3. Remove ambiguous entries such as `docs`, `official`, and `wiki`. Replace them with explicitly reviewed domains. 4. Normalize hostnames before comparison, including: - Removing a trailing dot. - Converting internationalized domain names to a consistent IDNA representation. - Handling malformed URLs conservatively. - Using `urlparse(url).hostname` instead of `netloc` to avoid ports and user-information components affecting validation. 5. Use a maintained public-suffix-aware library if scoring must operate on registrable domains. 6. Add regression tests proving that deceptive hostnames do not inherit trusted scores, including: ```python assert calc_domain_score("https://github.com.attacker.example") != 3.0 assert calc_domain_score("https://official-malware.example") != 2.5 assert calc_domain_score("https://github.com/example/repository") == 3.0 assert calc_domain_score("https://docs.openclaw.ai/guide") == 3.0 ``` 7. Consider presenting quality labels as heuristic rather than authoritative, especially where a result has not been cryptographically or manually verified. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill advertises and requires network-capable components but does not declare any explicit tool scope or permissions boundary in the manifest. This can lead to overbroad network access expectations, weak reviewability, and accidental use in environments where users or hosts are not clearly informed that external requests will occur.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The documentation does not warn users that their search terms will be transmitted to third-party search engines, which may expose sensitive prompts, internal project names, or personal data. In agent contexts, users may reasonably assume local processing unless outbound disclosure is clearly disclosed, making this a real privacy and data-handling issue.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
The description states that Chinese queries go to Bing and English queries go to DuckDuckGo, making language detection drive behavior automatically. This is a language/locale-based policy decision presented as default behavior without user opt-in at the point of use, which fits the natural-language policy violation criteria.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The file’s natural-language description states that Chinese searches go to Bing and English searches go to DuckDuckGo by default, and the code implements this behavior automatically. This is a language/locale-based policy choice applied without explicit user opt-in, which matches the natural-language policy violation criteria.