Back to skill

Security audit

ecom-price-monitor跨境电商价格监控神器 - 竞品一动,秒级预警

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a price-monitoring demo rather than malware, but it is unfinished and needs safer export, dependency, and credential practices before real use.

Install only in a controlled environment, pin and audit dependencies, keep API keys/cookies/passwords out of tracked files, and restrict exports to a dedicated directory. Treat the current implementation as a demo using mock data unless the live scraping and notification code is completed and reviewed.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
ecom-price-monitor/src/main.py:463
Finding

Unrestricted Export Path Allows Arbitrary JSON File Overwrite

Content
View full analysis

Vulnerability Details

File Location: ecom-price-monitor/src/main.py, lines 463-481
Vulnerability Type: Unrestricted file path and arbitrary file overwrite
Risk Level: Medium

Vulnerable Code

python
def export_data(self, format: str = "json", filename: str = None) -> str:
    """Export data"""
    if filename is None:
        timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
        filename = f"price_monitor_{timestamp}"
    
    data = {
        "products": {pid: p.to_dict() for pid, p in self.products.items()},
        "alerts": [asdict(a) for a in self.alerts],
        "export_time": datetime.now().isoformat()
    }
    
    if format == "json":
        filepath = f"{filename}.json"
        with open(filepath, 'w', encoding='utf-8') as f:
            json.dump(data, f, ensure_ascii=False, indent=2)
        return filepath
    
    return ""

Technical Analysis

The filename parameter is incorporated directly into the destination path without validating whether it is an absolute path, contains parent-directory traversal components, or resolves outside an approved export directory. The file is then opened in write mode, which truncates an existing file before writing the exported JSON.

An attacker or untrusted agent workflow that can influence the filename argument can therefore select any path writable by the process, subject only to the automatic .json suffix. Path normalization and containment checks are absent. Symbolic links can also expand the affected scope if an attacker can prepare a link at the selected destination.

Attack Path

  1. An attacker gains control over, or influences, the filename passed to PriceMonitor.export_data().
  2. The attacker supplies an absolute or traversal-based path, such as ../../target.
  3. The method constructs ../../target.json.
  4. open(filepath, 'w') follows the supplied path and truncates the destination ...[truncated 862 chars]
Remediation
View remediation

Remediation Suggestions

  • Create a dedicated export directory with appropriately restrictive permissions.
  • Accept only a basename rather than an arbitrary path.
  • Reject absolute paths, parent-directory components, path separators, and empty filenames.
  • Resolve both the export directory and destination with pathlib.Path.resolve(), then verify that the destination remains under the approved directory.
  • Use exclusive creation mode when overwriting is not explicitly intended.
  • If overwriting is supported, require explicit caller confirmation and avoid following attacker-controlled symbolic links.
  • Add tests for absolute paths, ../ traversal, nested traversal, symbolic links, and existing-file overwrite attempts.

Example hardening approach:

python
from pathlib import Path

export_root = Path("exports").resolve()
export_root.mkdir(mode=0o700, parents=True, exist_ok=True)

safe_name = Path(filename).name
if safe_name != filename or not safe_name:
    raise ValueError("Invalid export filename")

destination = (export_root / f"{safe_name}.json").resolve()
if export_root not in destination.parents:
    raise ValueError("Export path escapes the approved directory")

with destination.open("x", encoding="utf-8") as f:
    json.dump(data, f, ensure_ascii=False, indent=2)

T08 · Insecure Dependencies

Note
Location
ecom-price-monitor/requirements.txt:1
Finding

Unpinned and Unnecessarily Broad Third-Party Dependencies

Content
View full analysis

Vulnerability Details

File Location: ecom-price-monitor/requirements.txt, lines 1-6
Additional Locations: SKILL.md:44, ecom-price-monitor/SKILL.md:44, ecom-price-monitor/skill.json:18, and ecom-price-monitor/docs/README.md:42
Vulnerability Type: Non-reproducible dependency installation and excessive supply-chain exposure
Risk Level: Low

Vulnerable Code

text
requests>=2.31.0
beautifulsoup4>=4.12.0
schedule>=1.2.0
pyyaml>=6.0
pandas>=2.0.0
python-dotenv>=1.0.0

The installation instructions execute these mutable requirements directly:

bash
pip install -r requirements.txt

The documentation additionally recommends unconstrained direct installation:

bash
pip install requests beautifulsoup4 schedule pandas pyyaml

Technical Analysis

All declared dependencies use open-ended lower bounds, allowing the package resolver to install any future release. No lock file, exact version constraints, or integrity hashes are provided. Consequently, two installations at different times may execute materially different third-party code.

The implementation imports requests, schedule, and yaml, but the audited code does not use beautifulsoup4, pandas, or python-dotenv. Installing unused packages unnecessarily increases the number of third-party components that can introduce vulnerabilities, malicious updates, or transitive dependencies.

No malicious or typosquatted package was identified in the supplied dependency list. The issue is the mutable, excessive, and non-reproducible dependency policy rather than a confirmed malicious dependency.

Attack Path

  1. A user follows the documented installation command.
  2. pip resolves the open-ended requirements against the configured package index.
  3. A newer compromised, vulnerable, or incompatible direct or transitive dependency is selected.
  4. Package build or installation logic executes with the pri ...[truncated 896 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove dependencies not used by the implementation, currently including beautifulsoup4, pandas, and python-dotenv.
  • Pin reviewed exact versions rather than using unrestricted lower bounds.
  • Generate and commit a lock file appropriate for the supported Python environment.
  • Require cryptographic hashes during deployment, for example through a hash-locked requirements file and pip install --require-hashes.
  • Pin transitive dependencies through a reproducible dependency-management workflow.
  • Ensure all installation instructions use the same locked dependency source rather than separate unconstrained package lists.
  • Configure the expected package index explicitly in deployment environments and avoid untrusted extra indexes.
  • Add automated dependency vulnerability and license scanning, while reviewing proposed upgrades before updating the lock file.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (22)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language instructions and usage guidance are presented exclusively in Chinese, while the file does not offer users a language option or explain that the skill is intentionally limited to a Chinese-speaking audience. Under SQP-3, forcing a specific language without user opt-in is a policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill advertises automated scraping, outbound email/Feishu notifications, and Excel export, but it does not warn users about impacts on third-party services, possible terms-of-service violations, or handling of potentially sensitive product and account data. In an agent setting, missing disclosure can cause users to trigger network activity and data export they did not fully anticipate, increasing legal, operational, and privacy risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This YAML file uses exclusively Chinese natural-language labels, comments, and bot naming throughout the configuration, with no indication that the skill supports other languages or that the Chinese-only behavior is optional. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README instructs users to obtain and use API keys, login credentials, and especially 1688 cookies, but provides no guidance on secure storage, redaction, least-privilege use, or the risks of exposing session cookies. In the context of a price-monitoring skill that may be deployed on shared systems or copied into agent environments, this omission increases the chance of credential leakage, account compromise, or accidental logging of sensitive secrets.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code includes natural-language descriptions and runtime messages primarily in Chinese, and the skill does not provide any user opt-in or locale selection for those outputs. That can violate language/locale policy where skills must not force a specific language by default.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The docstring says the function '对比多个平台的价格,找出利润率超过阈值的套利机会' ('compare prices across multiple platforms and find arbitrage opportunities above a threshold'), which describes real comparative analysis. In reality, the function ignores its input and simply filters a static list of mock opportunities, so the documentation materially misrepresents what the code does.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example section prints '获取最新价格' ('get latest prices'), which implies real current price retrieval, but update_price ultimately calls scrape_amazon/scrape_taobao, both of which are explicitly backed by hardcoded mock_products rather than live platform data. This is an active contradiction between the documented/demo behavior and the implemented behavior, not merely an omitted detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill explicitly describes scheduled automated scraping of product URLs and outbound email/Feishu notifications, but it provides no warning about privacy, consent, rate limits, or third-party platform terms of service. This omission can lead operators to deploy the tool in ways that collect data or send alerts without considering legal, contractual, or privacy constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language instructions and descriptions are presented in Chinese throughout the file, while no opt-in, alternative language, or region-specific justification is provided. This can violate language/locale policy when a skill effectively forces a specific language without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language instructions throughout the file are presented only in Chinese, which effectively forces a specific language for users without any opt-in or stated regional limitation. Under the policy, language constraints should either offer choice or be clearly documented and justified as region-specific.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency specification uses a lower-bound range (requests>=2.31.0) rather than an exact pin, which makes builds non-reproducible and can allow unexpected or vulnerable upstream releases to be installed later. In a supply-chain context this increases exposure to dependency compromise or regressions, even though the file itself does not prove an actively exploitable flaw.

Content

Scanner excerpt · ecom-price-monitor/requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0
beautifulsoup4>=4.12.0
schedule>=1.2.0
pyyaml>=6.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The manifest does not pin requests, and that package has multiple published advisories across versions. Because the actual installed version is unconstrained above 2.31.0, it is not possible to verify from this file alone whether deployments consistently avoid affected releases, which creates avoidable supply-chain uncertainty for a network-facing library.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

beautifulsoup4>=4.12.0 is unpinned, so future installations may resolve to different versions over time. This weakens reproducibility and can introduce supply-chain risk or unreviewed behavior changes if a later release contains a vulnerability or malicious code.

Content

Scanner excerpt · ecom-price-monitor/requirements.txt (reported line 2)May include surrounding context.

text
requests>=2.31.0
beautifulsoup4>=4.12.0
schedule>=1.2.0
pyyaml>=6.0
pandas>=2.0.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The schedule package is specified with >=1.2.0, which permits any later version and therefore non-deterministic installs. That creates a software supply-chain weakness because future releases could introduce exploitable defects or incompatible behavior without any manifest change.

Content

Scanner excerpt · ecom-price-monitor/requirements.txt (reported line 3)May include surrounding context.

text
requests>=2.31.0
beautifulsoup4>=4.12.0
schedule>=1.2.0
pyyaml>=6.0
pandas>=2.0.0
python-dotenv>=1.0.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

pyyaml>=6.0 is unpinned, and PyYAML has a history of security issues around unsafe parsing/deserialization. While this line alone does not show vulnerable usage, leaving the version open-ended makes it harder to ensure that only reviewed, safe releases are deployed.

Content

Scanner excerpt · ecom-price-monitor/requirements.txt (reported line 4)May include surrounding context.

text
requests>=2.31.0
beautifulsoup4>=4.12.0
schedule>=1.2.0
pyyaml>=6.0
pandas>=2.0.0
python-dotenv>=1.0.0

Unverifiable Dependency: pyyaml has 8 known advisory(ies) (CVE-2019-20477 (Deserialization of Untrusted Data in PyYAML); CVE-2020-1747 (Improper Input Validation in PyYAML); CVE-2020-14343 (Improper Input Validation in PyYAML) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
93% confidence
Finding

pyyaml has a significant history of security advisories, especially involving unsafe deserialization behavior, and the requirements file does not pin a specific safe release. In an automation or data-processing skill, this makes the dependency more sensitive because YAML content may come from external sources elsewhere in the project.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

pandas>=2.0.0 is not pinned to an exact release, so installations may vary across environments and over time. This creates dependency drift and a supply-chain risk window if a later release introduces a security issue or malicious change.

Content

Scanner excerpt · ecom-price-monitor/requirements.txt (reported line 5)May include surrounding context.

text
beautifulsoup4>=4.12.0
schedule>=1.2.0
pyyaml>=6.0
pandas>=2.0.0
python-dotenv>=1.0.0

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

python-dotenv>=1.0.0 allows any later version, which reduces build determinism and increases supply-chain uncertainty. If a later release is vulnerable or compromised, deployments could silently pick it up.

Content

Scanner excerpt · ecom-price-monitor/requirements.txt (reported line 6)May include surrounding context.

text
schedule>=1.2.0
pyyaml>=6.0
pandas>=2.0.0
python-dotenv>=1.0.0

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
72% confidence
Finding

python-dotenv is not pinned, and there are published advisories affecting some versions, so the exact security posture of deployed environments cannot be verified from this manifest. The danger is somewhat contextual and depends on whether the code uses vulnerable functionality such as file-modifying helpers, but the lack of version pinning still leaves avoidable uncertainty.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description uses Chinese-language text exclusively, which can impose a language/locale constraint on users without any opt-in or alternative language support. The file does not document that the skill is region-specific or otherwise justify the language restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

SQP-3 applies to all file types and covers natural-language policy violations such as forcing a specific language without opt-in. This test script presents its description and console output exclusively in Chinese, with no indication that the skill is region-specific or that users may select another language.

Content

No source excerpt is available for this finding.