google-home plugin: guessable, non-expiring camera stream tokens allow unauthenticated camera access
Description
When Google Home asks to view a camera, the plugin issues a stream token with
const cameraStreamAuthToken = `tok-${Math.round(Math.random() * 10000).toString(16)}`;
tokens[cameraStreamAuthToken] = device.id;and later accepts that token as the only credential on the public signaling endpoint (/endpoint/@scrypted/google-home/public/signaling/, which is public, so it is reachable without a Scrypted login whenever the server is exposed, for example through Scrypted Cloud or a user's own tunnel or port forward).
Affected: plugins/google-home, src/commands/camerastream.ts (@scrypted/google-home 0.0.61, the latest published version, and current main as of 2026-10-26)
Details
Why this is a vulnerability
- Tiny keyspace. There are only 10,001 possible tokens (about 13 bits), from
Math.random(), which is not a cryptographically secure source. - Tokens never expire. Entries are added to the
tokensmap and never removed, so every camera view adds another valid token for the lifetime of the plugin process. After enough views, a meaningful fraction of the whole keyspace is valid at any time. - The token is the only check.
canAccess(token)returns the camera device for any known token, and the signaling handler then starts an RTC session with it. No Scrypted user, Google identity or per-request secret is involved at that point.
Together, a remote party who can reach the public endpoint can obtain a live camera stream by trying tokens, with no credentials and no interaction from the owner. The cost to the attacker falls as the owner views more cameras. The one precondition is that the owner has viewed a camera through Google Home at least once since the plugin last started; because tokens never expire, that stays true until the next restart.
Suggested fix
Use a CSPRNG token with real entropy, and expire it:
import { randomUUID } from 'crypto';
const cameraStreamAuthToken = `tok-${randomUUID()}`;
tokens[cameraStreamAuthToken] = device.id;
setTimeout(() => delete tokens[cameraStreamAuthToken], 10 * 60 * 1000);I have run this change (as a local patch to the built plugin) since 2026-10-04 (three weeks) with the Google Home app and a Nest Hub: viewing starts normally, tokens are 128-bit, and expired tokens are rejected. A token only needs to live long enough for Google to send its offer, but a longer expiry (for example one hour) is also safe with a 128-bit token if renegotiation needs it.
Defense in depth worth considering: bind a token to a single use, and rate-limit the signaling endpoint.
Timeline
Found while reviewing the plugin's public endpoints, 2026-10-04. Rechecked against main 2026-10-26: unchanged. No disclosure beyond this report.
Proof of concept
Requesting 300 tokens through the normal authenticated GetCameraStream command returned 292 unique values and 8 repeats (about 4.5 expected for a 10,000-value pool), and every token was tok- followed by at most 4 hex digits (8 characters or fewer). I did not attempt to guess tokens against any endpoint.
Impact
Unauthorized live video (and audio, where the camera provides it) from any camera exposed to Google Home, including doorbells, for any Scrypted server whose public endpoints are reachable from the internet.