Back to skill

Security audit

Mihomo Proxy Management

Security checks for vulnerabilities and agentic risk

Overview

The skill coherently manages a Mihomo proxy, but it includes broad live-control commands that can disrupt traffic and documents bearer-token use over plaintext HTTP.

Install only if you intend to let the agent administer a Mihomo controller. Keep the controller bound to localhost or behind a trusted private/TLS connection, avoid sending the bearer secret over plain HTTP to remote hosts, and require explicit confirmation before restart, reload, cache flush, close-connections, provider update, or upgrade actions.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:16
Finding

Bearer Authentication Secret May Be Transmitted over Plaintext HTTP

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:16-22, 28-70; references/api.md:5-9, 66-118
Vulnerability Type: Plaintext transmission of sensitive authentication credentials
Risk Level: Medium

Vulnerable Code

SKILL.md:16-22:

bash
## Connection Info

Default values, override with user-provided:
- **Host**: `http://127.0.0.1:9090`
- **Secret**: Ask user if not provided

Store connection in environment for session:
```bash
MIHOMO_URL="http://host:9090"
MIHOMO_SECRET="your-secret"
text

`SKILL.md:28-30`:

```bash
# Version
curl -s -H "Authorization: Bearer $MIHOMO_SECRET" "$MIHOMO_URL/version"

references/api.md:5-9:

bash
## Authentication

All API requests require Authorization header:

```bash
curl -H "Authorization: Bearer ${secret}" http://${host}:${port}/endpoint
text

`references/api.md:66-69`:

```bash
### Get version
```bash
curl -H "Authorization: Bearer $SECRET" http://host:9090/version
text

### Technical Analysis

The Skill uses bearer-token authentication while documenting Mihomo controller URLs with the plaintext `http://` scheme. Although the default loopback endpoint reduces exposure for a purely local deployment, the instructions explicitly allow the host to be overridden and provide remote-host examples such as `http://host:9090`.

HTTP does not provide confidentiality or server authentication. If these examples are followed for a remote Mihomo instance, the `Authorization: Bearer ...` header and API responses travel without transport encryption. An attacker capable of observing or manipulating traffic between the agent and the controller could recover the reusable secret or tamper with requests and responses.

The issue affects all documented requests that combine the plaintext URL with the authorization header, including status inspection, proxy selection, delay testing, connection management, cache flushing, configuration reload, and restart.

### Attack Path

1. A user configures `MIHOMO_URL` wi
...[truncated 1688 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require https:// for every non-loopback Mihomo controller URL and reject plaintext remote URLs by default.
  2. Permit HTTP only for explicitly recognized loopback addresses such as 127.0.0.1, localhost, and ::1, with a clear warning that it must not be used across an untrusted network.
  3. Update all remote-host examples in SKILL.md and references/api.md to use HTTPS:
    bash
    MIHOMO_URL="https://mihomo.example.com"
    curl --fail --silent --show-error \
      -H "Authorization: Bearer $MIHOMO_SECRET" \
      "$MIHOMO_URL/version"
    
  4. Deploy a trusted TLS reverse proxy in front of Mihomo when the controller must be accessed remotely. Use a certificate whose hostname is validated by the client.
  5. Do not recommend bypassing TLS validation with options such as curl -k or --insecure.
  6. Restrict controller exposure with host firewalls, private networking, or a VPN, and bind the native controller to loopback where possible.
  7. Rotate the bearer secret if it may previously have crossed an untrusted plaintext connection. Use a strong, unique secret and apply the minimum controller privileges available.
  8. Prefer scoped process injection or a protected secret store over broadly exported environment variables where the execution environment supports it.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The invocation description says to use the skill when the user mentions "clash" or "proxy switching," and broadly lists several needs without clear activation boundaries. These terms are common enough in general conversation or troubleshooting contexts that the skill could be invoked unintentionally, and the file provides no negative examples or exclusion conditions.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 44)May include surrounding context.

bash
# Switch node in a group
curl -X PUT -H "Authorization: Bearer $MIHOMO_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"name":"节点名"}' \
  "$MIHOMO_URL/proxies/策略组名"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill includes destructive operations such as closing all connections, reloading config, flushing caches, and restarting mihomo without explicit confirmation or warnings. If the agent invokes these commands automatically or on ambiguous user requests, it can disrupt network connectivity, terminate sessions, or cause service interruption on the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file describes config reload, restart, and upgrade operations as ordinary API calls but does not warn that they can disrupt service or change system state. Under the markdown criteria for missing user warnings, behavior that can affect system integrity should include an explicit caution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes the skill as handling proxy status, switching, delay testing, connection management, config reload/restart, cache flushing, and traffic/log monitoring. This API reference additionally documents /upgrade for software upgrade and /dns/query for arbitrary DNS lookup, which are not mentioned in the stated skill scope and expand the apparent behavior beyond the manifest description.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

A documented /upgrade endpoint allows upgrading mihomo itself, which is more privileged than the manifest's listed operations focused on runtime proxy management and monitoring. Upgrading software changes the installed system state and is not an obvious requirement of checking status, switching nodes, testing delays, or managing connections.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation lists DELETE endpoints to close all connections or a specific connection, and later provides a direct example for closing all connections, but nowhere warns that this will terminate active sessions. For markdown files, omission of warnings about actions affecting user data or system behavior is a reportable issue.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/api.md (reported line 86)May include surrounding context.

Switch proxy in group

bash
curl -X PUT -H "Authorization: Bearer $SECRET" \
  -H "Content-Type: application/json" \
  -d '{"name":"香港01"}' \
  http://host:9090/proxies/自动选择

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
74% confidence
Finding

Flushing fake IP or DNS cache modifies runtime state and can affect ongoing resolution behavior, but the markdown provides no warning or note about the operational impact. This is a milder missing-warning issue because the action is state-changing but less obviously destructive than restart or connection termination.

Content

No source excerpt is available for this finding.