T09 · Insecure Skill Coding Practices
- Location
scripts/mihomo-cli.sh:82- Finding
Bearer Secret Transmitted over Plaintext HTTP to a Configurable Controller
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
scripts/mihomo-cli.sh:82Bearer Secret Transmitted over Plaintext HTTP to a Configurable Controller
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
Referenced artifact was not completely inspected
scripts/mihomo-cli.sh status
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.
- `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
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.
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.
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.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X PUT -H "Authorization: Bearer $SECRET" \
-H "Content-Type: application/json" \
-d '{"name":"Proxy Name"}' \
http://localhost:9090/proxies/GLOBAL
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.
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.
[ -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
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.
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.