Back to skill

Security audit

Mihomo 排障与修复

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious with high confidence because it reports credential exposure, unsafe diagnostic behavior, and several actions that exceed their stated scope; some files were only partially analyzed.

Given the suspicious verdict, consider not installing until the credential transport, unexpected network activity, local secret discovery, and temporary-file behavior have been reviewed or corrected. The scan is incomplete for three scripts, so these results do not establish that the unreviewed portions are safe.

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
scripts/probe_sub.py
Finding

Subscription credentials are transmitted over unauthenticated TLS

Content
View full analysis

Impact

The attacker can capture the subscription bearer token and forge diagnostic responses. The playbook additionally recommends using content obtained by the no-SNI method to select a bootstrap node, creating a downstream configuration-integrity risk.

T09 · Insecure Skill Coding Practices

Warning
Location
assets/config-template.yaml
Finding

The repair template exposes unauthenticated proxy listeners to reachable network peers

Content
View full analysis

Impact

Unauthorized peers can consume subscription bandwidth and relay traffic through the user's host or proxy account. Direct-routing rules can also expose destinations reachable from that host.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (27)

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/find_config.sh # 本机

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/find_config.sh --ssh root@10.0.0.2 # 远程主机 / 软路由 / VPS

Incomplete referenced artifact analysis

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
bash scripts/find_config.sh --docker mihomo # 配置在容器里(可叠加 --ssh)

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/find_config.sh --unc # 绿联 NAS(unc CLI 已登录)

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `scripts/find_config.sh` | 每次开工第一步:判形态、定位配置、发现控制接口 |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
并在末尾打印可直接复制的 `diagnose.sh` / `apply_config.sh` 命令。

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/apply_config.sh --new /tmp/new.yaml \

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/apply_config.sh ... --dry-run

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/apply_config.sh --rollback 'config.yaml.bak-YYYYMMDD-HHMMSS' \

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `scripts/apply_config.sh` | 改配置统一入口;含备份、SHA 复核、热重载、回滚 |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
并在末尾打印可直接复制的 `diagnose.sh` / `apply_config.sh` 命令。

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/diagnose.sh --api http://<host>:9090 --secret '<secret>'

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/diagnose.sh --api ... --secret ...

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `scripts/diagnose.sh` | 定位与复检;自动识别代理端口,含直连 vs 代理对照 |

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The template claims subscription updates use a proxy, but both providers explicitly fetch subscriptions directly.

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

The design statement at L005 says subscription updates go through a proxy, but L028 and L040 configure both providers with proxy: DIRECT. Consequently, the default template cannot bypass subscription-domain SNI blocking as that statement implies; the optional bootstrap instructions at L047–L066 require additional configuration before proxied fetching actually occurs.

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/platform-access.md (reported line 118)May include surrounding context.

热重载(优先,不中断现有连接)

bash
curl -s -X PUT -H 'Authorization: Bearer <secret>' -H 'Content-Type: application/json' \
  -d '{"path": "/root/.config/mihomo/config.yaml"}' http://127.0.0.1:9090/configs

Remote API instructions transmit the controller secret over plain HTTP without a credential-exposure warning.

Medium
Category
Output Handling
Confidence
98% confidence
Finding

The remote-controller examples send a reusable bearer secret over plain HTTP. A network observer or active intermediary can capture that secret and use the controller's management capabilities; a private LAN does not guarantee confidentiality.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
98% confidence
Finding

Contacting the user's controller is legitimate, but these requests transmit its bearer credential to a potentially remote host over unencrypted HTTP. This is the same transport exposure identified by SQP-2, not evidence of an attacker-controlled exfiltration endpoint.

Content

Scanner excerpt · references/platform-access.md (reported line 174)May include surrounding context.

bash
S='<secret>'; H='http://<host>:9090'
curl -s --noproxy '*' -H "Authorization: Bearer $S" $H/version
curl -s --noproxy '*' -H "Authorization: Bearer $S" $H/configs          # 端口/模式/tun
curl -s --noproxy '*' -H "Authorization: Bearer $S" $H/proxies          # 策略组与 now
curl -s --noproxy '*' -H "Authorization: Bearer $S" $H/providers/proxies

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

Rollback can send the controller bearer secret to a remote plain-HTTP API without checking transport security. The destination is user-selected rather than a hardcoded exfiltration server, but interception can still expose a reusable management credential.

Content

Scanner excerpt · scripts/apply_config.sh (reported line 142)May include surrounding context.

sh
hr; echo "[重启] $RESTART"
  case "$RESTART" in
    none) say "跳过" ;;
    api)  run_or_show "$CURL -s -X PUT -H 'Content-Type: application/json' ${SECRET:+-H 'Authorization: Bearer $SECRET'} -d '{\"path\": \"$COREPATH\"}' '$API/configs'" ;;
    unc|docker|auto) run_or_show restart_target ;;
    *) run_or_show "$RESTART" ;;
  esac

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The normal reload path accepts remote HTTP URLs and attaches the controller bearer secret without requiring encrypted transport. Although the request is an intended management operation, network interception can disclose the secret and enable unauthorized controller access.

Content

Scanner excerpt · scripts/apply_config.sh (reported line 254)May include surrounding context.

sh
[ -n "$API" ] || die "--restart api 需要 --api http://host:9090" 2
    if [ "$DRYRUN" = 1 ]; then echo "  [dry-run] PUT $API/configs {\"path\":\"$COREPATH\"}"
    else
      code=$($CURL -s -o /tmp/_mh_reload.txt -w '%{http_code}' -m 20 -X PUT \
        -H 'Content-Type: application/json' ${SECRET:+-H "Authorization: Bearer $SECRET"} \
        -d "{\"path\": \"$COREPATH\"}" "$API/configs")
      say "热重载 HTTP=$code $(head -c 120 /tmp/_mh_reload.txt)"

Diagnostic API responses are saved to local files without disclosing that persistence.

Medium
Category
Output Handling
Confidence
97% confidence
Finding

Controller responses containing configuration and proxy inventory are retained in predictable /tmp files without restrictive permissions or cleanup. Depending on the umask and platform protections, other local users can read diagnostic data or exploit precreated paths to redirect writes; the responses need not contain the controller secret for this to be a concern.

Content

No source excerpt is available for this finding.

The documented --skip-external option still performs external network probes, including public-IP lookups.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The advertised structure-only option still contacts public websites and IP-discovery services, including through a direct connection. This defeats an explicit no-external-probes choice and can disclose the host's real public IP and diagnostic activity when the user expects no public-network traffic.

Content

No source excerpt is available for this finding.

The documented API-only option still performs local discovery and prints local controller credentials.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The documented API-only option merely adds an API candidate and does not stop local configuration discovery. It can consequently read and print an unrelated local controller secret into agent transcripts or captured output, exceeding the user's requested diagnostic scope.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/probe_sub.py (reported line 51)May include surrounding context.

python
cmd.append("@" + server)
    cmd.append(host)
    try:
        out = subprocess.run(cmd, capture_output=True, text=True, timeout=8).stdout
    except Exception:
        return []
    ips = []