Back to skill

Security audit

锋哥 Bing 搜索

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Bing search skill, with privacy and result-labeling caveats but no evidence of hidden persistence, credential access, destructive behavior, or deception.

Install only if you are comfortable with search queries being sent to Microsoft Bing, specifically through cn.bing.com. Do not search for passwords, tokens, confidential project names, or private personal data. Treat the official or high-quality labels as rough heuristics because the domain scoring can be spoofed by misleading hostnames.

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:39
Finding
Spoofable Domain Reputation Classification Mislabels Attacker-Controlled Sites as Trusted<![CDATA[ ## Vulnerability Details **File Location**: `skill.py`, lines 39–45 **Vulnerability Type**: Improper domain validation through unrestricted substring matching **Risk Level**: Medium ### Vulnerable Code ```python def calc_domain_score(url): domain = urlparse(url).netloc.lower() for good, score in HIGH_QUALITY.items(): if good in domain: return score for bad in LOW_QUALITY: if bad in domain and 'baike' not in domain: return 0.3 return 1.0 ``` ### Technical Analysis The search-result reputation mechanism tests whether a trusted string occurs anywhere in the URL authority: ```python if good in domain ``` This does not establish that the hostname is the trusted domain or one of its legitimate subdomains. An attacker can register a hostname containing a trusted substring, such as: - `github.com.attacker.example` - `notgithub.com` - `official-malware.example` - `docs-phishing.example` Such a hostname can match entries in `HIGH_QUALITY` and receive an elevated score. Generic entries such as `docs` and `official` make this particularly easy to exploit. Because results are sorted by score and presented with labels such as “official” or “high quality,” the flaw can cause an attacker-controlled result to appear more trustworthy than it is. Using `urlparse(url).netloc` instead of the normalized `hostname` property also retains port and user-information syntax, making validation less precise. ### Attack Path 1. An attacker registers or controls a domain whose hostname contains a trusted substring from `HIGH_QUALITY`. 2. The attacker publishes a phishing, malware-delivery, or deceptive page relevant to a likely search query. 3. The page is indexed by Bing and returned in the HTML search results processed by the Skill. 4. `calc_domain_score()` performs substring matching and assigns the attacker-controlled URL an elevated reputation score. 5. The Skill sorts the malicious result ahead of lower-scored results and displays an a ...[truncated 688 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse and validate the normalized hostname rather than the complete network-location field: ```python parsed = urlparse(url) domain = (parsed.hostname or "").lower().rstrip(".") ``` 2. Require exact hostname or subdomain-boundary matches: ```python def matches_domain(hostname, trusted_domain): trusted_domain = trusted_domain.lower().rstrip(".") return hostname == trusted_domain or hostname.endswith("." + trusted_domain) ``` 3. Replace substring-based scoring with explicit verified domains: ```python def calc_domain_score(url): domain = (urlparse(url).hostname or "").lower().rstrip(".") for trusted_domain, score in HIGH_QUALITY.items(): if domain == trusted_domain or domain.endswith("." + trusted_domain): return score for blocked_domain in LOW_QUALITY: if domain == blocked_domain or domain.endswith("." + blocked_domain): return 0.3 return 1.0 ``` 4. Remove generic reputation entries such as `docs` and `official`; they are not registrable-domain identities and cannot safely establish ownership or authority. 5. Maintain a narrowly scoped allowlist of independently verified registrable domains. If subdomains should not inherit trust automatically, require exact hostname matches instead. 6. Add tests covering deceptive hostnames, including `notgithub.com`, `github.com.attacker.example`, `official-malware.example`, trailing-dot hostnames, mixed-case hostnames, ports, and URL user-information syntax. 7. Consider presenting reputation labels as heuristic rankings rather than definitive claims of official ownership unless domain ownership has been explicitly verified. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

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 such as permissions or allowed-tools. This weakens transparency and policy enforcement, making it easier for a user or platform to invoke a networked skill without clear consent boundaries or reviewable capability declarations.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The description promotes Bing-based search but does not clearly warn users that their queries will be transmitted to Microsoft over the network. Search terms can contain sensitive business data, personal information, or secrets, so missing disclosure creates a privacy and data-handling risk.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The file title and all user-facing strings are Chinese, and the code forces searches through the cn.bing.com endpoint. This imposes a specific language/locale behavior without opt-in or explanation, which matches the policy concern for forced language or locale constraints.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The natural-language description repeatedly emphasizes support for Chinese and English, which can imply a language limitation without an explicit opt-in or justification. Under language/locale policy review, this should be documented as a user choice or a clearly justified scope rather than an implicit restriction.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The skill sends the user's raw search query to an external service (cn.bing.com) without any in-file disclosure, confirmation, or privacy warning. This can expose sensitive prompts, internal project names, credentials accidentally pasted into queries, or other private data to a third party, which is a genuine privacy/security concern even though network search is the intended function.