Back to skill

Security audit

Xyfcli Order Guide

Security checks for vulnerabilities and agentic risk

Overview

This is a real fertilizer-ordering skill, but it needs review because it can submit order drafts, modify customer addresses, expose authentication tokens, and includes unsafe address and validation guidance.

Review this before installing in any production account. Use a least-privilege or test token, avoid running config show --json, rotate any token exposed in logs or transcripts, and do not allow cross-customer address reuse. Confirm that the backend enforces dealer product authorization, inventory, address ownership, and payment-mode validation before trusting this for real orders.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/xyfcli/config.py:52
Finding

Bearer Token Stored in Plaintext and Exposed Through Configuration Output

Content
View full analysis
None: """保存配置文件""" # 确保配置目录存在 CONFIG_DIR.mkdir(parents=True, exist_ok=True) with open(CONFIG_FILE, "w", encoding="utf-8") as f: json.dump(config, f, indent=2, ensure_ascii=False) ``` ```python def show_config( json_output: bool = typer.Option(False, "-j", "--json", help="输出JSON格式") ): """显示当前配置""" config = load_config() if json_output: format_output(config, json_output) else: typer.echo("当前配置:") typer.echo(f" API 基础 URL: {config.get('base_url', DEFAULT_CONFIG['base_url'])}") typer.echo(f" Authorization Token: {config.get('authorization_token', DEFAULT_CONFIG['authorization_token'])[:20]}...") ``` ```python if json_output: result = { "success": True, "message": "配置文件已初始化", "config": config } format_output(result, json_output) else: typer.echo("配置文件已初始化") typer.echo(f" API 基础 URL: {base_url}") typer.echo(f" Authorization Token: {token[:20]}..." if len(token) > 20 else f" Authorization Token: {token}") ``` ### Technical Analysis The CLI stores its bearer authorization token in `~/.xyfcli/config.json` as unencrypted JSON. The configuration directory and file are created without explicitly enforcing owner-only permissions such as `0700` for the directory and `0600` for the file. Their effective permissions therefore depend on the process umask and surrounding environment. In addition, `xyfcli config show --json` serializes the entire configuration object, including the complete `authorization_token`. The JSON form of `config init` also includes the complete configuration. In normal output, ...[truncated 1505 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/xyfcli/order.py:274
Finding

Order Submission Does Not Enforce Dealer Product Authorization or Available Inventory

Content
View full analysis
Remediation
View remediation
= requested_quantity` for every product and selected base before constructing the order payload. 6. Verify that the selected delivery base is authorized for every product, not only the first product. 7. Return a consolidated validation failure and do not call `saveOrderDrafts` when any check fails. 8. Enforce the same dealer authorization, base eligibility, and inventory constraints on the server to prevent direct API bypass. 9. Add negative tests for unauthorized products, empty stock responses, insufficient inventory, invalid bases, and multi-product orders with mixed eligibility. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/xyfcli/order.py:51
Finding

Shipping Payment Modes Are Inconsistently Mapped and Invalid Values Silently Fall Back

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (53)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description omits real write-capable behavior such as adding or editing customer delivery addresses while claiming other capabilities that may not be present. In a business workflow skill, undisclosed data-modification functions are risky because operators may authorize use expecting read-only lookup or simple ordering assistance, not CRM record changes.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The skill description omits real write-capable behavior such as adding or editing customer delivery addresses while claiming other capabilities that may not be present. In a business workflow skill, undisclosed data-modification functions are risky because operators may authorize use expecting read-only lookup or simple ordering assistance, not CRM record changes.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The skill description omits real write-capable behavior such as adding or editing customer delivery addresses while claiming other capabilities that may not be present. In a business workflow skill, undisclosed data-modification functions are risky because operators may authorize use expecting read-only lookup or simple ordering assistance, not CRM record changes.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly offers using another customer's saved address to complete an order when the intended customer lacks an address. That enables cross-customer data misuse, misdelivery, and unauthorized association of one customer's logistics data with another customer's order, which is a serious integrity and privacy issue in an order-management context.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation suggests reusing another customer's saved address to finish an order, effectively endorsing a cross-entity reference that should be forbidden. This can result in unauthorized disclosure of address data, shipment mistakes, fraudulent order routing, and corrupted customer records.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill invokes a local CLI that can read local files during installation/configuration, write configuration state, and communicate with an HTTP API, but it declares no explicit tool scope or permission boundaries. In an order-management skill that can place real orders and modify addresses, missing scope increases the chance of unintended or overbroad agent actions and reduces reviewability.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description does not disclose that the skill can create and modify customer addresses, even though the body instructs the agent to perform those actions. This omission weakens informed consent and can lead to unauthorized modification of customer master data in production systems.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description declares trigger words such as “下单”, “订货”, “查产品”, and “查客户”, which are generic phrases that can occur in many routine conversations. The file does not provide exclusion conditions or contextual constraints to distinguish fertilizer-order operations from unrelated requests, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill lacks a clear warning that it can create or modify real customer addresses and place actual business orders, despite documenting both actions. In a transactional enterprise setting, insufficient disclosure increases the risk of unintended writes to production systems and social-engineering-style misuse by making high-impact actions appear routine.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 32)May include surrounding context.

md
**你可以帮用户做这些事:**

| 能力           | 触发词/示例                                                                                                        | 说明           |
| ------------ | ------------------------------------------------------------------------------------------------------------- | ------------ |
| 🛒 **快速下单**  | "帮吉林市文英化肥经销有限责任公司下26吨Y14002510160020000,吉林新洋丰基地出发,汽运,统派车(客户付款),到吉林省吉林市蛟河市公安局乌林派出所八家子警务室,邱文英收,联系方式13394403131" | 一句话下单,自动验证   |
| 📦 **查产品**   | "看看有什么复合肥"、"查 45% 的产品"                                                                                        | 查询客户可购买的产品列表 |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 35)May include surrounding context.

md
| 能力           | 触发词/示例                                                                                                        | 说明           |
| ------------ | ------------------------------------------------------------------------------------------------------------- | ------------ |
| 🛒 **快速下单**  | "帮吉林市文英化肥经销有限责任公司下26吨Y14002510160020000,吉林新洋丰基地出发,汽运,统派车(客户付款),到吉林省吉林市蛟河市公安局乌林派出所八家子警务室,邱文英收,联系方式13394403131" | 一句话下单,自动验证   |
| 📦 **查产品**   | "看看有什么复合肥"、"查 45% 的产品"                                                                                        | 查询客户可购买的产品列表 |
| 👥 **查客户**   | "我有哪几个客户"、"查客户列表"                                                                                             | 查询你名下的所有客户   |
| 📍 **查地址**   | "牛建建的地址在哪"                                                                                                    | 查询客户的收货地址    |
| ➕ **新增地址**   | "给牛建建新增一个地址"                                                                                                  | 新增客户收货地址     |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 36)May include surrounding context.

md
| ------------ | ------------------------------------------------------------------------------------------------------------- | ------------ |
| 🛒 **快速下单**  | "帮吉林市文英化肥经销有限责任公司下26吨Y14002510160020000,吉林新洋丰基地出发,汽运,统派车(客户付款),到吉林省吉林市蛟河市公安局乌林派出所八家子警务室,邱文英收,联系方式13394403131" | 一句话下单,自动验证   |
| 📦 **查产品**   | "看看有什么复合肥"、"查 45% 的产品"                                                                                        | 查询客户可购买的产品列表 |
| 👥 **查客户**   | "我有哪几个客户"、"查客户列表"                                                                                             | 查询你名下的所有客户   |
| 📍 **查地址**   | "牛建建的地址在哪"                                                                                                    | 查询客户的收货地址    |
| ➕ **新增地址**   | "给牛建建新增一个地址"                                                                                                  | 新增客户收货地址     |
| ✏️ **修改地址**  | "修改牛建建的地址"                                                                                                    | 修改客户收货地址     |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
| 🛒 **快速下单**  | "帮吉林市文英化肥经销有限责任公司下26吨Y14002510160020000,吉林新洋丰基地出发,汽运,统派车(客户付款),到吉林省吉林市蛟河市公安局乌林派出所八家子警务室,邱文英收,联系方式13394403131" | 一句话下单,自动验证   |
| 📦 **查产品**   | "看看有什么复合肥"、"查 45% 的产品"                                                                                        | 查询客户可购买的产品列表 |
| 👥 **查客户**   | "我有哪几个客户"、"查客户列表"                                                                                             | 查询你名下的所有客户   |
| 📍 **查地址**   | "牛建建的地址在哪"                                                                                                    | 查询客户的收货地址    |
| ➕ **新增地址**   | "给牛建建新增一个地址"                                                                                                  | 新增客户收货地址     |
| ✏️ **修改地址**  | "修改牛建建的地址"                                                                                                    | 修改客户收货地址     |
| 🏭 **查基地**   | "这个产品从哪发货"                                                                                                    | 查询产品的发货基地    |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
| 🛒 **快速下单**  | "帮吉林市文英化肥经销有限责任公司下26吨Y14002510160020000,吉林新洋丰基地出发,汽运,统派车(客户付款),到吉林省吉林市蛟河市公安局乌林派出所八家子警务室,邱文英收,联系方式13394403131" | 一句话下单,自动验证   |
| 📦 **查产品**   | "看看有什么复合肥"、"查 45% 的产品"                                                                                        | 查询客户可购买的产品列表 |
| 👥 **查客户**   | "我有哪几个客户"、"查客户列表"                                                                                             | 查询你名下的所有客户   |
| 📍 **查地址**   | "牛建建的地址在哪"                                                                                                    | 查询客户的收货地址    |
| ➕ **新增地址**   | "给牛建建新增一个地址"                                                                                                  | 新增客户收货地址     |
| ✏️ **修改地址**  | "修改牛建建的地址"                                                                                                    | 修改客户收货地址     |
| 🏭 **查基地**   | "这个产品从哪发货"                                                                                                    | 查询产品的发货基地    |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 40)May include surrounding context.

md
| 🛒 **快速下单**  | "帮吉林市文英化肥经销有限责任公司下26吨Y14002510160020000,吉林新洋丰基地出发,汽运,统派车(客户付款),到吉林省吉林市蛟河市公安局乌林派出所八家子警务室,邱文英收,联系方式13394403131" | 一句话下单,自动验证   |
| 📦 **查产品**   | "看看有什么复合肥"、"查 45% 的产品"                                                                                        | 查询客户可购买的产品列表 |
| 👥 **查客户**   | "我有哪几个客户"、"查客户列表"                                                                                             | 查询你名下的所有客户   |
| 📍 **查地址**   | "牛建建的地址在哪"                                                                                                    | 查询客户的收货地址    |
| ➕ **新增地址**   | "给牛建建新增一个地址"                                                                                                  | 新增客户收货地址     |
| ✏️ **修改地址**  | "修改牛建建的地址"                                                                                                    | 修改客户收货地址     |
| 🏭 **查基地**   | "这个产品从哪发货"                                                                                                    | 查询产品的发货基地    |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
| 📦 **查产品**   | "看看有什么复合肥"、"查 45% 的产品"                                                                                        | 查询客户可购买的产品列表 |
| 👥 **查客户**   | "我有哪几个客户"、"查客户列表"                                                                                             | 查询你名下的所有客户   |
| 📍 **查地址**   | "牛建建的地址在哪"                                                                                                    | 查询客户的收货地址    |
| ➕ **新增地址**   | "给牛建建新增一个地址"                                                                                                  | 新增客户收货地址     |
| ✏️ **修改地址**  | "修改牛建建的地址"                                                                                                    | 修改客户收货地址     |
| 🏭 **查基地**   | "这个产品从哪发货"                                                                                                    | 查询产品的发货基地    |
| 👤 **指定承运人** | "指定李四开车,京 A12345,电话 13900139000"                                                                              | 下单时指定承运车主信息  |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 42)May include surrounding context.

md
| ✏️ **修改地址**  | "修改牛建建的地址"                                                                                                    | 修改客户收货地址     |
| 🏭 **查基地**   | "这个产品从哪发货"                                                                                                    | 查询产品的发货基地    |
| 👤 **指定承运人** | "指定李四开车,京 A12345,电话 13900139000"                                                                              | 下单时指定承运车主信息  |
| 🖼️ **图片下单** | (发送订货单图片)                                                                                                     | OCR 识别订货单并下单 |

**首次引导时明确告知:**
> "我可以帮你:①**快速下单** ②查产品/价格/库存 ③**查客户列表** ④查/新增/修改地址 ⑤图片下单 ⑥查发货基地 ⑦下单时指定承运人信息。需要什么?"

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

One section tells the user that if no saved address exists, they must log into the external 精准营销系统 and maintain the address there before reordering. Later documentation explicitly says addresses can now be added or modified directly through the CLI without using another system, which is an active contradiction in operator guidance.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The order examples include personal and customer-related fields such as names, phone numbers, vehicle owner data, and addresses, but do not warn that these values are sensitive or that executing the command may submit a real order. In an agent setting, such examples can encourage unsafe handling of PII and accidental use of production data during testing or automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document references an authentication session cookie and tells users to keep it valid, but provides no warning that it is a credential equivalent. In practice, operators or agents may treat the cookie as routine input, causing exposure in transcripts or logs and enabling account takeover or unauthorized transactions if stolen.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document describes automatic image parsing and then using extracted text/barcode data to drive xyfcli product searches, but it does not warn that uploaded images may contain personal, customer, supplier, location, or other sensitive business information. In an order-management context, users may upload labels, invoices, screenshots, or photos that unintentionally expose sensitive data, so lack of privacy/data-handling guidance creates a real risk of inappropriate collection, retention, or downstream use of that data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The workflow explicitly instructs the agent to display stored customer addresses, contact names, and phone numbers during address selection and order confirmation. Although customer lookup is in scope, exposing full personal data by default exceeds the minimum necessary disclosure for order placement and increases privacy and unauthorized disclosure risk, especially in a conversational interface.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide tells the agent to retrieve, display, and reuse full customer personal data from stored records across multiple steps and in the final order summary. Repeated exposure and propagation of full PII increases the attack surface for data leakage, transcript retention risk, and unauthorized disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow presents full customer names, detailed addresses, and phone numbers without any privacy handling guidance or access check. In a chat workflow, this creates an avoidable risk of exposing personal data to the wrong requester or in an over-broad context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the agent to reveal a direct internal system URL for maintaining customer addresses. Disclosing internal administrative endpoints is unnecessary for routine ordering and can aid enumeration, social engineering, or unauthorized access attempts against internal business systems.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.