Back to skill

Security audit

Mihomo CLI

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Mihomo controller helper, but it can silently use a local bearer secret and send it over plaintext HTTP to a configurable controller host.

Review this before installing if you use a Mihomo API secret or a non-local controller. Keep the controller bound to localhost where possible, avoid passing secrets on the command line, and do not let an agent run switch, flush, restart, or raw API calls unless you explicitly asked for that network-impacting change.

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

Error
Location
scripts/mihomo-cli.sh:82
Finding

Bearer Secret Transmitted over Plaintext HTTP to a Configurable Controller

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (24)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/mihomo-cli.sh status

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
89% confidence
Finding

The documented DELETE /connections/:id endpoint allows termination of arbitrary active connections, and the reference does not describe validation, authorization boundaries, or confirmation safeguards around selecting the connection identifier. In an agent context, a user or prompt could steer the tool into closing sensitive or critical sessions, causing denial of service or disrupting security-relevant traffic.

Content

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

md
- `GET /traffic` - WebSocket stream of traffic stats
- `GET /logs?level=debug|info|warning|error` - WebSocket stream of logs
- `GET /connections` - List active connections
- `DELETE /connections/:id` - Close specific connection

### Providers
- `GET /providers/proxies` - List all proxy providers

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs use of a bundled shell script but does not declare any explicit tool scope or permission boundaries. That creates an avoidable trust gap: an agent may invoke shell access for host inspection and Mihomo control without the skill clearly constraining what commands are permitted, increasing the chance of unintended system access or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documents state-changing operations like proxy switching, cache flushing, and restart, but the quick-start command list presents them without a prominent user-facing warning about service interruption or network-impacting side effects. In this context, those actions can disrupt connectivity, change routing unexpectedly, or interrupt active sessions if an agent executes them too eagerly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation prominently includes state-changing endpoints such as restart, proxy switching, cache flushes, and connection termination without warning that these operations alter system state and may disrupt network connectivity. In an agent skill context, this increases the chance an automated assistant will invoke destructive actions without explicit user confirmation or understanding of side effects.

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 98)May include surrounding context.

Switch Group

bash
curl -X PUT -H "Authorization: Bearer $SECRET" \
  -H "Content-Type: application/json" \
  -d '{"name":"Proxy Name"}' \
  http://localhost:9090/proxies/GLOBAL

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script automatically reads the Mihomo API secret from environment variables or the local config file and then uses it for authenticated API calls without any user-facing notice. In an agent-skill context, this silently expands the tool's privilege to perform authenticated local control actions, which can surprise users and enable unauthorized state-changing operations if the skill is invoked indirectly.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

The helper transmits requests, including a bearer token when available, to whatever host is set in MIHOMO_HOST, command-line options, or extracted config, using plain HTTP. In this skill context, that means an agent can send sensitive local configuration-derived credentials and control requests to a non-local or attacker-controlled endpoint if the host is changed or the config is maliciously crafted.

Content

Scanner excerpt · scripts/mihomo-cli.sh (reported line 89)May include surrounding context.

sh
[ -n "$MIHOMO_SECRET" ] && curl_args+=(-H "Authorization: Bearer $MIHOMO_SECRET")

    if [ "$method" = "GET" ]; then
        curl "${curl_args[@]}" "$url"
    else
        curl "${curl_args[@]}" -X "$method" -H "Content-Type: application/json" "$url" ${data:+-d "$data"}
    fi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exposes state-changing operations such as cache flush and service restart with no confirmation, dry-run mode, or warning about impact. In a local agent setting, a simple invocation can disrupt connectivity, alter proxy behavior, or interrupt the Mihomo service unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The API reference shows use of an Authorization bearer secret but provides no guidance on protecting, redacting, or avoiding disclosure of that credential in logs, transcripts, or shell history. In a tool-using agent setting, secrets may be echoed, persisted, or mishandled unless the documentation explicitly warns about secure credential handling.

Content

No source excerpt is available for this finding.