T09 · Insecure Skill Coding Practices
- 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: MediumVulnerable 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}/endpointtext `references/api.md:66-69`: ```bash ### Get version ```bash curl -H "Authorization: Bearer $SECRET" http://host:9090/versiontext ### 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
- Require
https://for every non-loopback Mihomo controller URL and reject plaintext remote URLs by default. - 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. - Update all remote-host examples in
SKILL.mdandreferences/api.mdto use HTTPS:bash MIHOMO_URL="https://mihomo.example.com" curl --fail --silent --show-error \ -H "Authorization: Bearer $MIHOMO_SECRET" \ "$MIHOMO_URL/version" - 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.
- Do not recommend bypassing TLS validation with options such as
curl -kor--insecure. - Restrict controller exposure with host firewalls, private networking, or a VPN, and bind the native controller to loopback where possible.
- 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.
- Prefer scoped process injection or a protected secret store over broadly exported environment variables where the execution environment supports it.
- Require
