Back to skill

Security audit

Ai Ecommerce Description Generator V2

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local Chinese e-commerce product-description generator with some quality and input-validation issues, but no evidence of hidden access, exfiltration, persistence, or destructive behavior.

Install only if Chinese-language e-commerce copy generation matches your use case. Avoid passing untrusted product names directly to a terminal, and keep generated counts small until the skill enforces input limits.

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
main.py:91
Finding

Unbounded Description Count Allows Local Resource Exhaustion

Content
View full analysis
list: """批量生成商品描述""" descriptions = [] for i in range(count): description = self.generate_description(product, platform, style, audience) descriptions.append({ "description": description, "platform": platform, "style": style, "estimated_conversion": random.randint(200, 500), "estimated_click_rate": random.randint(150, 350), "recommendation_score": random.randint(80, 100) }) return sorted(descriptions, key=lambda x: x["recommendation_score"], reverse=True) ``` The value is read directly from a command-line argument without validation: ```python elif sys.argv[i] == "--count": count = int(sys.argv[i + 1]) i += 2 ``` ### Technical Analysis The attacker-controlled `--count` value is passed directly to `range(count)`. Every iteration generates a description and appends a dictionary to an in-memory list. After generation, the entire list is sorted, adding further CPU and memory overhead. No upper limit, execution budget, or output-size restriction is enforced. A sufficiently large positive integer can therefore make the process consume excessive memory and CPU time. The boundary test in `test_boundary.py` expects generation to be limited to ten results, but the implementation does not enforce that intended restriction. Negative values do not trigger this issue because `range()` produces no iterations, but very large positive values are exploitable. ### Attack Path 1. An attacker or untrusted automation invokes the CLI wit ...[truncated 1014 chars]
Remediation
View remediation
MAX_COUNT: raise ValueError(f"Count must be between 1 and {MAX_COUNT}") ``` 2. Use `argparse` to validate command-line arguments: ```python import argparse parser = argparse.ArgumentParser() parser.add_argument("--product", required=True) parser.add_argument("--count", type=int, choices=range(1, 11), default=3) args = parser.parse_args() ``` 3. Apply the limit inside `generate_descriptions()`, not only in the CLI, because the class may also be called programmatically. 4. Add automated tests for zero, negative, malformed, boundary, and excessive count values. 5. If larger workloads are later required, use streaming or pagination instead of accumulating and sorting all results in memory. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
main.py:117
Finding

Unsanitized Product Names Permit Terminal Control-Sequence Injection

Content
View full analysis
Remediation
View remediation
str: return CONTROL_CHARS.sub( lambda match: f"\\x{ord(match.group()):02x}", value ) ``` 2. Sanitize all user-controlled display fields, including `product`, `platform`, `style`, and `audience`, at the output boundary. 3. Provide a structured JSON output mode for automation and logs. Use a JSON encoder rather than manual string concatenation. 4. Consider rejecting newline and carriage-return characters when product names are expected to be single-line values. 5. Add tests containing escape bytes, carriage returns, newlines, tabs, and bidirectional text-control characters to verify that generated output cannot alter terminal presentation. ]]>
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 (4)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s title, docstrings, CLI usage text, and generated descriptions are all hard-coded in Chinese, and the generation logic provides no option for user language or locale selection. This is a natural-language policy concern because it imposes a specific language by default rather than allowing opt-in or documenting that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The description prominently presents the skill in Chinese and the usage examples and parameter values throughout the file are Chinese-specific, with no indication that users can choose another language or locale. This can conflict with language/locale policy expectations when a skill is presented to a broader audience without opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comment at L058 says the code adjusts output based on the audience, and L066 assigns an audience-specific benefit1 value. However, the formatted description at L069-L077 ignores that variable and instead always uses random.choice(self.benefits1), so the claimed audience-based behavior does not occur.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring is entirely in Chinese and presents the skill as operating in that language without any indication that users can choose another language or locale. Under the policy rule, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.