T09 · Insecure Skill Coding Practices
- Location
SKILL.md:81- Finding
Home Assistant bearer token may be transmitted over plaintext HTTP or to an untrusted endpoint
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:72-82,SKILL.md:110-112,SKILL.md:225-228,test.sh:54-75
Vulnerability Type: Plaintext credential transmission and insufficient endpoint validation
Risk Level: HighVulnerable Code
SKILL.md:81-82configures a plaintext HTTP endpoint:bash openclaw config set 'skills."xiaomi-home-ha".env.HA_URL' "http://192.168.31.202:8123" openclaw config set 'skills."xiaomi-home-ha".env.HA_TOKEN' "eyJhbGc..."SKILL.md:110-112sends the long-lived token to that configured endpoint:bash curl -sf "${HA_URL}/api/" \ -H "Authorization: Bearer ${HA_TOKEN}"SKILL.md:225-228similarly sends the token during privileged service calls:bash curl -sf -X POST "${HA_URL}/api/services/${DOMAIN}/${SERVICE}" \ -H "Authorization: Bearer ${HA_TOKEN}" \ -H "Content-Type: application/json" \ -d "$(jq -n \test.sh:54-75accepts an unrestricted URL and attaches the bearer token to every helper request:bash : "${HA_URL:?'HA_URL is required. Export it before running.'}" : "${HA_TOKEN:?'HA_TOKEN is required. Export it before running.'}" pass "HA_URL set: ${HA_URL}" pass "HA_TOKEN set (${#HA_TOKEN} chars)" ha_get() { curl -sf "${HA_URL}$1" \ -H "Authorization: Bearer ${HA_TOKEN}" \ -H "Content-Type: application/json" } ha_post() { curl -sf -X POST "${HA_URL}$1" \ -H "Authorization: Bearer ${HA_TOKEN}" \ -H "Content-Type: application/json" \ -d "$2" } ha_status() { curl -s -o /dev/null -w "%{http_code}" "${HA_URL}$1" \ -H "Authorization: Bearer ${HA_TOKEN}" }Technical Analysis
The documented configuration explicitly uses an unencrypted
http://URL while the requests include a reusable Home Assistant long-lived access token in theAuthorizationheader. Plain HTTP does not provide confidentiality or server authentication. A network observer or active m ...[truncated 2056 chars]- Remediation
View remediation
Remediation Suggestions
- Require an
https://Home Assistant URL for non-loopback connections and reject plaintext HTTP before sending the token. - Permit HTTP only for explicit loopback testing, such as
127.0.0.1orlocalhost, and never as the primary production example. - Validate
HA_URLusing a strict URL parser. Allow only expected schemes, ports, and configured hostnames or IP addresses. - Preserve TLS certificate verification and do not recommend
curl -kor--insecure. - Use a trusted certificate for local Home Assistant deployments, or place Home Assistant behind a properly configured TLS reverse proxy.
- Use a dedicated Home Assistant account with the minimum practical permissions rather than an administrator's token.
- Avoid asking users to disclose tokens in chat. Direct them to configure secrets through a protected local interface or environment file with restrictive permissions.
- Add a preflight check to
test.shthat terminates before any request if the endpoint is insecure or outside an explicit allowlist. - Rotate any token that may already have traversed an untrusted plaintext network.
- Require an
