Summary
The DreameHome cloud API issued Agora RTC tokens for a device without verifying that the authenticated user owned it. An authenticated attacker who can supply another device's DID and owner UID may obtain a token to join its live-video channel and publish video under the device's identity.
Affected context
The issue was in the DreameHome cloud API's POST /dreame-user-iot/token/rtc2 endpoint. It becomes a risk when the endpoint accepts a device DID and owner UID but does not verify that the authenticated user is authorized to access that device before issuing an Agora RTC token.
Exploit preconditions
- Attack surface: The DreameHome cloud API endpoint that issues RTC tokens
- Required access: An authenticated account; the described issue does not require ownership of the targeted device
- Trigger point: A request to the RTC token endpoint containing a target device DID and owner UID
- Why exploitation is possible: The endpoint issues a token without confirming the authenticated user's ownership or authorization for the specified device
Why this happens
The endpoint relied on caller-supplied object identifiers without enforcing authorization against the referenced device. This is an insecure direct object reference, mapped to CWE-639: Authorization Bypass Through User-Controlled Key. Authentication alone does not establish permission to access every device identified by a request.
Potential impact
- An attacker may obtain an RTC token for another user's device.
- The token could allow access to the device's live-video channel.
- An attacker could publish video under the targeted device's identity.
- The incident could undermine user privacy and trust in device identity.
General mitigation guidance
Defensive designs commonly bind token issuance to an authorization check performed server-side for the authenticated user and the requested device. Avoid treating caller-supplied identifiers as proof of ownership; derive identity from trusted session context where possible and enforce access control for each referenced object.
RTC tokens can also be narrowly scoped to the intended device and channel, limited in duration and permitted actions, and issued by services operating with least privilege. These controls can reduce exposure if an authorization check is missed.
How teams detect issues like this
Review token-issuance code for authorization checks that bind the authenticated principal to every requested device or channel. Look for endpoints that accept object identifiers from clients and rely on authentication, identifier secrecy, or client-side checks instead of server-side object-level authorization.
Monitoring and policy checks can flag token requests where the authenticated account is not authorized for the referenced device, as well as unusual token issuance or channel access patterns. Automated code review tools may help identify missing object-level access checks.

