Back to skill

Security audit

order-agent 智能订单处理

Security checks for vulnerabilities and agentic risk

Overview

This WMS order skill mostly matches its purpose, but it needs Review because it can submit real shipment/order data containing recipient PII and some scripts allow arbitrary API destinations and CLI-supplied tokens.

Install only if you trust the WMS backend and will use it in a controlled fulfillment workflow. Before submitting real orders, verify the destination URL, avoid passing API keys on the command line, require a human review of recipient data and batch size, and treat generated output files as sensitive customer/order records.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/create_shipment.py:66
Finding
Arbitrary API destination can expose shipment data and WMS credentials## Vulnerability Details **File Location**: `scripts/create_shipment.py:66-74`, `scripts/create_shipment.py:91-92`, and `scripts/create_shipment.py:106-107` **Vulnerability Type**: Unrestricted transmission of sensitive information to a user-controlled endpoint **Risk Level**: High ### Vulnerable Code ```python # Request headers headers = { "Content-Type": "application/json", "Authorization": f"Bearer {api_key}" } try: response = requests.post(api_url, json=payload, headers=headers, timeout=30) response.raise_for_status() return response.json() ``` ```python parser.add_argument("--api-url", default=WMS_API_URL, help="WMS API address") parser.add_argument("--api-key", default=WMS_API_KEY, help="WMS API key") ``` ```python api_url=args.api_url, api_key=args.api_key ``` ### Technical Analysis The script sends the recipient's name, telephone number, physical address, order details, remarks, and a Bearer credential to `api_url`. Creating a shipment legitimately requires sending this information to an authorized WMS service. However, `--api-url` permits callers or agent-generated commands to replace the documented WMS endpoint with an arbitrary destination. No scheme validation, hostname allowlist, trusted-origin check, or redirect policy is applied before the request. Consequently, a command that selects an attacker-controlled HTTPS server will transmit both the sensitive shipment payload and the `Authorization` header directly to that server. This exceeds least privilege because the declared functionality only requires communication with the configured WMS service, not arbitrary Internet hosts. The API key is also accepted through a command-line argument. On applicable systems, command-line values may be retained in shell history, process inspection output, job logs, or agent execution logs. ### Attack Path 1. An attacker influences a user, automation workflow, or agent-generate ...[truncated 1464 chars]
Remediation
## Remediation Suggestions 1. Remove `--api-url` from normal runtime input and configure the WMS endpoint through an administrator-controlled configuration file. 2. If endpoint configurability is required, parse the URL and enforce: - HTTPS only; - an explicit allowlist of trusted hostnames; - the expected port and path prefix; - rejection of embedded credentials, fragments, IP literals, and malformed hosts. 3. Disable redirects with `allow_redirects=False`, or validate every redirect destination before transmitting sensitive content. 4. Do not accept API keys through command-line arguments. Load them from a protected environment variable, secret manager, or credential file with restrictive permissions. 5. Avoid logging credentials, complete recipient data, or raw request payloads. 6. Use a narrowly scoped WMS credential that can perform only the shipment operation required by this Skill, and rotate any credential that may have appeared in command history or execution logs. 7. Require explicit user confirmation showing the trusted destination hostname before transmitting recipient information.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/batch_create_shipment.py:23
Finding
Batch shipment processing can exfiltrate multiple recipients and a WMS token## Vulnerability Details **File Location**: `scripts/batch_create_shipment.py:23-31`, `scripts/batch_create_shipment.py:224-225`, and `scripts/batch_create_shipment.py:233-234` **Vulnerability Type**: Unrestricted batch transmission of sensitive information to a user-controlled endpoint **Risk Level**: High ### Vulnerable Code ```python headers = { "Content-Type": "application/json", "Authorization": f"Bearer {api_key}" } try: response = requests.post(api_url, json=order_data, headers=headers, timeout=30) response.raise_for_status() return response.json() except requests.exceptions.RequestException as e: return { "success": False, "message": f"Request failed: {str(e)}", "error": str(e) } ``` ```python parser.add_argument("--api-url", default=WMS_API_URL, help="WMS API address") parser.add_argument("--api-key", default=WMS_API_KEY, help="WMS API key") ``` ```python api_url=args.api_url, api_key=args.api_key ``` The batch payload transmitted by the vulnerable request is constructed as follows: ```python payload = { "orderNo": order_no, "warehouseCode": warehouse_code, "consignee": { "name": order.get('consignee_name', ''), "phone": order.get('phone', ''), "address": order.get('address', '') }, "items": [ { "sku": order.get('isbn', order.get('item_name', '')), "name": order.get('item_name', ''), "quantity": int(order.get('quantity', 1)) } ], "remark": order.get('remark', '') } ``` ### Technical Analysis The batch script reads recipient and order information from an Excel file and submits each row to `api_url`. Transmission to an authorized WMS endpoint is necessary for the declared batch-shipment functionality. Nevertheless, the destination is directly controllable through `--api-url` and is not restricte ...[truncated 2281 chars]
Remediation
## Remediation Suggestions 1. Remove arbitrary per-invocation endpoint selection. Use an administrator-controlled WMS endpoint. 2. Where multiple WMS deployments must be supported, map a predefined deployment identifier to a trusted URL rather than accepting a raw URL. 3. Enforce HTTPS and an explicit hostname, port, and path allowlist before processing the workbook. 4. Disable automatic redirects or validate redirect destinations before sending any request body. 5. Retrieve the API token from a secret manager or protected environment variable instead of `--api-key`. 6. Use a least-privileged, short-lived credential and rotate credentials exposed through command histories or logs. 7. Display the destination hostname, number of recipients, and categories of personal data to be sent, then require explicit confirmation before starting the batch. 8. Add an administrator-defined batch-size limit and consider a dry-run mode that validates and summarizes records without transmitting them. 9. Minimize transmitted fields and omit empty or unnecessary remarks and identifiers. 10. Ensure errors and result files do not contain credentials or unnecessary personal data, and write any required output with restrictive file permissions.
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
核心功能大体相关:代码确实会从Excel读取订单信息并调用WMS API批量创建发货单,这与声明中的批量发货单处理主旨一致。但仍存在实质性不一致。首先,声明明确支持Excel/CSV导入,而代码只支持Excel,没有CSV解析逻辑。其次,声明提到“采购/下单”等更泛化操作,但代码并未实现采购或通用订单创建,只是创建WMS发货单。最后,声明描述为一个可按用户请求调用的“助手/技能”,而实际提供的是需要命令行参数运行的脚本,没有体现交互式触发处理。因此应判定为存在描述与实际行为不完全匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
代码的核心功能与描述部分重叠:它确实会调用WMS API创建发货单。但声明描述了一个更高层的“智能订单处理助手”,包括批量处理、从Excel/CSV导入并提取标准字段等能力;而实际代码仅支持通过CLI参数传入单个订单的数据,不包含任何文件读取、表格解析、批量遍历、采购流程或助手交互逻辑。因此描述显著高于代码实际能力,存在描述与行为不一致。

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
该描述与代码部分匹配,因为代码确实会调用WMS后端创建订单;但存在实质性不一致。最明显的是,描述宣称支持从Excel/CSV提取订单信息以及批量处理订单,而代码中完全没有任何Excel/CSV读取、表格解析、循环批量创建订单的实现。相反,代码是一个命令行脚本,接收单个订单参数并发送到/createOrder接口。此外,代码还实现了一个额外的商品查询能力(/goods/queryGoods),这属于未在描述中说明的功能。综合来看,技能描述高估了已实现能力,并遗漏了实际存在的查询功能,因此应判定为描述与行为不一致。

Vague Triggers

Medium
Confidence
95% confidence
Finding
The example trigger phrases are broad enough to overlap with ordinary shopping or ordering conversations, which can cause the skill to activate unexpectedly. In this skill’s context, accidental activation is more dangerous because it can lead to product lookup, bulk order handling, or eventual creation of WMS shipment orders tied to real-world transactions.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill processes highly sensitive personal data, including recipient name, phone number, and full address, and transmits it to a remote WMS API, but the README does not provide an explicit privacy notice, data-handling warning, or user-consent guidance. In this context, the risk is elevated because the skill supports remote order creation and batch imports from Excel, increasing the chance of unintentional bulk disclosure of personal data.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill documents networked order creation and implies script-based execution, but it does not declare any explicit tool scope such as allowed network or file capabilities. This creates a governance gap: an agent may invoke broader capabilities than reviewers or users expect, especially for outbound requests and potential file handling around order imports.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger phrases are broad enough to match ordinary requests such as '帮我下单', which could cause the skill to activate in contexts the user did not intend. Because this skill can transmit personal data and create external orders, accidental invocation can lead to unauthorized actions or unintended data disclosure.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill handles sensitive personal data including recipient name, phone number, and address, then sends it to an external WMS API without an explicit privacy or data-transfer warning. In this context, that omission is dangerous because users may provide regulated or sensitive PII without informed consent, and the skill also performs a consequential action by creating orders externally.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The API documentation explicitly instructs transmitting personally identifiable information, including recipient name, phone number, and address, but provides no warning, minimization guidance, retention expectations, or privacy/security handling requirements. In the context of an order-processing skill that imports bulk Excel/CSV data and submits shipment requests, this increases the risk of accidental over-collection, mishandling, or unauthorized disclosure of sensitive customer data.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
Natural-language strings throughout the file, including the module description and CLI help text, are fixed to Chinese with no option for users to select another language. This is a locale/language policy concern because the skill imposes a language choice rather than making it configurable or clearly documenting that it is intentionally region-specific.

External Transmission

Medium
Category
Data Exfiltration
Content
}
    
    try:
        response = requests.post(api_url, json=order_data, headers=headers, timeout=30)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
Confidence
92% confidence
Finding
This code performs external transmission of order payloads containing PII to a remote API. In this skill, that behavior is expected for order fulfillment, but it still creates real exposure if the endpoint is misconfigured, untrusted, or used without adequate notice, authentication handling, and privacy controls.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script sends consignee name, phone number, address, and order details to a remote WMS endpoint, which is a transfer of sensitive personal and shipping data. Although network transmission is the intended function of this skill, the code provides no explicit consent flow, data minimization, or operator warning, increasing privacy and compliance risk if used on real customer data.

External Transmission

Medium
Category
Data Exfiltration
Content
}
    
    try:
        response = requests.post(api_url, json=payload, headers=headers, timeout=30)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
Confidence
81% confidence
Finding
This code performs an external HTTP POST containing order and recipient data to a configurable URL, which is a real data egress point. In the context of an order-processing skill that handles names, phone numbers, addresses, and potentially bulk spreadsheet imports, external transmission is security-relevant because misconfiguration, endpoint substitution, or use of an unapproved API URL could expose sensitive customer data to third parties.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script transmits personally identifiable information including recipient name, phone number, and address to a remote WMS endpoint, but the CLI flow provides no explicit notice, consent step, or data-handling disclosure. In an agent skill that may process imported spreadsheets or bulk orders, this increases the risk of users sending sensitive recipient data to an external service without realizing the privacy implications or verifying the endpoint.

External Transmission

Medium
Category
Data Exfiltration
Content
payload["stockId"] = stock_id
    
    try:
        response = requests.post(url, json=payload, timeout=TIMEOUT)
        response.raise_for_status()
        result = response.json()
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
    
    try:
        response = requests.post(url, json=payload, timeout=TIMEOUT)
        response.raise_for_status()
        result = response.json()
Confidence
91% confidence
Finding
This network call sends full order payloads containing personally identifiable information and potentially account-linked fields to an external production endpoint. In the context of an agent skill that can process imported spreadsheets and batch orders, this materially increases the chance of bulk unintended disclosure or irreversible order creation.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The create_order path transmits sensitive personal data including recipient name, phone number, and full address, plus order details, to a real external backend. In an agent-skill context this is risky because users may trigger the action without clearly understanding that live fulfillment data is being sent to a production system.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script accepts a session_key from command-line input and forwards it to the backend without any special handling, masking, or warning. Credentials passed via CLI can be exposed through shell history, process listings, logs, or agent traces, creating a real risk of credential leakage and unauthorized API use.

Natural-Language Policy Violations

Low
Confidence
79% confidence
Finding
All user-facing descriptive and instructional text in the skill file is presented only in Chinese, which can impose a language constraint without explicit user opt-in. The file does not state that the skill is intentionally limited to a Chinese-language or region-specific audience.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
All natural-language headings, field descriptions, and messages in the file are presented in Chinese only. Under the stated policy, forcing a specific language without user opt-in or a documented justification is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
User-facing strings such as the module description, argument descriptions, and help text are all presented in Chinese. The file does not indicate that the tool is region-specific or provide any opt-in or alternative locale, which may violate a language/locale policy requiring user choice or justification.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
User-facing descriptions, help strings, and messages throughout the script are written only in Chinese, which effectively forces a single language experience. The file does not offer user opt-in for language selection or explain that the tool is intentionally limited to a Chinese-speaking context.

Static analysis

No suspicious patterns detected.