T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:64
- Finding
- Excessive Feishu Permissions Violate Least-Privilege Principles## Vulnerability Details **File Location**: `SKILL.md`, lines 64-94 **Vulnerability Type**: Excessive cloud API permissions **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ### 云盘 Drive | 权限 scope | 说明 | |-----------|------| | `drive:drive` | 云盘能力总览 | | `drive:file` | 文件基础操作 | | `drive:file:readonly` | 只读文件 | | `drive:file:download` | 下载文件 | | `drive:drive:readonly` | 只读云盘元信息 | ### 文档 Docx | 权限 scope | 说明 | |-----------|------| | `docx:document` | 文档基础能力 | | `docx:document:readonly` | 只读文档内容 | | `docx:document:write_only` | 写入文档 | ### 表格 Sheets | 权限 scope | 说明 | |-----------|------| | `sheets:spreadsheet` | 表格基础能力 | | `sheets:spreadsheet:read` | 读取表格 | ### 多维表格 Bitable | 权限 scope | 说明 | |-----------|------| | `bitable:app` | 多维表格应用 | | `bitable:app:readonly` | 只读多维表格 | ### 知识库 Wiki | 权限 scope | 说明 | |-----------|------| | `wiki:wiki` | 知识库基础 | | `wiki:node:read` | 读取知识库节点 | ``` ### Technical Analysis The documented workflow obtains a tenant access token, downloads a requested file, and parses its content. That read-oriented workflow does not require write access or broad base scopes for every Feishu service. The permissions list nevertheless includes broad scopes such as `drive:drive`, `drive:file`, `docx:document`, `docx:document:write_only`, `sheets:spreadsheet`, `bitable:app`, and `wiki:wiki`. The document labels the section as required permissions and does not distinguish mandatory read-only scopes from optional scopes. In particular, `docx:document:write_only` is inconsistent with the stated file-reading workflow. This expands the authority available to the skill and increases the consequences of token disclosure, agent compromise, or accidental misuse. ### Attack Path 1. A user follows the skill's required-permissions section and grants the listed broad and write-capable scopes. 2. The skill exchanges the Feishu application credentials for a t ...[truncated 1024 chars]
- Remediation
- ## Remediation Suggestions - Replace broad scopes with the smallest read-only scope set needed for the documented workflow. - Use `drive:file:readonly` and `drive:file:download` where sufficient. - Request format-specific read scopes only when the corresponding file type or service is used. - Remove `docx:document:write_only` from the default permission list. - Clearly separate mandatory scopes from optional capabilities. - Require explicit user authorization before enabling any write operation. - Validate the granted scope set at runtime and reject unexpected write or administrative permissions. - Use separate Feishu applications or credentials for read-only and write-capable workflows to limit compromise impact.
