Back to skill

Security audit

virtual-item-constructor

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it can automatically call internal product-management tools that clone, reprice, list or delist, and change tags with insufficient safeguards.

Install only if you trust the publisher and the backing internal services to enforce test-only restrictions server-side. Before use, require explicit confirmation for cloning, repricing, listing-state changes, and tag changes, and verify the target item is a test item immediately before each mutation.

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

Error
Location
SKILL.md:53
Finding

Missing Test-Item Validation Before Destructive Item Mutations

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:53-57, SKILL.md:62-68, SKILL.md:83-101, and scripts/tool_d9be0gk8fx.py:76-105,135-147
Vulnerability Type: Missing authorization and safety validation before modifying item prices and tags
Risk Level: High

Vulnerable Code and Instructions

The property-based search workflow sends any matched item directly to the price-changing step without confirming that it is a test item:

markdown
### Step 3: Determine Whether to Search by Item Properties

If the final search criteria contain item properties (`itemProperties`):

1. Invoke the item search-by-merchant-and-properties tool, passing only `itemProperties`; `sellerId` is not required
2. If an item is found → jump to Step 6 (change price)
3. If no item is found → tell the user that no matching item was found and it must be published manually

The title-based search workflow has the same trust assumption:

markdown
### Step 4: Find an Existing Test Item (Without Properties)

If there are no item-property conditions, try to find an existing test item:

1. Iterate through all available categories
2. Invoke the item-search tool, set the title to `测试,请不要拍`, and include category and tag conditions
3. Once any item is found → record its item ID and jump to Step 6

The subsequent steps perform destructive mutations:

markdown
### Step 6: Adjust the Price According to the User's Request

If the user specified a price (default: 1 cent):

1. Invoke the SKU-ID retrieval tool
2. Invoke the item price-change tool:
   - `itemId`: current item ID
   - `skuId`: value obtained above
   - `price`: user-specified price, in cents

### Step 7: Remove Item Tags That Should Not Be Present

1. Query the knowledge base
2. Query the item's actual tags
3. If an unwanted tag is found, invoke the tagging/removal tool:
   - `itemId`: current item ID
   - `removeTagId`: tag ID to remove

The repricing wrapper performs no local validation and forwards call ...[truncated 4280 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require test-item verification immediately before every mutation.

    • Invoke the dedicated test-item checker before repricing, changing listing state, adding tags, or removing tags.
    • Continue only when the response explicitly and unambiguously confirms test-item status.
    • Treat errors, missing fields, timeouts, and indeterminate responses as denial conditions.
  2. Enforce the restriction server-side.

    • The repricing, listing-state, and tagging services must independently reject non-test items.
    • Do not rely solely on Agent instructions or client-side checks.
    • Validate the item's immutable test-account identity and environment marker rather than its title.
  3. Bind verification to mutation.

    • Use a short-lived, server-issued authorization token containing the verified item ID, intended operation, caller, and expiration.
    • Require mutation endpoints to validate that token to prevent time-of-check/time-of-use substitution.
  4. Restrict eligible sellers and items.

    • Maintain an authoritative allowlist of test seller IDs.
    • Verify the seller from trusted item metadata rather than accepting user-provided seller names or search filters.
    • Reject item IDs outside the designated test environment.
  5. Harden price changes.

    • Remove the automatic one-cent default or require explicit user confirmation before applying it.
    • Apply minimum and maximum test-price policies.
    • Display and confirm the item ID, seller, current price, and proposed price before mutation.
  6. Harden tag removal.

    • Revalidate test-item status immediately before each tag mutation.
    • Use an allowlist of tags that the Skill is authorized to add or remove.
    • Make knowledge-base output advisory only; do not treat retrieved text as authorization.
  7. Improve auditing and recovery.

    • Log the verified item identity, seller, old and new values, caller, verification result, and trace ID.
    • Add idempote ...[truncated 118 chars]
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (41)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明的核心功能是一个面向测试商品生命周期的复合能力:查找、构造、克隆、改价、清标签。实际代码仅是一个远程工具调用器,且配置的 TOOL_NAME 明确为“商品信息查询”。从可见代码看,它主要负责解析命令行 JSON、合并 systemParams、读取 skill token,并向 /api/skill/tool/invoke 或 /api/tool/invoke 发请求。虽然远程服务理论上可能执行更多操作,但这些能力并未在提供的代码中得到体现;相反,代码可确认的主要用途是调用一个商品信息查询类工具。因此,代码实际行为与声明描述的主要目的存在明显不一致,应判定为 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

从可见代码看,其核心行为是将输入参数转发到远程 API /api/skill/tool/invoke 或 /api/tool/invoke,所配置的工具名称明确为“通过商家id与属性查找商品”。代码没有任何本地商品构造、克隆、改价、标签清理等实现,也没有体现按类目、业务身份、商品标等更广泛条件处理的逻辑。虽然远程服务可能具备更多能力,但基于当前可审计代码,实际暴露和描述的能力明显不一致,且主能力更接近“查找商品”而非完整的测试商品构造与管理,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

根据可见代码,这段程序的主要行为是将输入参数转发到远程 API /api/skill/tool/invoke 或 /api/tool/invoke,调用一个工具名为“商品查找”的后端能力。它不包含任何本地业务逻辑来执行‘构造测试商品、克隆、改价、清理标签’等操作,也没有代码证据表明会根据类目、业务身份、商品属性、商品标等条件完成这些声明中的复合功能。虽然远程服务理论上可能实现更多能力,但从当前代码块可验证的实际行为来看,其明确呈现的是一个针对“商品查找”的调用器,而不是描述中的综合测试商品构造/管理工具。因此描述与代码行为存在实质不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

该代码块本质上是一个标准化的远程工具调用器,唯一能明确识别的业务意图来自元数据 TOOL_NAME=“获取商品skuId”。除将输入参数转发到 TBMCP 接口外,代码没有任何与‘构造合规测试商品’相关的本地业务逻辑,也没有体现查找、克隆、改价、清标签等能力。即使远端服务可能执行其他操作,从当前代码可验证的实际行为和配置来看,其已声明用途与实际代码表现出的主用途存在明显不一致,因此应判定为 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

根据提供的代码,唯一可确认的行为是向 TBMCP 远程接口发起 POST 请求,请求中指定的工具名称为“IC-商品打标&去标”。代码负责读取 SKILL.md 中的 token、拼装 payload、发送请求、处理错误并输出返回数据。这属于通用调用器/代理层实现,而不是声明中所说的“智能构造合规测试商品、查找/克隆商品、自动改价和清理标签”的具体业务实现。尤其是工具名明确指向“打标&去标”,与声明的主功能“构造测试商品/查找商品/克隆商品/改价”并不一致。虽然声明中提到“清理标签”,与去标有部分重合,但这只能覆盖很小一部分;整体主用途明显不匹配。因此应判定为描述与实际代码行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述的是一个面向测试商品构造与管理的业务技能,但提供的代码仅是通用的代理调用包装器。它负责将 question/systemParams/variables 发送到远程 Agent Runtime,再轮询获取结果并输出。代码中没有任何与商品、类目、业务身份、商品属性、商品标、克隆、价格修改、标签清理相关的具体业务处理,也没有访问相应商品系统接口。其主要目的与声明明显不一致:声明是具体商品测试工具,实际代码是通用调用某个远程 agent 的客户端壳层。因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述聚焦于测试商品的构造、查找、克隆、改价和标签清理等商品管理能力;但代码中没有任何商品、类目、业务身份、商品属性、商品标、价格或标签处理逻辑。它仅将输入的 query 发送到 knowledgeSearch 接口并输出返回结果,主要用途是知识库检索。这属于主要目的和实际能力均明显不一致,应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

依据提供的代码,只能确认该脚本是一个通用远程调用器,用于把输入参数转发到 TBMCP 的某个工具接口。代码中唯一明确的业务语义来自固定元数据,其中 TOOL_NAME 为“商品上下架”,这更像是商品上架/下架操作,而不是声明中的测试商品构造、查找、克隆、改价和清标签。由于实际业务逻辑都在远程服务端,当前代码块并未证明其具备声明的核心能力,且显式暴露出的工具名称与声明用途存在明显偏差,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

从可见代码判断,其核心功能是作为远程工具调用器,将输入参数转发到 TBMCP 服务端的一个工具,且工具名硬编码为“商品改价”。声明则描述了一个多能力商品测试构造/查找/克隆/改价工具。由于代码中没有任何本地实现能证明这些广泛能力,且唯一明确暴露的业务语义仅是“商品改价”,因此代码实际行为与声明用途存在明显不一致。虽然远程服务端也许可能实现更多功能,但基于所提供代码块,无法支持如此宽泛的声明。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

根据代码可见行为,这个脚本仅负责把参数转发到远程工具接口,且所绑定的工具元数据明确写着 TOOL_NAME = “判断商品是否是测试商品”。从可观察到的实际用途看,它主要对应‘判断某商品是不是测试商品’这一单一判定能力。相比之下,声明描述的是一个更复杂的测试商品构造/查找/克隆/改价/清理标签工具,主功能范围明显更广且性质不同。虽然远程接口内部可能做更多事,但就该代码块及其明确绑定的工具信息而言,声明与实际行为存在显著不一致,应判定为 mismatch。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The hardcoded tool metadata identifies the capability as “获取商品skuId” while the skill manifest describes a broader virtual test-item construction workflow including search, clone, repricing, and tag cleanup. This semantic mismatch is dangerous because it can mislead reviewers, users, or policy enforcement about what action is actually being invoked, undermining least-privilege assumptions and making unauthorized data access or unintended operations harder to detect.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script metadata and embedded tool identifiers point to invoking a remote tool named 'IC-商品打标&去标' while the declared skill purpose is virtual item construction. This capability mismatch is dangerous because users and reviewers may believe they are operating on test-item construction flows, but the wrapper can actually perform item tagging or untagging actions against a backend service, creating a confused-deputy risk and enabling unauthorized or unintended state changes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implemented behavior sends arbitrary user-supplied queries to an external knowledge-search endpoint, which materially differs from the declared purpose of constructing or managing virtual test items. This capability mismatch is dangerous because it can silently exfiltrate user inputs or be used as an undeclared data-access primitive under a misleading skill identity, reducing user and platform ability to apply correct trust boundaries and review controls.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill metadata describes a tool for constructing/searching/cloning compliant test items and adjusting prices, but the hardcoded remote tool identifiers invoke '商品上下架' (listing/unlisting products). This mismatch can cause the agent to perform materially different and potentially production-affecting actions than the user intended, creating a dangerous integrity and authorization boundary violation. In this skill context, the risk is elevated because users asking for harmless test-item operations could unknowingly trigger real inventory publication state changes.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill declares broad tool invocations without any explicit tool-scope restriction such as allowed-tools or permissions. In practice this increases the blast radius of prompt misuse or platform misconfiguration, because a workflow that can read files and access networked tools may be induced to perform actions beyond the minimum required for test-item construction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill is authorized to change prices and remove tags, both of which are state-changing actions with business impact, yet it does not require explicit user confirmation or present risk warnings. In context, this makes accidental or prompt-induced destructive modification more likely, especially since repricing and tag cleanup can affect test/production boundaries and downstream workflows.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger description includes broad natural-language examples such as helping find or construct a test item, which can overlap with ordinary conversation. Overbroad activation conditions increase the chance of accidental invocation, causing unintended searches or item-modification workflows to run in contexts where the user did not intend an operational action.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented rule says attribute-matched items must not be cloned, yet the example later clones an attribute-matched item. This inconsistency is dangerous because operators or downstream agents may follow the example instead of the policy, leading to prohibited cloning of precise-match items and potential integrity or compliance violations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill exposes a category/SPU data-construction helper unrelated to the narrowly stated purpose of virtual test-item construction. Extra capabilities widen the attack surface and create an opportunity for misuse or prompt-driven task pivoting into adjacent business operations not covered by the skill's stated trust boundary.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description includes broad trigger phrases such as helping find or construct a test product, clone a product, or modify test product pricing from ordinary user wording. This can cause the skill to be invoked for ambiguous requests and perform sensitive commerce-related actions without sufficiently explicit user intent, increasing the chance of unintended cloning, price changes, or test-account operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code extracts skill-token from SKILL.md and includes it as X-Skill-Token in outbound requests. Accessing and transmitting a credential-like value is a sensitive operation, and this file does not provide a visible warning, confirmation, or explanatory comment to users about that behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script constructs a JSON payload containing params, systemParams, and platform metadata, then sends it via HTTP POST to a remote service. Although there is error logging, there is no confirmation prompt or explicit user-facing disclosure that input data will be transmitted off-host, which is a safety-relevant behavior for code files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script reads a skill-token from SKILL.md and later places it into the X-Skill-Token header for the outbound request. This is access to credential-like data and transmission of it to a remote endpoint, but the file provides no user-facing warning, prompt, or disclosure beyond internal comments/docstrings.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code serializes the payload, including user-provided params and systemParams, and sends it via HTTP POST to a remote service. Although the module docstring says it invokes a tool interface, there is no runtime print/log, confirmation, or explicit warning in this file that user input and contextual system data will be transmitted off-host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code packages params, systemParams, and platform metadata into a POST request and sends them to a remote TBMCP service. Although the module docstring says it invokes a tool interface, the script provides no explicit user-facing warning at execution time that supplied data will be transmitted over the network.

Content

No source excerpt is available for this finding.