Back to skill

Security audit

07 After Sales Service

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed Chinese after-sales/customer-service reference skill with advisory calculators; it has scope and validation cautions but no hidden execution, persistence, or data access.

Use this skill as Chinese-language guidance and decision support, not as an automated authority. Validate inputs and require human/business approval before applying refunds, commission deductions, supplier penalties, blacklisting, delisting, or payment freezes.

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

Warning
Location
SKILL.md:429
Finding
Unvalidated Numeric Inputs Permit Invalid Refund Calculations<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 429-443 **Vulnerability Type**: Improper input validation in financial calculations **Risk Level**: Medium ### Vulnerable Code ```python ordered_total = product_price * quantity_ordered if quantity_received == 0: refund_amount = ordered_total else: refund_amount = product_price * ( quantity_ordered - max(quantity_received, quantity_acceptable) ) ``` ### Technical Analysis The refund calculator performs arithmetic directly on caller-controlled price and quantity values without validating their ranges or relationships. In particular, it does not enforce the following expected invariants: ```text product_price >= 0 quantity_ordered >= 0 0 <= quantity_acceptable <= quantity_received <= quantity_ordered ``` If `quantity_received` or `quantity_acceptable` exceeds `quantity_ordered`, the subtraction produces a negative quantity and therefore a negative refund. Negative prices or quantities can also produce invalid totals. Conversely, inconsistent values may result in excessive or otherwise incorrect refund recommendations. The interactive wrapper catches only conversion errors. It does not reject successfully parsed but invalid values. The function itself also exposes no validation boundary, so direct callers can supply arbitrary numeric arguments. Using binary floating-point values for currency additionally creates a risk of rounding discrepancies, although the primary vulnerability is the absence of range and consistency validation. ### Attack Path 1. An attacker or malformed upstream record supplies inconsistent values, such as: ```python calculate_refund( product_price=25.0, quantity_ordered=2, quantity_received=5, quantity_acceptable=0, problem_type="shortage", is_platform_fault=False, ) ``` 2. The function calculates: ```text 25 × (2 - 5) = -75 ``` 3. The negative amount is returned as the recommend ...[truncated 944 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate all inputs inside `calculate_refund`, rather than relying only on the interactive wrapper. 2. Require a finite, non-negative product price. 3. Require integer, non-negative quantities. 4. Enforce the relationship: ```text 0 <= quantity_acceptable <= quantity_received <= quantity_ordered ``` 5. Reject invalid data with a structured validation error; do not silently substitute defaults. 6. Clamp the computed refund to the valid business range only as defense in depth: ```text 0 <= refund_amount <= ordered_total ``` Validation should remain the primary control. 7. Use `decimal.Decimal` with an explicit rounding policy for currency. 8. Add unit tests for negative values, zero values, non-finite values, received quantities greater than ordered quantities, and unusually large values. Example hardening: ```python from decimal import Decimal import math if not math.isfinite(product_price) or product_price < 0: raise ValueError("Product price must be finite and non-negative.") if any( not isinstance(value, int) for value in (quantity_ordered, quantity_received, quantity_acceptable) ): raise TypeError("Quantities must be integers.") if not ( 0 <= quantity_acceptable <= quantity_received <= quantity_ordered ): raise ValueError("Quantity values are inconsistent.") price = Decimal(str(product_price)) ordered_total = price * quantity_ordered ``` ]]>

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:586
Finding
Zero Aggregate Order Count Causes KPI Analysis Denial of Service<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 586-588 **Vulnerability Type**: Unhandled division by zero **Risk Level**: Low ### Vulnerable Code ```python complaint_rate = total_complaints / total_orders * 100 refund_rate = total_refunds / total_orders * 100 refund_cost_ratio = total_refund_amount / (total_orders * 35) * 100 ``` ### Technical Analysis The KPI analyzer rejects an empty input list but does not require the aggregate `total_orders` value to be greater than zero. Therefore, a non-empty dataset containing zero-order records reaches the quoted calculations with `total_orders == 0`. Each calculation then raises an unhandled `ZeroDivisionError`. Negative order counts are also accepted and can produce nonsensical rates rather than a validation failure. Because the exception is not handled at the calculation boundary, it terminates the current reporting operation and may propagate into a calling service, batch job, or dashboard. ### Attack Path 1. A caller submits a non-empty dataset containing one or more records whose order counts total zero: ```python data = [ DailyCSData( date="2024-01-01", total_orders=0, complaint_count=1, refund_count=1, refund_amount=35.0, first_response_time=30.0, resolution_rate=85.0, csat_score=4.2, escalated_count=0, ) ] ``` 2. The existing empty-list check passes because `data` contains a record. 3. The aggregate `total_orders` value is calculated as zero. 4. The first rate calculation divides by zero. 5. Python raises `ZeroDivisionError`, and KPI report generation terminates. If the function is exposed through an application or scheduled reporting process, repeated malformed submissions could repeatedly disrupt report generation. ### Impact Assessment This issue does not grant additional privileges or permit code execution. Its scope is availability and reliability o ...[truncated 411 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate each record before aggregation: - `total_orders`, complaint counts, refund counts, and escalation counts must be non-negative integers. - Refund amounts and timing values must be finite and non-negative. - Complaint and refund counts should not exceed order counts unless explicitly supported by the data model. 2. Require aggregate orders to be greater than zero before calculating rates. 3. Return a structured validation error instead of allowing `ZeroDivisionError` to propagate. 4. Add exception isolation at API, dashboard, or batch-job boundaries. 5. Add tests for empty lists, one zero-order record, multiple records totaling zero, negative counts, and inconsistent counts. Example hardening: ```python if not data: return {"error": "No data was provided."} if any(d.total_orders < 0 for d in data): return {"error": "Order counts must be non-negative."} total_orders = sum(d.total_orders for d in data) if total_orders <= 0: return { "error": "The aggregate order count must be greater than zero." } complaint_rate = total_complaints / total_orders * 100 refund_rate = total_refunds / total_orders * 100 refund_cost_ratio = total_refund_amount / (total_orders * 35) * 100 ``` ]]>
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The manifest description is written only in Chinese, and the rest of the markdown continues in Chinese-only instructions and examples. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which is not present here.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The boundary note explicitly states the module focuses on refunds/returns, damage compensation, and complaint handling, and that supply-chain procurement is covered by a separate module with independent boundaries. Later code contradicts that by implementing a '售后-供应链联动触发器' that recommends supplier blacklisting, fines, full-product takedowns, and payment freezes.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The manifest and boundary text frame this skill as focused on after-sales handling, complaint response, customer-service operations, and policy comparison, explicitly saying supply-chain procurement belongs to another independent module. Tool 4 goes further by generating supplier penalties, blacklist decisions, product delisting, payment freezing, and procurement-grade downgrades, which are operational supply-chain governance actions rather than customer-service tooling.

Static analysis

No suspicious patterns detected.