T08 · Insecure Dependencies
- Location
scripts/model_router.py:672- Finding
Unresolved and Unpinned Executable Python Dependency
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This model-routing skill is purpose-aligned, but it stores cross-session user interaction data and changes OpenClaw session state while depending on an unbundled Python module.
Review this skill before installing. It can affect the active OpenClaw model session, persist user/profile/session/cost data under the home directory, and currently relies on a missing model_router_v3 module. Only use it if you trust the publisher, can verify the missing dependency source, and are comfortable with local cross-session memory storage.
scripts/model_router.py:672Unresolved and Unpinned Executable Python Dependency
scripts/model_router.py:225Non-Positive Daily Budget Causes Division-by-Zero Denial of Service
The skill advertises code-like capabilities including environment access, file read/write, and shell-related behavior but does not declare an explicit tool scope or permissions boundary. In an agent ecosystem, this creates an implicit authority problem: the skill may be invoked without users or host policies clearly understanding what resources it can touch, increasing the chance of unauthorized file access, command execution, or secret exposure.
The natural-language description and usage guidance are presented in Chinese, which effectively imposes a language/locale on the user-facing skill documentation. The file does not offer an opt-in language choice or explain that the skill is intentionally limited to a Chinese-speaking audience.
The activation language is broad enough to match many normal conversations about coding, analysis, querying, cost control, or model selection. Over-broad triggers can cause unexpected auto-activation of a skill that changes model behavior, persists data, or invokes privileged operations when the user did not clearly request those actions.
The documentation describes persistent user-profile and session-memory storage but does not clearly warn users about retention, purpose, duration, or how to opt out. This creates privacy and compliance risk because users may unknowingly have cross-session behavioral data stored and reused.
The skill explicitly supports cross-session memory and global user profiling without describing minimization, consent, or strict boundaries on what may be retained. Persistent collection of interaction history can capture sensitive prompts, personal data, or business information and later expose or misuse it across sessions.
The example workflow instructs the agent to wait for and use the user's next message for retrospective learning, effectively turning future user input into training/assessment data without a clear consent boundary. This is dangerous because subsequent messages may contain unrelated or sensitive information that the user did not intend to be recorded for model adaptation.
The skill documents persistent local storage of user profiles, session memory, and cost records in filesystem paths under the user's home directory. Storing identifiable behavioral data in predictable local files without mention of encryption, access controls, or retention limits raises substantial privacy and data leakage risk, especially on shared systems or compromised hosts.
The file-level title, module docstring, usage example, and many runtime user-facing messages are written only in Chinese, which effectively forces a specific language experience. The policy allows locale constraints only when documented and justified or when users are given a choice, neither of which appears here.
The code creates persistent storage under the user's home directory and later records session and cost history there without disclosure. Persisting detailed interaction metadata can expose sensitive prompts, behavioral patterns, and cost records to other local users, backups, or later compromise if file permissions and retention are not tightly controlled.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 方案1: 尝试使用 session_status 工具
try:
# 通过 subprocess 调用 openclaw CLI
result = subprocess.run(
["openclaw", "session", "status", f"--model={model_name}"],
capture_output=True,
text=True,
The skill is presented as a routing hook, but it performs external CLI execution to affect session state. In an agent environment, undisclosed subprocess execution expands the trust boundary and can surprise operators, especially if the CLI has broader capabilities or inherits sensitive environment/context.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 尝试通过 CLI 获取
try:
result = subprocess.run(
["openclaw", "session", "status"],
capture_output=True,
text=True,
When model switching fails, the code still records the interaction as if the recommended model was used, while the actual model may differ. This creates an integrity problem in audit, learning, and cost logic that can mislead downstream decisions and conceal operational failures, reducing the reliability of safety or budget controls.
This Python file contains user-facing natural-language text in Chinese only in the module docstring. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is documented and justified, which is not present here.
Writing persistent session and cost data without explicit warning undermines informed consent and can expose sensitive operational metadata over time. In agent contexts, even seemingly low-sensitivity routing history can reveal user interests, workflows, and usage patterns.
The code executes an external CLI via subprocess to inspect or influence model selection, which is a shell-execution operation covered by this rule. Although there is some logging on failure, there is no prior user-facing disclosure, confirmation, or explanatory warning near the operation about invoking a local command.
The code writes and reads a process-wide environment variable to steer model behavior, which can create hidden cross-component state and unintended interference in shared runtimes. In multi-skill or long-lived agent processes, this can cause one component to influence another without clear isolation or auditability.
The manifest promises automatic model selection, intent-based routing, budget control, and adaptive preference learning. The code additionally implements an A/B testing framework and reporting/dashboard telemetry, which are product analytics capabilities not reflected in the manifest description and go beyond the core routing behavior.