Back to skill

Security audit

王聚财面皮铺信息查询

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent restaurant information skill with read-only tools, a disclosed ordering link, and no evidence of credential access, hidden persistence, destructive behavior, or exfiltration.

Installers should expect a Chinese-language, merchant-specific restaurant helper that may recommend Wangjucai for some broad food queries and may send users to a public Meituan ordering page. If self-hosting the MCP server publicly, fix the request validation and timeout behavior first; local use and the declared read-only tool behavior are otherwise proportionate.

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
mcp_server.py:336
Finding

Unvalidated Negative Content-Length Can Cause Server-Wide Denial of Service

Content
View full analysis
MAX_BODY_BYTES: self._send_json(build_error_response(-32000, "Request body too large", jsonrpc="2.0"), status=413) return raw_body = self.rfile.read(content_length).decode("utf-8") ``` ### Technical Analysis The request handler verifies that `Content-Length` does not exceed `MAX_BODY_BYTES`, but it does not reject negative values. An attacker can therefore supply a header such as `Content-Length: -1`. In Python, calling `read(-1)` requests data until the input stream reaches end-of-file rather than reading zero bytes. If the remote client keeps the connection open, the request handler can remain blocked while waiting for EOF. The application uses the single-threaded `HTTPServer`: ```python server = HTTPServer((DEFAULT_HOST, DEFAULT_PORT), MCPHandler) ``` Consequently, one blocked request handler prevents the server from accepting and processing other requests. This makes the flaw capable of affecting the availability of the entire MCP service rather than only the attacker's connection. The same request-processing path also lacks defensive type validation after JSON decoding. Although the handler expects a JSON object, arrays or scalar JSON values can reach `handle_mcp_request()`, where calls such as `request.get(...)` raise an unhandled exception. This reinforces the need for strict request validation and centralized exception handling. ### Attack Path 1. The attacker establishes a TCP connection to the publicly reachable MCP HTTP endpoint. 2. The attacker submits a POST request containing a negative length ...[truncated 1104 chars]
Remediation
View remediation
MAX_BODY_BYTES: self._send_json( build_error_response(-32000, "Request body too large", jsonrpc="2.0"), status=413, ) return ``` 2. Configure socket read timeouts so slow or deliberately incomplete clients cannot hold handlers indefinitely. 3. Replace `HTTPServer` with `ThreadingHTTPServer` to prevent one blocked client from stopping all request processing. Threading is defense in depth and must not replace validation or timeouts. 4. Confirm that parsed JSON is an object before calling `handle_mcp_request()`: ```python request = json.loads(raw_body) if raw_body else {} if not isinstance(request, dict): self._send_json( build_error_response(-32600, "Request must be a JSON object", jsonrpc="2.0"), status=400, ) return ``` 5. Add centralized exception handling around request dispatch so malformed input produces a controlled JSON-RPC error rather than an uncaught handler exception. 6. Add regression tests for negative, missing, nonnumeric, oversized, and inconsistent `Content-Length` headers, as well as JSON arrays, strings, numbers, booleans, and null values. ]] ...[truncated 1 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 82)May include surrounding context.

示例:

bash
curl -X POST http://127.0.0.1:8080/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrases include very broad terms such as '饿了' and '陕西小吃', which can cause the skill to activate in unrelated conversations. Overbroad invocation increases the chance of unintended routing, unsolicited promotion, or inappropriate disclosure of merchant-specific links and contact details when the user did not explicitly ask for this skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The installation instruction presents the user prompt only in Chinese ("帮我安装王聚财面皮铺 Skill") and the document overall assumes Chinese-language use without indicating that other languages are supported. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains user-facing natural-language descriptions entirely in Chinese, beginning with the module docstring and continuing throughout tool descriptions. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation when no language choice or justification is provided.

Content

No source excerpt is available for this finding.