Back to skill

Security audit

Auto Model Selector

Security checks for vulnerabilities and agentic risk

Overview

This model-routing skill is coherent in purpose, but it needs review because it automatically contacts a hard-coded private-network Ollama server over plaintext HTTP, can send full prompts there, and can rewrite model configuration without clear user consent.

Install only if you control and trust the Ollama service at 192.168.10.14 and are comfortable with prompts being sent to it over plaintext HTTP. Prefer changing the endpoint to localhost or a secured, explicitly configured server before use, and review the automatic model-detection behavior because it can rewrite the skill's model configuration during normal imports or routing.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
smart_router.py:124
Finding

Full User Prompts Transmitted over Plaintext HTTP to a Hard-Coded LAN Host

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
smart_router.py:35
Finding

Module Import Triggers Unauthenticated Network Discovery and Persistent Configuration Changes

Content
View full analysis
None: """根据检测结果更新配置""" detected_models = self.detect_available_models() # 更新或添加新检测到的模型 for model_id, detected_config in detected_models.items(): if model_id not in self.models: # 新模型,添加到配置 self.models[model_id] = detected_config print(f"[模型管理器] 添加新模型: {model_id}") else: # 更新现有模型的enable状态 if detected_config.get("detected", False): self.models[model_id]["enable"] = True else: self.models[model_id]["enable"] = False # 标记未检测到的模型为禁用 for model_id in list(self.models.keys()): if model_id not in detected_models: self.models[model_id]["enable"] = False self.save_config() ``` ### Technical Analysis The module-level singleton `router = SmartRouter()` causes the constructor to run whenever `smart_router` is imported. The constructor immediately calls `model_manager.update_config_from_detection()`. This operation: 1. Executes the external `curl` binary. 2. Contacts a hard-coded LAN address over unauthenticated HTTP. 3. Parses model names returned by that service. 4. Adds those model names to in-memory configur ...[truncated 2204 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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 (16)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly instructs users to configure a non-local Ollama host using an HTTP URL on a LAN IP address, but it does not warn that user prompts may be transmitted off-host to that service. Because the skill routes requests based on prompt content and may invoke a model for classification, sensitive user input could be sent over the network without informed user consent, creating privacy and data-handling risk even if the remote host is operator-controlled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly states that complex requests will be handled by a cloud model/API, but it does not warn users that their prompts and potentially sensitive contents may be transmitted off-device. This creates a privacy and data-handling risk because users may unknowingly send proprietary code, credentials, file contents, or other sensitive material to a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill describes automatic per-request model switching based on task complexity, while listing file operations and command-related tasks among routed behaviors, but it does not define safeguards preventing sensitive operational context from being sent to the cloud. Automatic routing increases the chance that users will not realize when task details, filenames, command text, or related context are transmitted to a remote model.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file’s natural-language descriptions and user-facing CLI messages are entirely in Chinese, with no indication that language is selectable or limited to a region-specific deployment. This creates a locale policy concern because the skill effectively forces one language without user choice or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The update_models path invokes model_manager.update_config_from_detection(), which appears to change model configuration state, but the code provides no confirmation prompt and no user-facing warning that this command may rewrite or alter configuration. The docstring only says it updates configuration, which is not a clear safety disclosure for a state-changing operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The remove_model function deletes a model entry via model_manager.remove_model(model_id) and the CLI executes it immediately after receiving an ID. Although success/failure is printed afterward, there is no prior warning, confirmation, or explanatory comment/documentation alerting the user that this is a destructive action.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains natural-language descriptions and CLI output exclusively in Chinese, beginning with the module docstring and continuing throughout the command help and status messages. Because the file does not offer user opt-in for language selection or justify a Chinese-only locale restriction, it can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module title, docstrings, and all user-facing messages are written exclusively in Chinese, which imposes a specific language on users without offering a choice. The stated purpose is generic model management rather than a clearly region-specific or compliance-bound workflow, so the locale constraint is not justified in the file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The function claims to detect local Ollama models, but actually queries a fixed remote host at 192.168.10.14. This mismatch is security-relevant because operators may believe the code is only inspecting local state when it is actually performing network access to another machine, which can expose internal network details and trust remote-controlled data as if it were local.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
90% confidence
Finding

The code invokes an external program to make a network request to a hard-coded private IP address, which creates an unexpected trust boundary and allows the skill to contact a remote service during model discovery. While there is no shell injection here because arguments are passed as a list, the subprocess plus hidden remote dependency can leak environment/network metadata, bypass expected local-only behavior, and make execution depend on an untrusted host.

Content

Scanner excerpt · model_manager.py (reported line 78)May include surrounding context.

python
try:
            # 尝试获取Ollama模型列表
            result = subprocess.run(
                ["curl", "-s", "http://192.168.10.14:11434/api/tags"],
                capture_output=True,
                text=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This manifest uses Chinese-only natural-language labels and descriptions for the configured models, such as task routing notes in parentheses and Chinese descriptions. Under the policy provided, forcing a specific language or locale without opt-in or documented justification 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
84% confidence
Finding

Docstrings, status messages, prompts, and routing instructions are written exclusively in Chinese, which implies a fixed language/locale experience. The file does not indicate that users can opt into another language or that the locale restriction is documented and justified.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The code performs an external POST request containing raw user prompt content to a model endpoint. This is dangerous because prompt text can contain secrets, personal data, or proprietary content, and transmission over unsecured HTTP to a configurable host increases exposure to interception, unauthorized collection, or misuse by the receiving service.

Content

Scanner excerpt · smart_router.py (reported line 124)May include surrounding context.

python
if cache_key in self.cache:
                return self.cache[cache_key]
            
            response = requests.post(
                f"{self.ollama_host}/api/generate",
                json={
                    "model": self.judge_model,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The router sends the full user prompt to an HTTP network service for classification without any disclosure, consent flow, or minimization. Because prompts may contain sensitive user data and the default host is a private-network endpoint over plain HTTP, this creates a real privacy and data-exposure risk if the service is untrusted, intercepted, or logs requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language description and usage instructions are entirely in Chinese, and the file does not indicate that the skill is region-specific or provide an opt-in language choice. Under the stated policy, forcing a specific language without user choice is a locale-policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code includes user-facing comments and error output in Chinese only, such as the error messages at L09 and L15. The file provides no language choice, opt-in, or justification for enforcing a Chinese locale, which conflicts with the policy against forcing a specific language without user choice.

Content

No source excerpt is available for this finding.