T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/scaffold.py:250- Finding
Unauthenticated Privileged API Permits Arbitrary TRTC Credential Issuance and Conversation Control
- Content
View full analysis
dict: user_id = data.get("userid") if not user_id: raise ValueError("userid is required") sigs = signer.sign_trio(user_id) avatar_enabled = config.is_avatar_enabled() return { "sdkappid": sigs["sdkappid"], "userid": sigs["user_id"], "usersig": sigs["user_sig"], "robot_userid": sigs["robot_user_id"], "robot_usersig": sigs["robot_user_sig"], "avatar_userid": sigs["avatar_user_id"] if avatar_enabled else "", "avatar_usersig": sigs["avatar_user_sig"] if avatar_enabled else "", "avatar_available": avatar_enabled, "end_keywords": config.all_end_keywords(), "farewell_message": { "zh": config.farewell_message("zh"), "yue": config.farewell_message("yue"), "en": config.farewell_message("en"), }, "transfer_keywords": config.all_transfer_keywords(), "transfer_message": { "zh": config.transfer_message("zh"), "yue": config.transfer_message("yue"), "en": config.transfer_message("en"), }, } ``` ```python def handle_start_ai_conversation(body: dict) -> dict: lang = body.get("AgentConfig", {}).get("Lang", "zh") use_avatar = bool(body.get("UseAvatar", False)) and config.is_avatar_enabled() # ... agent_cfg = { "UserId": body["AgentConfig"]["UserId"], "UserSig": body["AgentConfig"]["UserSig"], "TargetUserId": body["AgentConfig"]["TargetUserId"], "MaxIdleTime": 60, "WelcomeMessage": welcome, "WelcomeMessagePriority": 0, "TurnDetectionMode": 3, "TurnDetection": {"SemanticEagerness": "auto"}, "Filt ...[truncated 4489 chars]- Remediation
View remediation
