T05 · Unauthorized Access and Privilege Escalation
- Location
skill.py:835- Finding
Sensitive Write Operations Lack Enforced Authorization and Confirmation
- Content
View full analysis
str: body = { "account": account, "password": password, "name": name, "tenantId": tenant_id, "isForEncryptionPhones": is_for_encryption, } endpoint = "/AiSpeech/admin/addMainUser" try: result = _baize_post(endpoint, body) if str(result.get("code")) == "2000": return f"主账号 [{account}]({name})已成功创建,所属商户ID:{tenant_id}。" return f"创建主账号失败:{result.get('msg', '未知错误')}" except Exception as exc: return f"创建主账号时发生错误:{exc}" ``` The documented confirmation requirement is present only in the Skill instructions: ```markdown - 执行**启动/暂停/恢复任务**、**切换线路**、**调整并发**、**新建账号**等**写操作**前, 必须先向用户展示操作详情,等待确认后再执行。 ``` ### Technical Analysis The Skill documentation states that write operations require prior user confirmation and that creation of a main account is restricted to administrators. These requirements are not enforced by the implementation. The `ctx` parameter is accepted but never inspected to establish the caller's identity, role, tenant, or authorization. The function immediately constructs an administrative request using caller-supplied values and sends it through `_baize_post`. There is no confirmation token, operation-bound approval record, role check, tenant ownership check, or validation that the requested tenant and role identifiers belong to the authenticated caller. The same design is used by other mutating operations, including starting, stopping, a ...[truncated 2036 chars]- Remediation
View remediation
