T09 · Insecure Skill Coding Practices
- 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, andscripts/tool_d9be0gk8fx.py:76-105,135-147
Vulnerability Type: Missing authorization and safety validation before modifying item prices and tags
Risk Level: HighVulnerable 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 manuallyThe 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 6The 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 removeThe repricing wrapper performs no local validation and forwards call ...[truncated 4280 chars]
- Remediation
View remediation
Remediation Suggestions
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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]
-
