Back to skill

Security audit

AI写真助手

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent AI photo customer-service assistant, but it needs review because it silently reads a global OpenClaw config for a DeepSeek key and sends user prompts to DeepSeek without clear disclosure.

Review before installing. Use a dedicated, limited DeepSeek API key if you run it, avoid entering sensitive prompts, and expect responses to be sent to DeepSeek and steered toward the AI photo service/order page.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
assistant.js:2
Finding

Automatic Access to a Global Credential-Bearing Configuration File

Content
View full analysis

Vulnerability Details

File Location: assistant.js, lines 2-4
Vulnerability Type: Unauthorized access to a global credential-bearing configuration file
Risk Level: Medium

Vulnerable Code

javascript
const https = require('https'), fs = require('fs'), path = require('path');
let KEY = process.env.DEEPSEEK_API_KEY || '';
try { const c = JSON.parse(fs.readFileSync(path.join(process.env.HOME,'.openclaw/openclaw.json'),'utf8')); KEY = KEY || c.models?.providers?.deepseek?.apiKey || ''; } catch(e){}

Technical Analysis

The module automatically reads ~/.openclaw/openclaw.json whenever it is executed or imported. This is a global, potentially credential-bearing configuration file rather than a file scoped to this skill.

Although the code extracts only the configured DeepSeek API key and the reviewed implementation uses that key solely to authenticate requests to api.deepseek.com, direct access to the entire configuration file violates least-privilege principles. The process necessarily obtains the contents of the complete file before selecting the nested API-key field.

The broad catch block also suppresses every read and parsing error, making this credential-access behavior less visible to users and operators. No evidence was found that the current implementation transmits the key to an unrelated host or prints it.

Attack Path

  1. A user installs the skill and executes assistant.js, or another module imports it.
  2. The module resolves the current user's home directory through process.env.HOME.
  3. It reads the complete ~/.openclaw/openclaw.json file without an explicit consent step.
  4. It parses the file and extracts models.providers.deepseek.apiKey when DEEPSEEK_API_KEY is not already set.
  5. The extracted credential is placed in the module-level KEY variable and used as a bearer token for DeepSeek API requests.
  6. If the skill process or module were subsequently compromise ...[truncated 869 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove automatic reads of ~/.openclaw/openclaw.json and require the credential to be supplied through DEEPSEEK_API_KEY or a platform-provided secret API.
  2. If configuration-file fallback is essential, request explicit user consent before accessing the file and document the exact file and field being read.
  3. Use a narrowly scoped credential broker or configuration interface so the skill receives only the DeepSeek token rather than permission to read the entire global configuration file.
  4. Prefer a dedicated, revocable API key with restricted permissions, quota limits, and billing limits.
  5. Avoid silently suppressing all exceptions. Report a sanitized error that explains whether the environment variable is missing or credential retrieval failed, without revealing the secret or sensitive file contents.
  6. Keep the key out of logs, model prompts, returned errors, and exported module state. Rotate the credential if unauthorized access to the skill process is suspected.
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 (6)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill title and description require Chinese comprehension and do not indicate any option for the user to choose another language. Per 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.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill loads a DeepSeek API key from environment/local config and immediately uses it to send user-supplied input to an external service, while the embedded system prompt hardcodes unrelated marketing behavior for an AI photo service. In the absence of any declared legitimate skill purpose, this creates a covert data exfiltration and third-party promotion channel, which is made more suspicious by the punycode destination and credential harvesting from the user's local OpenClaw config.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The embedded system message instructs the model in Chinese and fixes the assistant persona and response behavior to a Chinese-language customer-service role. There is no indication of user opt-in or a documented region-specific justification, which makes this a language/locale policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code sends the full user prompt to api.deepseek.com without any user-facing disclosure, consent, or data-handling notice. If users enter sensitive or proprietary information, that content is transmitted to a third party unexpectedly, creating privacy and compliance risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The script reads an API key from DEEPSEEK_API_KEY and from a local config file under the user's home directory, but provides no comment, log, or warning that it accesses stored credentials. Access to sensitive credentials is in scope for missing-warning checks on code files when there is no disclosure at all.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The exported interface presents itself as a generic generate function, but the implementation performs chat completion with a hidden system prompt that steers output into promotional copy for an external AI photo website. This mismatch is deceptive and can be used to smuggle undisclosed advertising or social-engineering content through a seemingly harmless API.

Content

No source excerpt is available for this finding.