T05 · Unauthorized Access and Privilege Escalation
- Location
references/api-guide.md:73- Finding
Unnecessary inbound-message permission violates least privilege
- Content
View full analysis
Vulnerability Details
File Location:
references/api-guide.md, lines 73–77
Vulnerability Type: Excessive application permissions
Risk Level: LowVulnerable Code Snippet
markdown ## 权限要求 发送消息需要飞书应用具备以下权限: - `im.message.send_as_bot` - 发送消息 - `im.message.receive_as_bot` - 接收消息Technical Analysis
The skill's documented purpose and behavior are limited to constructing and sending Feishu Interactive Cards. The
im.message.send_as_botpermission is consistent with that purpose, but the guide also identifiesim.message.receive_as_botas required.Inbound-message access is not necessary for the documented outbound-only functionality. Requesting it expands the application's authorization scope beyond the minimum privileges required for the task. Although the repository contains no code that directly abuses this permission, following the setup instructions would unnecessarily expose incoming message data to the associated Feishu application.
Attack Path
- An administrator follows the skill's API setup guide.
- The administrator grants both the send and receive permissions to the Feishu application.
- The application obtains access to incoming messages despite the skill only requiring outbound delivery.
- If the application, its event-processing environment, or its credentials are later compromised, an attacker may use the excessive permission to access incoming conversation content available to the application.
Impact Assessment
The excessive permission broadens the application's data-access scope to inbound Feishu messages. The practical exposure depends on Feishu tenant configuration, event subscriptions, application installation scope, and platform enforcement. It does not itself grant code execution, persistence, or administrative privileges, but it increases the confidentiality impact of a compromised or misconfigured application.
- Remediation
View remediation
Remediation Suggestions
- Remove
im.message.receive_as_botfrom the documented required permissions when the skill is used solely to send cards. - Document
im.message.send_as_botas the minimum permission for outbound delivery. - If inbound access is required by an undocumented feature or platform constraint, explain that dependency explicitly and separate it from the basic sending setup.
- Restrict event subscriptions, application installation scope, and message processing to the minimum required chats and event types.
- Periodically review granted Feishu permissions and revoke permissions not actively used.
- Avoid logging incoming message content unless necessary, and apply appropriate retention and access controls where processing is required.
- Remove
