Back to skill

Security audit

database-specialist

Security checks for vulnerabilities and agentic risk

Overview

The skill discloses a paid clawtip workflow, but it mostly implements payment gating with broad permissions, external tool execution, and weakly protected local order records rather than substantive database-specialist behavior.

Review this carefully before installing. Use it only if you are comfortable with a Chinese-language paid clawtip flow, external clawtip/npm tooling, and local storage of your consultation question and payment metadata. Do not include database credentials, connection strings, private schema, or sensitive logs in the question, and prefer running it in a constrained environment with verified payment tooling.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/service.py:20
Finding

Payment Authorization Can Be Forged Through Locally Modified Order Data

Content
View full analysis
bool: credential = order_data.get("payCredential") if not credential: return False credential_ts = order_data.get("credentialTimestamp") if credential_ts: age = time.time() - credential_ts if age > CREDENTIAL_TTL: return False return True ``` ```python if not is_credential_valid(order_data): print("PAY_STATUS: ERROR") print("ERROR_INFO: 未找到有效的支付凭证。请先通过 clawtip 完成支付。") sys.exit(1) pay_status = order_data.get("payStatus", "SUCCESS") print(f"PAY_STATUS: {pay_status}") if pay_status != "SUCCESS": print(f"ERROR_INFO: 支付状态为 {pay_status},无法续进") sys.exit(1) print("AUTHORIZATION_RESULT=verified") ``` ### Technical Analysis The service treats any non-empty `payCredential` value as proof of payment. It does not cryptographically verify the credential, establish a chain of trust to clawtip, or bind the credential to the expected order number, amount, recipient, or Skill indicator. The timestamp check is also fail-open. If `credentialTimestamp` is absent, the credential never expires. In addition, `payStatus` defaults to `SUCCESS` when the field is absent. Because order files are ordinary locally writable JSON files, an actor with access to the user's account or any Agent/tool with filesystem write permission can fabricate the fields required for authorization. ### Attack Path 1. Create an order using `scripts/create_order.py`. 2. Locate the resulting JSON file under the documented local orders directory. 3. Add an arbitrary non-empty field such as: ```json { "payCredential": "forged" } ``` 4. Omit `credentialTimestamp`, avoiding the expiration check. 5. Omit `payStatus`, causing the code to de ...[truncated 525 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:61
Finding

Third-Party Tools Are Installed and Executed Without Artifact Integrity Verification

Content
View full analysis
\ -i \ -v 1.0.12 ``` ### Technical Analysis The documented workflow instructs users or Agents to install and execute externally distributed packages. The `openclaw skills install clawtip` command does not pin a reviewed version or artifact digest. The `npx` command pins a package version, but version pinning alone does not verify the integrity or provenance of the registry artifact. No lockfile, checksum, cryptographic signature, vendored dependency, or trusted publisher verification is supplied. Consequently, the code actually executed can depend on the state and trustworthiness of external registries and distribution infrastructure at installation time. ### Attack Path 1. An attacker compromises the referenced package, publisher account, registry, or distribution path. 2. A user or Agent follows the Skill's prerequisite or sandbox payment instructions. 3. `openclaw skills install` or `npx --yes` retrieves the affected artifact. 4. Package installation hooks or CLI entry-point code execute locally. 5. Malicious package code runs with the permissions of the invoking user or Agent process. ### Impact Assessment A compromised dependency could execute arbitrary code as the invoking account. Depending on the runtime environment, it could read accessible environment variables and credentials, modify user-writable files, or make outbound network requests. The audited repository does not itself contain such a payload; the risk arises from unverified external dependency execution. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create_order.py:34
Finding

Encryption Failure Falls Back to Plaintext Local Storage

Content
View full analysis
dict: pay_to = os.environ.get("CLAWTIP_PAY_TO", "") sm4_key = os.environ.get("CLAWTIP_SM4_KEY", "") if not pay_to: print("WARNING: CLAWTIP_PAY_TO environment variable not set") if not sm4_key: print("WARNING: CLAWTIP_SM4_KEY environment variable not set") order_no = generate_order_no() encrypt_payload = json.dumps({ "orderNo": order_no, "amount": str(AMOUNT), "payTo": pay_to, }, ensure_ascii=False) encrypted_data = encrypt_payload if sm4_key: try: # Support both hex (32 chars) and base64 keys if len(sm4_key) == 32 and all(c in "0123456789abcdefABCDEF" for c in sm4_key): encrypted_data = sm4_encrypt_hex(sm4_key, encrypt_payload) else: encrypted_data = sm4_encrypt_base64(sm4_key, encrypt_payload) except Exception as e: print(f"WARNING: SM4 encryption failed: {e}") order_data = { "payTo": pay_to, "amount": AMOUNT, "order_no": order_no, "encrypted_data": encrypted_data, "slug": SLUG, "question": question, "description": DESCRIPTION, "resource_url": RESOURCE_URL, "encodedInfoData": ENCODED_INFO_DATA, } ``` ### Technical Analysis `encrypted_data` is initialized with the plaintext payment payload. If `CLAWTIP_SM4_KEY` is missing, invalid, or causes encryption to fail, order creation continues and stores that plaintext value. The order record also always stores `payTo` and the user's consultation `question` as plaintext fields, regardless of whether encryption succeeds. Consultation questions may contain schema details, SQL fragments, ...[truncated 1093 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/file_utils.py:46
Finding

Order Files Do Not Enforce Restrictive Filesystem Permissions

Content
View full analysis
str: """ 将订单数据写入固定目录: ~/.openclaw/skills/orders/{indicator}/{order_no}.json 返回写入的文件完整路径。 """ validate_order_no(order_no) base_dir = get_orders_base_dir(indicator) os.makedirs(base_dir, exist_ok=True) json_path = os.path.join(base_dir, f"{order_no}.json") with open(json_path, "w", encoding="utf-8") as f: json.dump(order_data, f, ensure_ascii=False, indent=2) return json_path ``` ### Technical Analysis The order directory and JSON files are created with permissions derived from the process's ambient umask. The code does not explicitly require owner-only directory or file access. On a system with a permissive umask, other local users may be able to read order metadata and consultation questions. Writable files also worsen the payment-forgery vulnerability because authorization decisions are derived from these local JSON records. The write is not atomic and does not defend against pre-existing symbolic links. Input validation prevents direct path traversal through `indicator` and `order_no`, but it does not independently protect the destination from local filesystem manipulation by another principal with access to the directory. ### Attack Path 1. The Skill runs under a permissive umask or within a home-directory hierarchy accessible to another local principal. 2. The script creates the order directory and JSON file without explicit owner-only modes. 3. Another local user or process reads the stored consultation and payment metadata. 4. If write access is also available, the actor can modify the record and fabricate payment authorization fields consumed by `service.py`. ### Impact Assessment Successful exploitation can disclose locally stored or ...[truncated 284 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Embedding cryptographic/payment-processing behavior inside a skill advertised for database architecture and SQL optimization increases attack surface and complicates review. While cryptography itself is not inherently malicious, low-level encryption and encoding logic unrelated to the declared purpose can conceal unsafe handling of secrets, payment metadata, or authorization state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Embedding cryptographic/payment-processing behavior inside a skill advertised for database architecture and SQL optimization increases attack surface and complicates review. While cryptography itself is not inherently malicious, low-level encryption and encoding logic unrelated to the declared purpose can conceal unsafe handling of secrets, payment metadata, or authorization state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Embedding cryptographic/payment-processing behavior inside a skill advertised for database architecture and SQL optimization increases attack surface and complicates review. While cryptography itself is not inherently malicious, low-level encryption and encoding logic unrelated to the declared purpose can conceal unsafe handling of secrets, payment metadata, or authorization state.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Embedding cryptographic/payment-processing behavior inside a skill advertised for database architecture and SQL optimization increases attack surface and complicates review. While cryptography itself is not inherently malicious, low-level encryption and encoding logic unrelated to the declared purpose can conceal unsafe handling of secrets, payment metadata, or authorization state.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file’s stated purpose is creating a payment order, collecting payment metadata, and emitting order details, which is unrelated to the declared database-specialist functionality. This mismatch is dangerous because it disguises commercial/payment behavior inside a skill that users and reviewers would expect to perform database analysis, increasing the chance of deceptive execution and unauthorized billing workflows.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Line L031 states '请使用中文与用户交互。', which forces a specific language for all interactions. Under the policy rules, language constraints are only acceptable when the skill offers opt-in/choice or clearly documents a justified region-specific requirement, neither of which appears here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code reads payment recipient and encryption key material from environment variables, builds a payment payload, and persists a local order file despite the skill being presented as a database consulting tool. In this context, payment-processing capability is unjustified and can facilitate covert monetization, deceptive order generation, or staging of later payment collection without aligning with the user’s expected task.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This module establishes OS-specific directories and manages persisted order JSON files in the user's home directory. Creating and maintaining an order-tracking file store is not a direct or obvious requirement for a skill whose declared purpose is database architecture and SQL/schema advisory work.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code loads JSON order records from a fixed local orders directory using an indicator and order number. Reading order-management artifacts is not an obvious implementation detail of database design, SQL tuning, schema review, or migration planning as described in the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a skill for database architecture design, SQL optimization, schema review, and migration planning, which suggests analysis and advisory work around databases. This code instead writes arbitrary order data as JSON files under a local skill orders directory, which is a separate file-based persistence workflow not implied by the stated database-specialist purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script does not implement the advertised database-specialist functionality; it only performs payment/order checks and emits an authorization result. This mismatch is dangerous because it turns the skill into a payment-gating wrapper that can mislead operators, conceal non-delivery of the promised capability, and create a deceptive trust boundary around order data and authorization state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script includes user-facing error messages in Chinese string literals, which forces a specific language/locale on users. The file does not provide any opt-in, language selection, or justification for this locale restriction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This file adds custom cryptographic functionality that is unrelated to the declared database-specialist purpose, which is a strong indicator of hidden or unnecessary capability. Even if the SM4 implementation is not overtly malicious, shipping bespoke ECB-mode encryption in a skill broadens attack surface, can enable covert data handling, and may be used to conceal sensitive information or exfiltration payloads in a context where users would not expect crypto features.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This file contains natural-language descriptions in Chinese, including user-relevant documentation of file locations and behavior, with no indication that another language is supported or that the skill is intentionally region-specific. The policy requires avoiding forced language or locale constraints unless the user is given a choice or the constraint is justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The docstring frames the script as delivering service authorization, suggesting a substantive authorization service operation. In practice, the code only checks local order data for payment-related fields and emits success/error text, which is narrower than the documented intent.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.