Back to skill

Security audit

陈列货盘分析

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its retail analytics purpose, but it loads unreviewed local code from a hardcoded developer path before running.

Review this before installing. It appears intended for retail BI assortment analysis, but it should not load api_client from a hardcoded personal workspace path. Install only if that dependency is replaced with a packaged, pinned, reviewable client or the runtime environment strictly controls that path.

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

T08 · Insecure Dependencies

Error
Location
analyze.py:18
Finding

Untrusted External Module Loading Through a Hardcoded Search Path

Content
View full analysis

Vulnerability Details

File Location: analyze.py, lines 18–20
Vulnerability Type: Insecure dependency loading and Python module path manipulation
Risk Level: High

Vulnerable Code

python
import sys
sys.path.insert(0, '/Users/yangguangwei/.openclaw/workspace-front-door')
from api_client import get_copilot_data

Technical Analysis

The skill prepends a user-specific directory outside the audited project to Python's module search path and then imports api_client from that location. The imported module is not included in the project, so its implementation, integrity, API destination, authentication behavior, TLS policy, and handling of store data cannot be verified.

Because the external directory is inserted at index zero, its modules take precedence over modules available through ordinary Python search paths. Any party able to create or modify api_client.py in that directory can execute arbitrary Python code when analyze.py is imported or run. Python executes a module's top-level statements during import, so exploitation does not require the analysis function to complete or even invoke get_copilot_data.

This also creates a deployment-dependent supply-chain boundary: the reviewed skill's effective behavior can change without any modification to its audited files.

Attack Path

  1. An attacker obtains write access to /Users/yangguangwei/.openclaw/workspace-front-door, or causes deployment tooling to populate that path with an untrusted file.
  2. The attacker creates or replaces api_client.py with malicious Python code.
  3. A user or agent imports or executes analyze.py.
  4. The call to sys.path.insert(0, ...) gives the attacker-controlled directory first priority during module resolution.
  5. Python resolves from api_client import get_copilot_data to the malicious module.
  6. The module's top-level payload executes immediately with the same operating-system identity and permissions as the agent process.
  7. The malici ...[truncated 879 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the hardcoded sys.path modification.
  2. Include the reviewed API client inside the skill package and import it explicitly with a package-relative import, for example:
python
from .api_client import get_copilot_data
  1. If the client must be an external dependency, distribute it through a trusted package repository, pin an exact version and integrity hash, and use a locked dependency manifest.
  2. Install dependencies into a dedicated, least-privileged virtual environment rather than loading code from a developer workspace.
  3. Validate at deployment time that imported modules resolve to approved paths and expected file hashes.
  4. Restrict write access to installed code and dependency directories.
  5. Configure an explicit allowlisted HTTPS API origin in reviewed code. Enforce TLS certificate verification, narrowly scoped authentication, request timeouts, and response-size limits.
  6. Validate the API response schema before indexing or using funnel records.
  7. Add automated tests that fail if api_client resolves outside the approved package or environment.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code prepends a user-specific local filesystem path to sys.path before importing api_client, allowing import resolution to be influenced by code outside the skill package. This can load unintended or tampered modules and creates a code-execution trust boundary violation, especially dangerous in agent environments where local workspace contents may be mutable or attacker-controlled.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger conditions are broad enough that the skill may be invoked for generic store-performance questions without clear scoping or exclusion rules. In an agentic environment, unintended invocation can expose store analytics unnecessarily, produce irrelevant analysis, or override a more appropriate skill, increasing the chance of data overreach and incorrect automated actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring, function docstring, and all user-facing print messages are written only in Chinese, which imposes a specific language on users. The file does not indicate that the skill is region-specific, nor does it offer any opt-in or alternative language behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module documentation states '客户对意向商品的试用深度变化(深度试用次数/有深度交互SKU)', which defines the denominator as deeply interacted SKUs. However, the implementation at L105-L106 divides deep trial count by '引起意向的SKU' (deep-trial SKU + deal SKU), a different population. This is an active contradiction between documented metric definition and executed logic.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The documentation says 'customerFunnel: 有深度交互的客户数(意向+成交)', implying a simple addition of intent and deal customers represents the count of customers with deep interaction. The code follows this at L78-L79 by summing the two groups, but semantically this contradicts the stated notion of a customer count because deal customers may overlap with intent customers, making the metric not truly '客户数'. The documentation presents a unique-customer metric while the implementation uses a potentially duplicated aggregate.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document declares this skill as retail-store-assortment-analysis, but the usage example imports from ~/.openclaw/skills/store-assortment-analysis and analyze, which points to a differently named skill/module. This is an active documentation-to-implementation reference mismatch that can cause users or agents to invoke the wrong skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This code file performs an HTTP/API call using storeId, fromDate, and toDate, which are user/system data parameters. Although the script logs the endpoint and parameters, it does not clearly disclose that this information is being sent over the network or provide any explicit warning/comment about the transmission.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.