Back to skill

Security audit

客户清单分析

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but it relies on an unreviewed local API module and exposes detailed customer records without clear authorization or privacy guardrails.

Install only in an environment where the external api_client path is trusted and controlled, and use it only for authorized customer-data analysis. Review or package the API client with the skill, restrict who can request detailed customer lists or exports, and prefer aggregated output unless raw records are explicitly needed.

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:11
Finding

Untrusted External Module Loaded Through Hard-Coded Import Path

Content
View full analysis

Vulnerability Details

File Location: analyze.py:11-12
Vulnerability Type: Unsafe external dependency resolution and import-path manipulation
Risk Level: High

Complete Code Snippet

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

The vulnerable import is also triggered when the package is imported through __init__.py:7-15:

python
from .analyze import (
    analyze,
    format_report,
    fetch_customer_list,
    analyze_customer_types,
    analyze_badge_match,
    analyze_trial_summary,
    CUSTOMER_TYPE_MAP
)

Technical Analysis

The Skill prepends a hard-coded directory outside the audited project to sys.path, giving that directory priority during Python module resolution. It then imports api_client without a package-qualified or relative module name.

Python executes module-level code during import. Consequently, the contents of the externally resolved api_client module execute as soon as analyze.py is loaded. Because that module is neither included in the audited project nor pinned or integrity-verified, its implementation, version, network destinations, credential handling, and future modifications cannot be assessed.

The package initializer imports analyze.py immediately, so exploitation does not require the user to invoke an analysis function. Merely importing the package can execute a substituted module. This is an unsafe supply-chain boundary and can also facilitate local module spoofing where an attacker can write to the hard-coded directory.

The implementation path also conflicts with the portable dependency path documented in SKILL.md, increasing the likelihood of environment-specific, unmanaged dependency resolution.

Attack Path

  1. An attacker obtains write access to /Users/yangguangwei/.openclaw/workspace-front-door, or compromises the process or deployment mechanism that supplies api_client.py.
  2. The attacker cr ...[truncated 1439 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the sys.path.insert call and avoid resolving dependencies from hard-coded, user-specific external directories.

  2. Package the reviewed API client within the project and import it through an explicit relative path, for example:

    python
    from .api_client import get_shop_data
    
  3. If the client must remain a third-party dependency, install it through standard Python dependency management. Pin an exact reviewed version and verify package hashes in a lock file or requirements file.

  4. Restrict package sources to an approved private registry or trusted index to reduce dependency-confusion risk.

  5. Use dependency injection where practical, accepting an initialized and approved API client from the host application rather than importing an unmanaged implementation at module load time.

  6. Avoid executing external dependency code merely by importing the package. Keep package initialization minimal and defer client initialization until the relevant operation is explicitly invoked.

  7. Configure and validate the API base URL through trusted configuration. Apply an allowlist for permitted schemes, hosts, and endpoints.

  8. Ensure the external dependency directory and deployment artifacts are not writable by untrusted users or lower-privileged processes.

  9. Review the actual api_client implementation separately, including authentication, TLS verification, timeout behavior, redirect handling, logging, and treatment of sensitive customer data.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (5)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code prepends a developer-local filesystem path to sys.path and imports api_client from there, which bypasses normal dependency controls and makes execution depend on unrelated local code. This creates a code injection/supply-chain risk: if that workspace contains modified or malicious code, the skill will execute it under the skill's privileges.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill is designed to retrieve and analyze customer-list data containing customer IDs, visit records, behavior signals, guide-assignment status, and purchase-related fields, but it provides no user-facing warning, consent boundary, or privacy notice. This increases the risk of exposing or over-processing personal and commercially sensitive data without sufficient transparency or authorization checks, especially when supporting broad queries and export of customer details.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Natural-language strings, docstrings, and console output throughout the file force a specific language/locale experience. Under the policy, a fixed language is a violation unless the skill offers user opt-in or clearly documents a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code sends store identifiers, date ranges, and customer-filter parameters to the Shop API via a POST request. Although the function docstring explains parameters, it does not disclose to the user that customer-related data will be queried and transmitted, and the runtime output only says it is fetching data without any privacy warning.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises analysis and summary capabilities, but the returned result includes the full raw customer records under customer_list. That expands the data exposure surface, risks leaking personally identifiable or commercially sensitive customer data to downstream callers, logs, or UIs, and violates data minimization for an analytics-oriented skill.

Content

No source excerpt is available for this finding.