Summary
AVideo does not adequately verify restream ownership when authenticated users with the canStream permission request restream tokens. An attacker may use a token for another user's restream to obtain stream keys and publish unauthorized content to associated YouTube, Twitch, or RTMP destinations.
Affected context
The vulnerability occurs in AVideo deployments where the restream token endpoint does not confirm that the requesting user owns or is authorized to manage the specified restream. It is relevant when a user has the canStream permission and can invoke the restream-token workflow, while stream-key retrieval accepts the resulting token as sufficient authorization.
Exploit preconditions
- Attack surface: AVideo's authenticated restream token and live-key endpoints
- Required access: An authenticated account with the canStream permission
- Trigger point: Requesting a token for a restream identifier that belongs to another user, followed by the token-based stream-key retrieval flow
- Why exploitation is possible: The token-minting operation fails to enforce ownership or equivalent authorization for the selected restream
Why this happens
The underlying bug is an authorization-check failure in an object-specific operation. The application accepts a user-controlled restream reference and issues a capability token without verifying that the requester is permitted to access that particular object. This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because access control is not consistently enforced when a user-controlled identifier selects a protected resource.
Potential impact
- Attackers may retrieve stream keys belonging to other users.
- Attackers could publish unauthorized content to linked YouTube, Twitch, or RTMP destinations.
- Legitimate broadcasts may be disrupted, impersonated, or overwritten.
- Exposed stream keys may enable continued misuse until the affected credentials are rotated.
- The service may experience reputational, operational, or content-moderation impact.
General mitigation guidance
Mitigation generally focuses on enforcing authorization at every resource-sensitive operation rather than trusting possession of a token alone.
Common defensive patterns include:
- Verify restream ownership or an explicit delegated permission before issuing tokens.
- Bind capability tokens to the authorized user, restream, scope, and intended operation.
- Recheck authorization when retrieving stream keys, even if an earlier endpoint issued a token.
- Avoid treating user-supplied object identifiers as authorization evidence.
- Apply least privilege to streaming permissions and separate management from publishing capabilities.
- Rotate exposed stream keys and use secure credential-handling practices when unauthorized access is suspected.
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and review rules that flag resource lookups using user-controlled identifiers without nearby ownership checks.
- Code review of token-minting, capability, and stream-key endpoints for subject, object, and action authorization.
- Integration tests that attempt cross-account access to restreams, tokens, and downstream credentials.
- Runtime monitoring for token requests involving resources outside the caller's ownership or assigned scope.
- Policy enforcement requiring centralized authorization middleware or explicit object-level access-control checks.
- Automated security review tools that model authenticated users attempting horizontal privilege escalation.

