T09 · Insecure Skill Coding Practices
- Location
src/openclaw/openclaw-invoker.ts:297- Finding
Shell Command Injection Through Model Messages
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent model-routing purpose, but it includes under-disclosed high-impact code paths that can execute shell commands, write prompts to shared temp files, probe arbitrary provider URLs, and persist local configuration/log data.
Review this skill carefully before installing. It may be appropriate only if you trust the publisher and are comfortable with local config/log persistence plus OpenClaw provider integration code. Do not use it with sensitive prompts or API keys until shell execution is changed to argument-based spawning, temp prompt files are protected or removed, provider URLs are strictly allowlisted, and the privacy documentation matches the actual data flows.
src/openclaw/openclaw-invoker.ts:297Shell Command Injection Through Model Messages
src/openclaw/openclaw-invoker.ts:484Sensitive Prompts Written to Predictable Shared Temporary Storage
src/openclaw/model-adapter.ts:269Prompts and Bearer Credentials Sent to Unvalidated Provider URLs
src/openclaw/provider-discovery.ts:460Server-Side Request Forgery in Provider Discovery
src/openclaw/status-monitor.ts:322Recurring SSRF Through the Provider Status Monitor
src/openclaw/openclaw-invoker.ts:628Arbitrary File Deletion Through Mutable Temporary Directory Configuration
handlebars 4.7.8 is present and has multiple severe advisories including prototype pollution and possible code or script injection through crafted templates/AST manipulation. Even as a dev dependency, this is highly dangerous if any untrusted template content is compiled or rendered during code generation, testing, or build automation.
brace-expansion 1.1.12 is present and is associated with multiple denial-of-service issues involving pathological brace patterns that can trigger excessive CPU or memory consumption. Even though it is transitive and primarily in development tooling paths, it remains a real vulnerability if any code path accepts untrusted glob or pattern input.
js-yaml 3.14.2 is included and has multiple reported CPU-exhaustion issues when parsing crafted YAML with merge keys or special structures. This is a real vulnerability in the dependency, though in this lockfile it appears under dev tooling, so exploitability depends on whether untrusted YAML is ever parsed during tests or build steps.
brace-expansion 2.0.2 is also present and carries the same class of denial-of-service issues from crafted brace patterns that can consume large CPU or memory resources. Because there are multiple copies in the dependency graph, the exposure is broader across tooling that performs glob expansion.
browserslist 4.28.1 is present and is reported with crash/prototype-write and unbounded-memory-growth issues when handling untrusted stats or adversarial queries. This is a real issue, but in this repository it is part of the development toolchain rather than the production skill path, which lowers the immediate exploitability.
flatted 3.4.1 is reported as vulnerable to prototype pollution via parse(), which can let attacker-controlled input modify object prototypes and alter program behavior in dangerous ways. Although this instance is in dev tooling, prototype pollution is broadly dangerous because it can lead to logic bypass, unexpected property resolution, or downstream code execution conditions in some contexts.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
} as PredictedPerformance;
} catch (error) {
logger.warn('历史预测失败,使用规则预测', { error });
return rulePrediction;
}
}
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
} as PredictedPerformance;
} catch (error) {
logger.warn('历史预测失败,使用规则预测', { error });
return rulePrediction;
}
}
The document begins entirely in Chinese and continues in Chinese throughout, with no indication that users may choose another language or that the skill is intended only for a Chinese-speaking or region-specific audience. This can violate a language/locale policy when a skill imposes a specific language without user opt-in.
This markdown file presents all user-facing instructions, setup steps, and API guidance exclusively in Chinese. Under the policy for natural-language violations, forcing a specific language without user opt-in or a documented justification is a reportable issue.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
This manifest’s user-facing natural-language fields, including name, description, capability descriptions, configuration descriptions, and examples, are presented exclusively in Chinese. Under the policy, forcing a specific language without offering a user choice or documenting a justified locale constraint is a natural-language policy violation.
The code logs a preview of raw task content before routing, which can capture sensitive prompts, credentials, personal data, or proprietary text in application logs. Because this occurs automatically and there is no evidence here of consent, redaction, or log-level gating, normal use can create an unintended data exposure path.
The exported skill interface presents itself as a routing skill, but it also exposes privileged state-changing operations such as configuration mutation and shutdown. In an agent-skill context, this expands the attack surface beyond the advertised purpose and can let prompts or other skills reconfigure routing behavior persistently, disable safeguards, or induce denial of service.
This TypeScript file uses Chinese throughout its descriptive comments and operational log messages, including initialization, error, and status text, with no indication that the skill is China-specific or that users can opt into this locale. Under the language/locale policy, forcing a specific language without user choice is a natural-language policy concern.
The function defensively derives a safe modelId from multiple possible selectedModel shapes, but the created LearningSample later uses decision.selectedModel.modelId directly. If untrusted or malformed routing data reaches this path, that direct dereference can throw at runtime or record inconsistent sample data, allowing an attacker or bad input to disrupt learning, suppress telemetry, or poison model-specific statistics. In this learning/router context, availability and integrity of routing feedback are important, so this mismatch is more dangerous than a mere style issue.
This code sends request.messages in an HTTP POST body to a third-party model provider, which may include user or system data. Although there is developer-oriented debug logging, there is no confirmation prompt or clear user-facing disclosure in this file that request contents will be transmitted externally.
With no manifest available, this skill's purpose is unknown, so spawning subprocesses via child_process and operating on local files/temp directories are capabilities that are not justified by any stated intent. The code does more than simple in-process request handling by invoking an external binary, reading environment-derived paths, and creating local workspace/temp state.
The code constructs a shell command by interpolating request.model, serialized messages, numeric options, and openclawPath into a single string passed to exec. Because shell metacharacters and quoting edge cases in user-controlled content can break out of the intended arguments, this creates a command injection risk that could lead to arbitrary command execution under the application's privileges.
The invoker writes full request payloads, including conversation messages, to predictable files under a shared temp directory. This can expose sensitive prompts, system messages, API-related metadata, or proprietary data to other local users/processes and leaves recoverable artifacts on disk if cleanup fails or the process crashes.
Temporary request/session files store raw user and system messages on disk without confidentiality protections or explicit lifecycle guarantees. In this context, prompts may contain secrets, personal data, or internal instructions, so storing them in /tmp-like locations materially increases local disclosure risk and post-mortem data leakage.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
private inferBaseUrl(providerId: string): string {
const urlMap: Record<string, string> = {
'deepseek': 'https://api.deepseek.com',
'openai': 'https://api.openai.com/v1',
'anthropic': 'https://api.anthropic.com',
'google': 'https://generativelanguage.googleapis.com',
'mistral': 'https://api.mistral.ai/v1',
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
'openai': 'https://api.openai.com/v1',
'anthropic': 'https://api.anthropic.com',
'google': 'https://generativelanguage.googleapis.com',
'mistral': 'https://api.mistral.ai/v1',
'cohere': 'https://api.cohere.ai',
'minimax': 'https://api.minimax.chat/v1',
'qwen': 'https://dashscope.aliyuncs.com/compatible-mode/v1',
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
'google': 'https://generativelanguage.googleapis.com',
'mistral': 'https://api.mistral.ai/v1',
'cohere': 'https://api.cohere.ai',
'minimax': 'https://api.minimax.chat/v1',
'qwen': 'https://dashscope.aliyuncs.com/compatible-mode/v1',
'baichuan': 'https://api.baichuan-ai.com/v1',
};