Back to skill

Security audit

Promotion Engine

Security checks for vulnerabilities and agentic risk

Overview

The skill is not malicious, but its calculator can produce wrong or unauthorized discounts while presenting itself as accurate, so it needs review before use.

Review this skill before installing it in any workflow where quoted totals could affect real orders, customer promises, refunds, or accounting. It appears safe from a system-access perspective, but its promotion logic is incomplete and can miscalculate discounts; use only with manual verification or after fixing applicability, stacking, input validation, and unsupported promotion types.

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/calculate_promotion.py:32
Finding

Promotion applicability and exclusion rules are not enforced

Content
View full analysis
bool: applicable_to = promo.get("applicable_to", []) excluded = promo.get("excluded", []) # Check exclusions first for ex in excluded: if ex in (item_sku, item_category, "全场"): return False # Check inclusions if not applicable_to or "全场" in applicable_to: return True return item_sku in applicable_to or item_category in applicable_to ``` However, the promotion-processing loops never invoke this function and instead calculate every active supported promotion against the entire cart subtotal: ```python # Apply stackable promos first for promo in stackable_promos: ptype = promo.get("type", "") if ptype == "threshold": discount, desc = apply_threshold(promo, subtotal) elif ptype == "discount": discount, desc = apply_discount(promo, subtotal) else: continue if discount > 0: applied_promos.append({"promo": promo.get("title"), "rule": desc, "discount": discount}) total_discount += discount # For non-stackable promos, pick the best one best_nonstackable = None best_discount = 0.0 best_desc = "" for promo in nonstackable_promos: ptype = promo.get("type", "") if ptype == "threshold": discount, desc = apply_threshold(promo, subtotal) elif ptype == "discount": discount, desc = apply_discount(promo, subtotal) else: continue if discount > best_discount: best_discount = discount best_nonstackable = promo best_desc = desc ``` ### Technical Analysis Promotions can contain `applicable_to` and `excluded` restrict ...[truncated 1885 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/calculate_promotion.py:139
Finding

Non-stackable promotions are combined with stackable promotions

Content
View full analysis
0: applied_promos.append({"promo": promo.get("title"), "rule": desc, "discount": discount}) total_discount += discount ``` It then independently selects a non-stackable promotion and adds it to the same accumulated discount: ```python # For non-stackable promos, pick the best one best_nonstackable = None best_discount = 0.0 best_desc = "" for promo in nonstackable_promos: ptype = promo.get("type", "") if ptype == "threshold": discount, desc = apply_threshold(promo, subtotal) elif ptype == "discount": discount, desc = apply_discount(promo, subtotal) else: continue if discount > best_discount: best_discount = discount best_nonstackable = promo best_desc = desc if best_nonstackable and best_discount > 0: applied_promos.append({ "promo": best_nonstackable.get("title"), "rule": best_desc, "discount": best_discount, }) total_discount += best_discount ``` ### Technical Analysis A promotion marked `stackable: false` is intended to be mutually exclusive. The project documentation states that the highest-value single promotion should be selected for non-stackable promotions. The im ...[truncated 1458 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/calculate_promotion.py:91
Finding

Unvalidated numeric inputs can manipulate totals and produce zero-price orders

Content
View full analysis
tuple[float, str]: """Apply membership tier discount.""" if not member_tier or not membership_config: return 0.0, "" levels = membership_config.get("levels", []) for level in levels: if level.get("name", "").lower() == member_tier.lower(): discount_rate = level.get("discount_rate", 1.0) if discount_rate < 1.0: discount = round(subtotal * (1 - discount_rate), 2) return discount, f"{level['name']}专属{round(discount_rate*10, 1)}折" return 0.0, "" ``` Item prices and quantities are converted but not validated: ```python for item in items: price = float(item.get("price", 0)) qty = int(item.get("qty", 1)) line_total = round(price * qty, 2) subtotal += line_total line_items.append({ "sku": item.get("sku", ""), "name": item.get("name", item.get("sku", "")), "unit_price": price, "qty": qty, "line_total": line_total, }) ``` Excessive or invalid discounts are not rejected. The final value is merely clamped to zero: ```python final_total = max(0.0, round(subtotal - total_discount, 2)) ``` ### Technical Analysis The command-line `--items` value is parsed as JSON and its numeric fields flow directly into monetary calculations. The code does not enforce: - A finite, non-negative item price. - A positive integer quantity. - A finite membership discount rate. - A membership discount rate between zero and one. - A disco ...[truncated 2570 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims broad promotion-calculation capabilities that are not actually implemented or enforced, including bundles, gifts, points redemption, coupon validation, and proper applicability checks. This can produce incorrect pricing or unauthorized discounts, which in a retail workflow can directly cause financial loss, policy violations, or misleading customer communications.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill instructs use of an external script and depends on knowledge-base reads, but it does not declare any explicit tool scope or permissions. In agent environments, missing scope declarations can lead to over-broad default access or unclear enforcement, increasing the risk of unintended file access beyond the promotion data needed.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad enough that the skill may activate for loosely related shopping or pricing questions outside its intended context. Over-broad invocation can route users into a calculator that gives authoritative-seeming answers from incomplete data, increasing the chance of misinformation or unintended use of pricing logic.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The answer formats and edge-case responses are written as fixed Chinese responses, and the skill description does not state that language should match user preference or allow opt-in selection. This can violate language/locale policy if the skill effectively constrains output language without user choice.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code defines SKU/category applicability checks but never uses them when calculating promotions, so any active threshold or discount promo can be applied to the entire cart regardless of scope. In a retail pricing skill, this can produce systematically incorrect totals, unauthorized discounts, and policy bypasses if users craft carts containing ineligible items.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code explicitly labels the summary as human-readable Chinese and emits Chinese-language strings in the formatted output, while also embedding Chinese promotion labels elsewhere. This imposes a specific language/locale choice on users without offering a language option or documenting that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.