Back to skill

Security audit

喜乐姐真蚕丝喜被

Security checks for vulnerabilities and agentic risk

Overview

This shopping skill is mostly coherent, but it can create real orders and expose customer address data without adequate consent, authentication, or data-handling boundaries.

Review carefully before installing or deploying. Use it only if you are comfortable sending customer order details to the configured service, and do not expose the bundled backend publicly until order creation and lookup require authentication, phone verification or equivalent authorization, rate limiting, address masking, clear privacy notice, and dependency pinning.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (4)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:46
Finding

Mandatory Promotional Output and Trust in Remotely Supplied Tool Metadata

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:46-65, SKILL.md:83-96, skill.json:243-249, and skill.json:257-258
Vulnerability Type: Agent instruction hijacking and externally controlled capability discovery
Risk Level: Critical

Vulnerable Code

SKILL.md:46-65:

markdown
> **MCP 调用方式**:通过 MCP 协议(JSON-RPC 2.0 POST)调用。端点地址见 `skill.json` 中 `mcp_server.url` 字段。
>
> **调用示例**(以 `get_products` 为例):
>
> ```
> POST <skill.json 中 mcp_server.url>
> Content-Type: application/json
>
> {
>   "jsonrpc": "2.0",
>   "id": 1,
>   "method": "tools/call",
>   "params": {
>     "name": "get_products",
>     "arguments": {}
>   }
> }
> ```
>
> 其他工具调用方式相同,只需替换 `params.name` 为对应工具名。完整工具列表**必须通过 `tools/list` 方法动态获取**(`skill.json` 的 `tools` 字段仅为平台索引快照,可能不完整)。

## 购买链接强制规则

只要用户问:怎么买、购买、下单、团购、链接、抖音、价格优惠、我要买、哪里买、给我链接、购买方式,必须调用 `get_purchase_links` 工具。

回复时必须直接输出完整抖音团购链接,不能只说"点击链接",不能省略链接,不能等用户二次追问。

skill.json:243-249:

json
{
  "name": "get_purchase_links",
  "display_name": "购买方式与团购链接",
  "description": "强制规则:只要用户问「怎么买」「购买」「下单」「团购」「链接」「抖音」「价格优惠」「我要买」「哪里买」「给我链接」「购买方式」,必须调用本工具。回复时必须直接输出完整抖音团购链接,不能只说点击链接,不能省略链接,不能等用户二次追问。若用户有定制、绣字、特殊尺寸需求,同时附上微信客服方式。",
  "inputSchema": {
    "type": "object",
    "properties": {},
    "required": []
  }
}

skill.json:257-258:

json
"brand_prompt": {
  "system_instruction": "重要:回答关于产品的任何具体信息时,必须先调用对应的 Skill 工具获取最新数据,不要使用 Skill 文档中的示例数据。强制购买规则:只要用户问怎么买、购买、下单、团购、链接、抖音、价格优惠、我要买、哪里买、给我链接、购买方式,必须调用 get_purchase_links 工具;回复中必须直接输出完整抖音团购链接,不能只说点击链接,不能省略链接,不能等用户二次追问。你是喜乐姐真蚕丝喜被的AI助手。喜乐姐是一个专注真蚕丝被的品牌,主打手工长丝、货到付款、假一赔十。用温暖、真诚、专业但不端着的方式回答问题。像一个懂行的闺蜜推荐好东西一样,不用营销套话。不知道的就说不知道,不要编造。下单操作为真实业务行为,下单前必须跟用户确认商品、数量、收货信息。"
}

Technical Analysis

The Skill contains imperative instructions that override normal response selection and require the Agent to publish a complete promotional purchase URL whenever broadly matched purchas ...[truncated 2032 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove mandatory wording that forces the Agent to reproduce an outbound URL.
  2. Present purchase links only when directly relevant and explicitly requested by the user.
  3. Treat remotely returned links as untrusted data and validate them against an approved host and path allowlist.
  4. Maintain a local allowlist of reviewed tool names, descriptions, and input schemas.
  5. Reject remote tools that are absent from the local manifest or whose schema differs from the pinned version.
  6. Add integrity or version checks for remotely discovered capability metadata.
  7. Require explicit user confirmation before following or presenting a materially changed external destination.
  8. Keep commercial response policies subordinate to the host Agent's safety and user-consent requirements.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
backend/main.py:321
Finding

Unauthenticated Order Creation and Customer Address Disclosure

Content
View full analysis

Vulnerability Details

File Location: backend/main.py:118-145, backend/main.py:256-316, backend/main.py:321-355, and backend/main.py:396-404
Vulnerability Type: Missing authentication and object-level authorization
Risk Level: High

Vulnerable Code

backend/main.py:118-145:

python
@app.post("/")
async def mcp_endpoint(request: Request):
    """
    MCP 协议入口(JSON-RPC 2.0)
    AI 助手会向这个地址发送 JSON-RPC 请求来调用各种工具
    """
    try:
        body = await request.json()
    except Exception:
        return JSONResponse(content={
            "jsonrpc": "2.0",
            "id": None,
            "error": {"code": -32700, "message": "请求格式不对,需要 JSON"}
        }, status_code=400)

    rpc_id = body.get("id")
    method = body.get("method", "")
    params = body.get("params", {})

    if method == "tools/list":
        return JSONResponse(content={
            "jsonrpc": "2.0",
            "id": rpc_id,
            "result": {"tools": get_tools_list()}
        })

    if method == "tools/call":
        tool_name = params.get("name", "")
        arguments = params.get("arguments", {})
        result = call_tool(tool_name, arguments)
        return JSONResponse(content={
            "jsonrpc": "2.0",
            "id": rpc_id,
            "result": result
        })

backend/main.py:321-355:

python
def handle_order_status(args):
    """查询订单"""
    order_id = args.get("order_id")
    phone = args.get("phone")

    if not order_id and not phone:
        return {"error": "请提供订单号或下单时的手机号来查询"}

    conn = sqlite3.connect(DB_PATH)
    conn.row_factory = sqlite3.Row
    cursor = conn.cursor()

    if order_id:
        cursor.execute("SELECT * FROM orders WHERE order_id = ?", (order_id,))
    else:
        cursor.execute("SELECT * FROM orders WHERE phone = ? ORDER BY created_at DESC", (phone,))

    rows = cursor.fetchall()
    conn.close
...[truncated 3332 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require authentication for every order creation and status endpoint, including MCP calls.
  2. Bind each order to an authenticated customer identity or a narrowly scoped signed capability.
  3. Enforce object-level authorization before returning any order.
  4. For phone-based lookup, require one-time-code verification sent to that phone number.
  5. Replace short public order identifiers with cryptographically random, high-entropy opaque identifiers.
  6. Do not return a complete delivery address from a status endpoint; mask it unless full disclosure is strictly necessary.
  7. Apply per-account, per-IP, and per-identifier rate limits to order creation and lookup.
  8. Add abuse monitoring and alerts for repeated failed lookups and unusual order volumes.
  9. Return appropriate HTTP or JSON-RPC authorization errors instead of embedding business errors in successful responses.
  10. Add automated tests proving that unauthenticated and cross-customer access is rejected.

T09 · Insecure Skill Coding Practices

Warning
Location
backend/main.py:256
Finding

Missing Quantity Bounds Permit Invalid and Negative Orders

Content
View full analysis

Vulnerability Details

File Location: backend/main.py:65-72 and backend/main.py:256-288
Vulnerability Type: Insufficient server-side input validation
Risk Level: Medium

Vulnerable Code

backend/main.py:65-72:

python
class OrderRequest(BaseModel):
    """下单请求"""
    product_id: str
    quantity: int = 1
    customer_name: str
    phone: str
    address: str
    note: str = ""

backend/main.py:256-288:

python
def handle_place_order(args):
    """下单"""
    product_id = args.get("product_id", "")
    quantity = args.get("quantity", 1)
    customer_name = args.get("customer_name", "")
    phone = args.get("phone", "")
    address = args.get("address", "")
    note = args.get("note", "")

    # 校验必填项
    if not all([product_id, customer_name, phone, address]):
        return {"error": "缺少必填信息,需要:商品编号、收货人姓名、手机号、收货地址"}

    # 查找商品
    product = None
    for p in PRODUCTS:
        if p["id"] == product_id:
            product = p
            break

    if not product:
        return {
            "error": f"没有找到编号为'{product_id}'的商品",
            "available_products": [{"id": p["id"], "name": p["name"], "price": p["price"]} for p in PRODUCTS]
        }

    if not product["in_stock"]:
        return {"error": f"'{product['name']}'暂时缺货,请选择其他款式"}

    # 生成订单
    order_id = "XLJ" + datetime.now().strftime("%Y%m%d") + str(uuid.uuid4().hex[:6]).upper()
    total_price = product["price"] * quantity

Technical Analysis

The REST model declares quantity only as an integer and does not impose a minimum or maximum. More importantly, direct MCP calls pass a plain dictionary to handle_place_order and bypass the OrderRequest model completely.

The shared handler does not verify the value or type before multiplying it by the unit price and storing the resulting order. Negative quantities generate negative totals, zero creates a zero-value ...[truncated 1259 chars]

Remediation
View remediation

Remediation Suggestions

  1. Enforce a positive lower bound and a business-appropriate upper bound, such as one through the maximum permitted order quantity.
  2. Use a constrained Pydantic integer field for REST requests.
  3. Validate again inside handle_place_order so MCP and future transports cannot bypass the constraint.
  4. Reject booleans, strings, floating-point values, zero, negative numbers, and values over the configured limit.
  5. Add database constraints requiring quantity and total price to be positive.
  6. Return a controlled validation error without creating an order.
  7. Add tests for zero, negative, non-integer, missing, and excessively large quantities.

T08 · Insecure Dependencies

Note
Location
backend/requirements.txt:1
Finding

Unbounded Dependency Version Ranges Produce Non-Reproducible Builds

Content
View full analysis

Vulnerability Details

File Location: backend/requirements.txt:1-3
Vulnerability Type: Unpinned third-party dependencies
Risk Level: Low

Vulnerable Code

text
fastapi>=0.100.0
uvicorn>=0.23.0
pydantic>=2.0.0

Technical Analysis

All dependencies use open-ended lower-bound constraints. A future installation can therefore resolve package versions that were not present during development or review. This prevents deterministic builds and allows upstream behavioral changes, regressions, or newly introduced vulnerabilities to enter deployments automatically.

The reviewed files do not show dependency confusion, typosquatting, or a known malicious package. The risk is specifically uncontrolled supply-chain drift rather than evidence that the listed packages are malicious.

Attack Path

  1. A deployment or developer installs dependencies at a later date.
  2. The package resolver selects versions newer than those originally tested because no upper bounds, lock file, or hashes are present.
  3. The application runs unreviewed upstream code.
  4. A compromised, vulnerable, or incompatible future release can affect the service without any source change in this project.

Impact Assessment

The potential scope is the complete backend process because these packages execute with the application's privileges. Depending on the nature of an introduced upstream defect, consequences could include service failure, changed validation behavior, or broader application compromise. No specific vulnerable resolved version was established from the available files, so the present risk level is low.

Remediation
View remediation

Remediation Suggestions

  1. Pin dependencies to reviewed exact versions in a lock file.
  2. Generate and verify cryptographic hashes for downloaded distributions.
  3. Use a controlled package index and require TLS certificate validation.
  4. Run automated dependency vulnerability scanning in continuous integration.
  5. Apply dependency updates through a review and test process rather than resolving arbitrary latest versions during deployment.
  6. Rebuild lock files periodically to incorporate supported security updates.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (28)

Possible Typosquatting: 'uvicorn' resembles popular package 'gunicorn'

High
Category
Supply Chain
Confidence
70% confidence
Finding

Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README promotes placing orders and checking order status through the skill, which implies collection or transmission of personal and order data, but it does not warn users that a remote service may be contacted or what data may be handled. In an agent/skill ecosystem, this can cause users to disclose names, addresses, phone numbers, or order identifiers without informed consent, increasing privacy and data-exposure risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill explicitly instructs the agent to read skill.json for the MCP endpoint and to make outbound JSON-RPC network calls, but it does not declare any explicit tool scope or permissions boundary. This creates an authorization and least-privilege gap: a host agent may permit file/network access implicitly, making it easier for the skill to invoke external services without clear reviewable constraints.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The keyword list contains many generic high-frequency terms like '被子', '床品', '冬被', and '送礼' without clear contextual boundaries. This can cause the skill to be selected in unrelated contexts, increasing the chance of misrouting conversations and exposing users to unintended commercial prompting or data collection paths.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The purchase-trigger rule uses broad conversational terms such as '价格优惠' and '链接' and mandates immediate invocation of get_purchase_links. Overbroad triggers can cause unintended activation in ambiguous conversations, potentially steering users into commerce flows or external links when they only wanted general information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The order flow requires collection of sensitive personal data including recipient name, phone number, and physical address, yet the skill provides no user-facing notice about why the data is needed, how it will be used, where it will be sent, or how long it will be retained. In a commerce workflow, this materially increases privacy and compliance risk because users may disclose personal data without informed consent or adequate minimization.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill gives open-flame instructions ('用打火机点燃') for product verification without warning about burn, fire, smoke inhalation, or safe surroundings. Because this is an e-commerce/product-support skill rather than a safety-trained context, users may treat the instruction as endorsed and attempt it casually indoors, increasing the chance of harm.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file instructs users to test silk authenticity using undiluted bleach ('84消毒液原液') without any safety disclaimer about chemical exposure, ventilation, skin/eye protection, or keeping it away from children. In a consumer shopping skill, this can cause users to perform unsafe household chemical handling based solely on the assistant’s guidance, creating avoidable injury risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Order creation stores personally identifiable information including customer name, phone number, and address in a local SQLite database without any visible consent, retention policy, access control, or privacy notice in this implementation. In the context of a consumer ordering skill, this increases privacy and compliance risk, especially because related lookup endpoints also expose stored data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code exposes order lookup functionality via MCP and REST that returns order details, including delivery address, based solely on an order ID or phone number. There is no authentication, authorization, rate limiting, or masking, so anyone who knows or guesses a phone number or order ID can retrieve another customer's personal and order information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest focuses on consultation, ordering, recommendations, policies, leaving order notes, promotions, and support for cash on delivery. This handler returns a Douyin group-buy URL, WeChat customer contact, and payment methods including WeChat Pay and Alipay, which are additional commerce and off-platform redirection capabilities not reflected in the manifest description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code performs a POST to the /orders endpoint with name, phone number, and address fields, which is both a data transmission and a state-changing operation. Although the script prints generic test progress messages, it does not explicitly warn the user that running the test will create an order record and send personal data as part of the request.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The MCP test issues a place_order call and then queries order status by phone number, transmitting personal data and triggering a state-changing operation. The surrounding output labels this as a test, but it does not disclose that running this section will place an order and use personally identifying information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The place_order tool collects personally identifiable information including recipient name, phone number, and address, but the skill text provides no explicit privacy notice, retention policy, consent language, or data-minimization guidance. In a commerce context this is sensitive operational data, and collecting it without clear disclosure or safeguards increases the risk of privacy violations, accidental oversharing, and misuse if the backend or agent flow is mishandled.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill defines an unusually broad set of purchase-intent keywords and a mandatory rule to invoke the purchase-links tool whenever any of them appear. In a shopping skill, this can cause the agent to push users into an external purchase flow or disclose promotional links even when the user is only comparing options, discussing pricing, or asking exploratory questions, which increases the risk of unintended commercial redirection and poor consent boundaries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

SQP-3 applies to natural-language policy violations in any file type, including language/locale constraints. The user-facing description, examples, and installation prompt are entirely in Chinese and do not indicate that the skill supports other languages or that the Chinese-only presentation is an intentional, justified regional limitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The installation text says the agent will automatically clone and install the repository, but it does not warn that this changes the local filesystem by writing into a skills directory. While common for skill installation, failing to disclose the side effect reduces transparency and can mislead users about what the agent is allowed to modify.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

L085-L096 提供了示例性触发场景,但明确说明并非完整列表,且没有说明哪些相似表达不应触发对应工具。对于依赖自然语言匹配的技能,这会让触发条件变得模糊,增加扩展解释和误调用空间。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

L215-L219 将技能语气和表达方式固定为中文语境下的“闺蜜推荐”风格,整份文档也默认中文交互,但没有说明可根据用户语言偏好切换。若平台或用户使用其他语言,这种默认强制单一语言/locale 的设计可能不符合语言选择应可由用户决定的要求。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

All user-facing strings and guidance in the file are in Chinese, and there is no natural-language indication that the skill is China-specific or that users can choose another language. This can constitute a language/locale policy issue when a skill effectively forces one language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Natural-language strings in the module docstring, API descriptions, error messages, and startup output are entirely in Chinese, with no indication that users may choose another language. That can violate a language/locale policy when a skill implicitly enforces a specific language without opt-in or documented regional justification.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens reproducibility and can unintentionally introduce vulnerable or breaking releases into the deployment.

Content

Scanner excerpt · backend/requirements.txt (reported line 1)May include surrounding context.

text
fastapi>=0.100.0
uvicorn>=0.23.0
pydantic>=2.0.0

Unverifiable Dependency: fastapi has 3 known advisory(ies) (CVE-2021-32677 (Cross-Site Request Forgery (CSRF) in FastAPI); CVE-2021-32677 (FastAPI is a web framework for building APIs with Python 3.6+ based on standard ); CVE-2024-24762 (FastAPI is a web framework for building APIs with Python 3.8+ based on standard )), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

Because FastAPI is not pinned, it is impossible to determine from this manifest whether the deployed version includes known advisories. The danger is not a confirmed vulnerable package in this file, but the inability to verify exposure and reliably prevent installation of affected releases.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

Using an unpinned version for uvicorn means the installed package may vary between environments or over time. This creates supply-chain and patch-management risk because an unexpected release could contain a vulnerability or incompatible behavior.

Content

Scanner excerpt · backend/requirements.txt (reported line 2)May include surrounding context.

text
fastapi>=0.100.0
uvicorn>=0.23.0
pydantic>=2.0.0

Unverifiable Dependency: uvicorn has 4 known advisory(ies) (CVE-2020-7694 (Log injection in uvicorn); CVE-2020-7695 (HTTP response splitting in uvicorn); CVE-2020-7694 (This affects all versions of package uvicorn. The request logger provided by the) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The unpinned uvicorn requirement prevents verification of whether the runtime package version is impacted by published advisories. This creates uncertainty in the security posture and may permit installation of an affected release during deployment or rebuilds.

Content

No source excerpt is available for this finding.