Back to skill

Security audit

openclaw-skill-customs

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent customs-document purpose, but it needs review because its upload and task-control scripts grant broader local-file and backend authority than the workflow clearly contains.

Install only if you trust DaoFei AI/Leap with the customs documents and understand that files are sent to an external service using LEAP_API_KEY. Before use, restrict the agent/runtime to the active task directory, verify the exact files listed before upload, avoid storing the API key in shell startup files, and prefer a pinned or preinstalled openpyxl dependency. Treat list, cancel, and retry task controls as privileged operations unless the backend guarantees they only affect the current user's tasks.

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
scripts/file_transfer.py:27
Finding

Unrestricted Local File Upload Violates the Intended Workspace Boundary

Content
View full analysis
dict: """Upload one file to the Leap platform and return the result.""" body, content_type = _build_multipart(abs_path) url = f"{base_url}/api/v1/files/upload" req = urllib.request.Request(url, data=body, method="POST", headers={ "Authorization": f"Bearer {api_key}", "Content-Type": content_type, "Accept": "application/json", }) try: with urllib.request.urlopen(req, timeout=120) as resp: return json.loads(resp.read().decode("utf-8")) except urllib.error.HTTPError as e: body_text = e.read().decode("utf-8", "replace") return {"status": "error", "http_code": e.code, "error_message": body_text, "file_path": abs_path} except urllib.error.URLError as e: return {"status": "error", "error_message": f"Connection failed: {e}", "file_path": abs_path} def upload_files(base_url: str, api_key: str, file_paths: list): """Upload one or m ...[truncated 3161 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
references/MODIFICATION.md:104
Finding

Unpinned Third-Party Package Installation Creates a Supply-Chain Risk

Content
View full analysis
Remediation
View remediation
``` 2. Generate a locked requirements file containing hashes for `openpyxl` and all transitive dependencies. 3. Install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements-step6.lock ``` 4. Use an isolated virtual environment rather than modifying the Agent's global Python environment. 5. Configure an approved HTTPS package index and disable untrusted extra indexes. 6. Prefer provisioning the dependency during controlled Skill deployment instead of installing it dynamically in response to a user request. 7. Record and periodically review the dependency version, hashes, provenance, and known vulnerabilities. 8. If runtime installation remains necessary, obtain explicit user approval before modifying the environment and clearly identify the package source and pinned version. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (26)

Tainted flow: 'req' from os.environ.get (line 40, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/check_config.py (reported line 47)May include surrounding context.

python
)

    try:
        with urllib.request.urlopen(req, timeout=10) as resp:
            results["connection_ok"] = True
            if resp.status == 200:
                results["auth_ok"] = True

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill description omits important remote data-transfer behavior, including uploading user-provided files and downloading generated result files from a third-party platform. For customs, invoice, bill of lading, and packing list documents, that omission is materially dangerous because these files may contain commercially sensitive and regulated information.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill description omits important remote data-transfer behavior, including uploading user-provided files and downloading generated result files from a third-party platform. For customs, invoice, bill of lading, and packing list documents, that omission is materially dangerous because these files may contain commercially sensitive and regulated information.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill description omits important remote data-transfer behavior, including uploading user-provided files and downloading generated result files from a third-party platform. For customs, invoice, bill of lading, and packing list documents, that omission is materially dangerous because these files may contain commercially sensitive and regulated information.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file presents the skill purpose and safety guidance in Chinese only, which effectively forces a specific language for users reading core operational information. Under the policy, language constraints should either offer user choice or be clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill clearly instructs use of environment variables, shell commands, local file read/write, and network access, but it does not declare any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and can cause the runtime to grant broader capabilities than users or reviewers expect, especially because the workflow handles sensitive customs documents and uploads them to an external platform.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language description and operating instructions are entirely in Chinese and present the skill as a Chinese customs declaration assistant, but they do not explicitly state that the user must opt into Chinese or that the skill is restricted to Chinese-language workflows. Under the policy, forcing a specific language or locale without user choice or explicit justification is a violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The invocation rule triggers on broad keywords such as customs declaration, invoice, packing list, bill of lading, and HS code, which can appear in benign discussion without intent to process or exfiltrate files. Over-broad triggering raises the chance that the skill activates unexpectedly and starts a workflow involving sensitive document handling and external network transfer.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The API reference explicitly describes uploading invoices, packing lists, bills of lading, and downloading processed results from a third-party remote service, but it provides no warning that these documents may contain sensitive commercial or personal data. In the context of a customs declaration skill, this omission is significant because users may unknowingly transmit regulated trade, identity, shipment, and financial information off-platform without informed consent or data-handling guidance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The rule text mandates Chinese-only phrasing and fixed output wording without offering any user language choice. In an agent skill, this can override user preferences or system locale, causing unsafe or unusable outputs for non-Chinese-speaking users and increasing the chance that compliance guidance is misunderstood or ignored.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The title and operational instruction are written entirely in Chinese and direct the agent to use this file during field modification, but there is no indication that language choice is optional or limited to a justified region-specific workflow. Under the policy, forcing a specific language without user opt-in can be a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all instructions, labels, and the required confirmation phrases entirely in Chinese, including user-facing response guidance such as “请确认分类结果是否准确?” and expected reply formats. Under the policy, a skill should not impose a specific language or locale unless it offers a choice or clearly documents a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file presents all operational guidance in Chinese and does not indicate that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or China-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains user-facing interaction scripts entirely in Chinese and does not indicate that the language is configurable or optional. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly instructs the agent to run pip install openpyxl if the dependency is unavailable. Allowing a document-processing skill to install packages expands its capabilities beyond the declared business function and introduces supply-chain and environment-modification risk, especially if package sources, versions, and permissions are uncontrolled. In this context, the instruction is not necessary for safe operation because dependency management should be handled out of band, not during task execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file includes its primary docstring and operational messages in Chinese, which imposes a specific language on users without any visible opt-in or alternative. The policy explicitly calls for flagging language or locale constraints when the skill forces a specific language without user choice.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest frames this skill as a customs declaration document assistant for classifying uploaded trade documents, extracting structured declaration data, and generating Excel output. This script instead reads the LEAP_API_KEY from environment variables and performs an authenticated HTTP request to a platform API to validate connectivity and credentials, which is an infrastructure/configuration capability not justified by the stated end-user customs-processing purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains natural-language docstrings and CLI help text in Chinese only, including the top-level description and usage instructions. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes a customs declaration document-processing assistant that identifies document types, extracts structured customs data, and generates standardized declaration Excel outputs. This file instead implements a standalone generic transport utility that uploads arbitrary local files and downloads arbitrary result files from a remote platform, without any customs-specific validation or processing logic in the code shown.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language documentation and CLI help/error text exclusively in Chinese, beginning with the module docstring and continuing throughout the script. Under the policy rule for language/locale, forcing a specific language without opt-in or a documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script advertises and implements operational task-management modes beyond the declared customs document workflow: poll, list-tasks, cancel, and retry. In an agent skill context, exposing these controls can let the skill inspect or interfere with unrelated backend jobs if the same API key has broader scope, violating least privilege and expanding the attack surface.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The list-tasks mode enables enumeration of processing tasks, an administrative capability not required for customs document extraction. If the backend returns jobs across a broader account or tenant, this could disclose metadata about other users' documents, workflows, timing, and identifiers, which is especially sensitive in a customs-processing context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The cancel mode allows deletion or termination of backend tasks by result_id, which can disrupt processing of other jobs if identifiers are guessed, leaked, or obtained from listing. In a document-processing assistant, this is an unnecessary control plane action that could be abused for denial of service or workflow tampering.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The retry mode provides the ability to re-trigger backend tasks, which is outside the stated role of generating customs declaration outputs. An attacker or misused agent could repeatedly retry expensive jobs, causing unwanted reprocessing, cost amplification, or state inconsistencies, especially if paired with task enumeration.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The manifest only describes document processing behavior for customs paperwork; it does not mention credential handling or backend platform access. Reading LEAP_API_KEY from the environment introduces secret access capability that is not evident from the stated scope, even though it may support the implementation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.