T09 · Insecure Skill Coding Practices
- Location
SKILL.md:23- Finding
Home Assistant Bearer Token Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 23 and 38-51
Vulnerability Type: Plaintext transmission of sensitive authentication credentials
Risk Level: HighThe documented Home Assistant configuration uses an unencrypted HTTP endpoint:
json "home_assistant": { "url": "http://homeassistant.local:8123", "token_env": "HA_TOKEN" }The API examples send the Home Assistant bearer token to that endpoint:
bash # Light control curl -s -X POST "$HA_URL/api/services/light/turn_on" \ -H "Authorization: Bearer $HA_TOKEN" \ -H "Content-Type: application/json" \ -d '{"entity_id": "light.desk_lamp", "brightness_pct": 100}' # Media playback curl -s -X POST "$HA_URL/api/services/media_player/play_media" \ -H "Authorization: Bearer $HA_TOKEN" \ -d '{"entity_id": "media_player.speaker", "media_content_id": "spotify:playlist:xxx", "media_content_type": "playlist"}' # Wake-on-LAN curl -s -X POST "$HA_URL/api/services/wake_on_lan/send_magic_packet" \ -H "Authorization: Bearer $HA_TOKEN" \ -d '{"mac": "XX:XX:XX:XX:XX:XX"}'Technical Analysis
HTTP does not provide transport encryption, server authentication, or integrity protection. When the documented
http://homeassistant.local:8123endpoint is used, theAuthorization: Bearer $HA_TOKENheader is transmitted in plaintext.An attacker with visibility into or control over the relevant network path could inspect requests, recover the bearer token, or modify service requests in transit. Because bearer tokens grant access based on possession, an intercepted token can be replayed without knowledge of another secret. The resulting access is limited by the Home Assistant permissions associated with that token.
Attack Path
- A user configures the Skill using the documented plaintext Home Assistant URL.
- The Skill invokes a Home Assistant service and includes
Authorization: Bearer $HA_TOKEN. - A network-po ...[truncated 1038 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the documented HTTP endpoint with an HTTPS endpoint protected by a valid TLS certificate.
- Verify TLS certificates and hostnames; do not use options that disable certificate validation.
- Validate
HA_URLbefore sending credentials and reject plaintext HTTP endpoints by default. - If plaintext HTTP must be supported for isolated development, restrict it to an explicit opt-in mode and preferably to loopback-only communication.
- Create a dedicated Home Assistant credential with only the minimum permissions required for the supported device operations.
- Ensure command output, debugging logs, and error messages never record the bearer token or complete authorization header.
- Revoke and rotate any token that may previously have been transmitted across an untrusted network.
- Consider network segmentation and firewall rules that restrict Home Assistant API access to trusted clients.
