mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 00:56:16 +00:00
HandleTTSSpeak passed the request's `host` straight to client.NewClientFromHost, so the resolved value flowed into the client's baseURL and the outbound request (client.go post -> httpClient.Do) — a caller could point the service at an arbitrary host:8090 (SSRF). resolveTTSHost now always returns an IP looked up from the datastore: match by deviceId, or by host equal to a known device's IP, and return that stored IPAddress (never the caller-supplied string). Unknown hosts/devices are rejected. This both mitigates the SSRF and breaks the tainted data flow. Adds regression cases for unknown host/device. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>