Back to skill

Security audit

电商产品描述批量生成器

Security checks for vulnerabilities and agentic risk

Overview

This is a local ecommerce listing generator with no hidden network access or persistence, but generated claims and CSV exports need user review before use.

Install only if you are comfortable with a local Python CLI that reads your product CSVs and writes listing drafts. Treat all generated copy as a draft: verify certifications, safety claims, materials, guarantees, shipping, and return-policy statements before publishing, and avoid opening CSV exports from untrusted product data in spreadsheet software unless formula cells are neutralized.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
generator.py:493
Finding
Spreadsheet Formula Injection in CSV Exports<![CDATA[ ## Vulnerability Details **File Location**: `generator.py:493-500`, with attacker-controlled input originating at `generator.py:517-529` **Vulnerability Type**: CSV formula injection **Risk Level**: Medium ### Vulnerable Code ```python if output_format == "csv": rows = [["产品名称", "平台", "标题", "详情描述"]] for name, results in all_results: for pid, data in results.items(): rows.append([name, data["label"], data["title"], data["description"]]) output = io.StringIO() writer = csv.writer(output) writer.writerows(rows) ``` The exported product name originates from CSV input without formula neutralization: ```python def parse_csv_input(csv_text: str) -> List[Dict]: """解析 CSV 输入,返回产品字典列表""" reader = csv.DictReader(io.StringIO(csv_text.strip())) products = [] for row in reader: products.append({ "product_name": row.get("product_name") or row.get("产品名称") or "", "category": row.get("category") or row.get("类目") or "", "keywords": row.get("keywords") or row.get("关键词") or "", "brand": row.get("brand") or row.get("品牌") or "", "price": row.get("price") or row.get("价格") or "", }) return [p for p in products if p["product_name"]] ``` ### Technical Analysis The application accepts arbitrary product data from an imported CSV and writes that data back into generated CSV output. The standard `csv.writer` correctly quotes CSV syntax but does not prevent spreadsheet applications from interpreting a cell as a formula. A product name beginning with `=`, `+`, `-`, or `@` can therefore remain executable spreadsheet content. Leading tabs, carriage returns, or whitespace may also be used to bypass simplistic prefix checks in some spreadsheet applications. For example, a malicious input product name could contain a formula that initiates an external request when the generated file is opened. The generated description and title fields also incorpo ...[truncated 1510 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Neutralize every untrusted CSV cell before passing it to `csv.writer`. 2. Treat cells beginning with `=`, `+`, `-`, or `@` as dangerous, including values where these characters follow whitespace, tabs, or carriage returns. 3. Prefix dangerous cells with a single quote or use another spreadsheet-safe export convention appropriate to supported spreadsheet applications. 4. Apply protection to product names, titles, descriptions, bullet points, brands, categories, keywords, and all future user-controlled columns. 5. Keep `csv.writer` for structural escaping; formula neutralization is an additional and separate control. 6. Add regression tests for all recognized formula prefixes and whitespace-based bypasses. Example hardening function: ```python def neutralize_csv_cell(value) -> str: text = str(value) normalized = text.lstrip(" \t\r\n") if normalized.startswith(("=", "+", "-", "@")): return "'" + text return text ``` Apply it to each exported value: ```python writer.writerows( [[neutralize_csv_cell(cell) for cell in row] for row in rows] ) ``` ]]>

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding
Non-Reproducible Installation of a Loosely Pinned Development Dependency<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1-3`; installation is documented at `README.md:28` **Vulnerability Type**: Mutable third-party dependency resolution **Risk Level**: Low ### Vulnerable Code ```text # No external dependencies — pure Python 3.8+ # Optional: for development/testing pytest>=7.0.0 ``` The README recommends installing this dependency set: ```bash pip install -r requirements.txt ``` ### Technical Analysis The version constraint `pytest>=7.0.0` permits pip to install any current or future pytest release satisfying the lower bound. It does not produce a reproducible dependency graph and does not verify package hashes. The dependency is only used for testing and is not silently installed by `setup.sh`, which reduces exposure. Nevertheless, users following the documented installation procedure retrieve mutable third-party packages and transitive dependencies from their configured package index. This is a supply-chain hardening weakness rather than evidence that the currently named package is malicious. ### Attack Path 1. A user follows the README installation instructions. 2. Pip resolves the broad `pytest>=7.0.0` constraint and its transitive dependencies at installation time. 3. A future compromised, malicious, or incompatible release satisfying the constraint is selected from the configured package index. 4. Package installation code, plugins, or imported test-time code executes in the context of the installing user. 5. The malicious component obtains the permissions available to that user and environment. This path depends on compromise of the package source, package-index configuration, or a future dependency release; no such compromise was found in the audited project. ### Impact Assessment If the dependency supply chain were compromised, code could run with the privileges of the user performing installation or running the tests. Depending on the environment, this could expose: - Source code and fi ...[truncated 318 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Move pytest into a separate development dependency file. 2. Pin pytest and all transitive dependencies to reviewed versions. 3. Generate and verify package hashes with a lock-file or requirements compilation tool. 4. Install with hash enforcement where practical: ```bash pip install --require-hashes -r requirements-dev.txt ``` 5. Use a trusted package index and prevent unexpected fallback to untrusted indexes. 6. Enable automated dependency review and vulnerability scanning. 7. Clarify in the README that no third-party packages are required for normal runtime use. ]]>

other

Warning
Location
generator.py:93
Finding
Random Generation of Unverified Regulatory and Safety Claims<![CDATA[ ## Vulnerability Details **File Location**: `generator.py:29-34`, `generator.py:93-97`, `generator.py:225-226`, and `generator.py:265` **Vulnerability Type**: Fabricated compliance and product-safety claims **Risk Level**: Medium ### Vulnerable Code The quality pool includes an approval claim: ```python QUALITY_WORDS_EN = [ "Stainless Steel", "Eco-Friendly", "Organic", "Handcrafted", "Fashionable", "Waterproof", "Rechargeable", "FDA-Approved", "BPA-Free", " hypoallergenic", "Scratch-Resistant" ] ``` The Amazon template states that products are certified: ```python AMAZON_BULLET_TEMPLATES = [ "**PREMIUM QUALITY**: {quality} {material} ensures durability and long-lasting performance, withstand daily wear and tear.", "**EASY TO USE**: {feature} design allows effortless operation — perfect for {use_case}. No complicated setup required.", "**MULTI-PURPOSE**: Great for {use_case}, {use_case_2} and many other scenarios. Versatile enough for everyday needs.", "**SAFE & RELIABLE**: {quality} materials, {safety} certified. 100% satisfaction guarantee or your money back.", "**GREAT VALUE**: {benefit}. Buy with confidence — this is the best {product_name} deal you'll find online.", ] ``` Certifications are selected randomly: ```python YEAR = 2026 DURATION_CHOICES = ["a week", "two weeks", "a month", "a few months"] SAFETY_CERTS = ["CE", "FCC", "RoHS", "UL"] ``` ```python safety = pick_random(SAFETY_CERTS) ``` ### Technical Analysis The generator assigns regulatory, safety, material, and approval statements through random selection. It does not request evidence that a product is FDA-approved, CE-marked, FCC-authorized, RoHS-compliant, UL-certified, BPA-free, waterproof, organic, or hypoallergenic. The template then converts the randomly selected value into an affirmative product claim. No validation, product-category compatibility check, evidence field, or warning distinguishes generated promotional language from verified ...[truncated 1644 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove regulatory approvals, certifications, and objective safety properties from randomized vocabulary pools. 2. Add explicit structured inputs for every factual claim, such as: - Verified certifications - Materials - Safety properties - Warranty terms - Shipping and return policies 3. Render a compliance claim only when the user explicitly supplies it and confirms that supporting evidence exists. 4. Maintain an allowlist mapping claims to applicable product categories and jurisdictions. 5. Separate creative marketing phrases from verifiable product facts. 6. Label generated content as a draft requiring factual and legal review before publication. 7. Add tests confirming that no certification or regulatory claim appears unless it is present in verified input. 8. Consider storing provenance for each factual claim so reviewers can identify whether it came from user-verified data or a generic template. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The README states that Amazon uses English, Taobao/Pinduoduo use Chinese, and other platforms use specific language styles as a built-in behavior. This is a natural-language locale policy constraint presented as mandatory behavior, with no indication that users can choose or override the output language.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The supported-platform table specifies that Amazon, TikTok, and Shopify outputs are in English while Taobao and Pinduoduo outputs are in Chinese, and earlier examples reinforce these fixed language expectations. This creates a locale/language policy concern because the skill appears to force language by platform rather than offering a user-selectable language option or documenting an explicit opt-in.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The platform table mandates Chinese for 淘宝/拼多多 and English for 亚马逊/TikTok Shop/Shopify, which is a natural-language locale constraint stated as fixed behavior. The document does not mention allowing the user to choose or override the language, so it appears to force a specific language/locale without opt-in.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The user-facing docstring, argument descriptions, and help output are written entirely in Chinese, which imposes a specific language on all users of the skill. The policy allows locale constraints only when justified or when users are given a choice, neither of which is present here.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The file-level description and generated output structure are written as a Chinese-only product description generator, including Chinese labels and templates for major parts of the output. Because the skill supports multiple international platforms but does not document any user opt-in or language-selection mechanism, it imposes a specific language/locale by default.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This shell script contains user-facing natural-language strings entirely in Chinese, including installation messages and usage examples. Because the file provides no opt-in, fallback, or justification for enforcing a specific language, it conflicts with the policy against forcing a language or locale without user choice.

Missing User Warnings

Low
Confidence
88% confidence
Finding
This markdown file documents batch generation from a CSV and writing results to `result.md`, which affects user data on disk. The description includes no warning or disclosure about overwriting/creating files, reviewing generated outputs, or handling potentially sensitive catalog data in batch mode.

Intent-Code Divergence

Low
Confidence
98% confidence
Finding
Line L1 states 'No external dependencies — pure Python 3.8+', but L3 includes `pytest>=7.0.0`, which is an external package dependency. Although L2 softens this by labeling it optional for development/testing, the top-level comment still contradicts the actual contents of the file.

Unpinned Dependencies

Low
Category
Supply Chain
Content
# No external dependencies — pure Python 3.8+
# Optional: for development/testing
pytest>=7.0.0
Confidence
89% confidence
Finding
Using an unpinned dependency (pytest>=7.0.0) allows builds to resolve to different versions over time, which weakens reproducibility and can unintentionally introduce vulnerable or incompatible releases into the environment. In this case the dependency is for development/testing, so the risk is lower than a runtime production dependency, but it still expands supply-chain exposure.

Unverifiable Dependency: pytest has 2 known advisory(ies) (CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
84% confidence
Finding
The manifest references pytest without pinning to a specific version, and pytest has known advisories in some releases, so consumers may unknowingly install an affected version. Because pytest appears to be a development/testing dependency rather than part of the deployed skill runtime, the practical impact is limited, but it still represents avoidable supply-chain risk.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
This code file contains natural-language strings and test expectations that consistently assume Chinese input/output, including Chinese product names, labels, CSV headers, and comments. Under the policy rule, forcing a specific language without user choice can be a locale-policy issue unless clearly documented as region-specific or optional.

Static analysis

No suspicious patterns detected.