T05 · Unauthorized Access and Privilege Escalation
- Location
index.js:128- Finding
New Feishu bot accounts default to unrestricted direct-message access
- Content
View full analysis
Vulnerability Details
File Location:
index.js:128-133
Vulnerability Type: Insecure access-control defaults
Risk Level: HighVulnerable Code
js config.channels.feishu.accounts[accountId] = { appId: appid, appSecret: appsecret, botName: botname || 'Feishu Bot', dmPolicy: options.dmpolicy || 'open', allowFrom: ['*'], enabled: true };Technical Analysis
Every newly created Feishu account defaults to
dmPolicy: 'open'and receives the wildcard authorization settingallowFrom: ['*']. This is a fail-open configuration that does not follow least-privilege principles.Although the command accepts a
--dm-policyoption, the allowlist remains['*']regardless of the selected policy. The implementation also does not require the operator to confirm the security implications of unrestricted access or provide trusted Feishu user identifiers.The account may subsequently be bound to an Agent:
js if (mode === 'account' && agentid) { config.bindings.push({ agentId: agentid, match: { channel: 'feishu', accountId: accountId } }); }Consequently, an externally reachable bot can pass messages from untrusted Feishu users to the selected Agent.
Attack Path
- An operator runs the Skill without explicitly supplying a restrictive DM policy.
- The Skill creates the account with
dmPolicy: 'open'andallowFrom: ['*']. - The operator binds the account to an Agent and the Skill restarts the Gateway.
- An untrusted user discovers or otherwise reaches the Feishu bot.
- The user sends direct messages containing requests or prompt-injection content.
- The open policy permits the messages to reach the bound Agent.
- The attacker can exercise whatever conversational functions, tools, or data access that Agent exposes, subject to the Agent's own permissions and safeguards.
Impact Assessment
The immed ...[truncated 417 chars]
- Remediation
View remediation
Remediation Suggestions
-
Change the default DM policy from
opentopairingor a deny-by-default allowlist. -
Do not assign
allowFrom: ['*']automatically. Require explicit trusted Feishu user IDs whenallowlistis selected. -
Reject unsupported policy values and apply the existing validation module during configuration creation.
-
Require a clear, explicit high-risk confirmation before allowing the combination of
dmPolicy: 'open'and wildcard access. -
Generate policy-specific configuration, for example:
js const allowedPolicies = new Set(['pairing', 'allowlist', 'open']); const dmPolicy = options.dmpolicy || 'pairing'; if (!allowedPolicies.has(dmPolicy)) { throw new Error('Unsupported DM policy'); } if (dmPolicy === 'allowlist' && trustedUsers.length === 0) { throw new Error('At least one trusted user is required'); } const account = { appId: appid, appSecret: appsecret, botName: botname || 'Feishu Bot', dmPolicy, enabled: true }; if (dmPolicy === 'allowlist') { account.allowFrom = trustedUsers; } -
Validate the final configuration before writing it and abort safely if its access policy is inconsistent.
-
