Back to skill

Security audit

Feishu Bridge

Security checks for vulnerabilities and agentic risk

Overview

This Feishu-to-Clawdbot bridge is coherent, but it exposes a local operator-scoped agent gateway to Feishu users without an allowlist and includes optional always-on macOS persistence.

Review before installing. Use this only for Feishu bots and chats whose members you trust, because reachable Feishu users can prompt the configured Clawdbot agent through your local Gateway identity. Prefer running it interactively first, avoid enabling the LaunchAgent unless you need an always-on bridge, add Feishu tenant/chat/sender allowlists, use minimal agent tools, and avoid sending secrets or regulated data through the bot.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (3)

T06 · System Persistence

Error
Location
setup-service.mjs:29
Finding

Persistent macOS LaunchAgent With Automatic Restart

Content
View full analysis
Label ${LABEL} ProgramArguments ${NODE_PATH} ${BRIDGE_PATH} WorkingDirectory ${WORK_DIR} RunAtLoad KeepAlive ``` ```javascript const outPath = path.join(HOME, 'Library', 'LaunchAgents', `${LABEL}.plist`); fs.mkdirSync(path.dirname(outPath), { recursive: true }); fs.writeFileSync(outPath, plist); console.log(`✅ Wrote: ${outPath}`); console.log(); console.log('To start the service:'); console.log(` launchctl load ${outPath}`); console.log(); console.log('To stop:'); console.log(` launchctl unload ${outPath}`); ``` The Skill documentation instructs users to activate the generated service: ```bash FEISHU_APP_ID=cli_xxx node setup-service.mjs launchctl load ~/Library/LaunchAgents/com.clawdbot.feishu-bridge.plist ``` ### Technical Analysis The setup script writes a user LaunchAgent into `~/Library/LaunchAgents`. The combination of `RunAtLoad` and `KeepAlive` causes the bridge to start automatically when the LaunchAgent is loaded and to be restarted after it terminates. An always-running process is operationally relevant for a messaging bridge, and the behavior is disclosed rather than concealed. However, persistence is not required for the bridge's basic functionality because it can be run interactively with `node bridge.mjs`. The service therefore exceeds the minimum privileges and ...[truncated 1686 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
bridge.mjs:101
Finding

Feishu Senders Can Reach a Gateway Operator Without an Authorization Allowlist

Content
View full analysis
{ try { const { message } = data; const chatId = message?.chat_id; if (!chatId) return; // Dedup if (isDuplicate(message?.message_id)) return; // Only handle text messages if (message?.message_type !== 'text' || !message?.content) return; let text = (JSON.parse(message.content)?.text || '').trim(); if (!text) return; // Group chat: check if we should respond if (message?.chat_type === 'group') { const mentions = Array.isArray(message?.mentions) ? message.mentions : []; text = text.replace(/@_user_\d+\s*/g, '').trim(); if (!text || !shouldRespondInGroup(text, mentions)) return; } const sessionKey = `feishu:${chatId}`; ``` The accepted text is then submitted to the configured agent: ```javascript reply = await askClawdbot({ text, sessionKey }); ``` ### Technical Analysis The code contains no allowlist or authorization decision based on the Feishu sender, tenant, or chat. The group-chat heuristic determines whether a message resembles a request, but it is not an ...[truncated 2393 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
package.json:10
Finding

Dependency Installation Is Not Reproducible or Cryptographically Locked

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (29)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 68)May include surrounding context.

md
quest verbs (帮/请/分析/总结…), or calls the bot by name. Customize the name list in `bridge.mjs` → `shouldRespondInGroup()`.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly says Feishu messages are forwarded through a local bridge to Clawdbot and an AI model, but it does not include a user-facing notice about message retention, third-party processing, or sensitive-data handling. In a chat integration context, this can lead to unintentional disclosure of personal, confidential, or regulated information because users may assume they are only talking to Feishu or the bot directly.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 75)May include surrounding context.

bash
# 创建 secrets 目录
mkdir -p ~/.clawdbot/secrets

# 写入 secret(替换成你自己的)
echo "你的AppSecret" > ~/.clawdbot/secrets/feishu_app_secret

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 75)May include surrounding context.

bash
# 创建 secrets 目录
mkdir -p ~/.clawdbot/secrets

# 写入 secret(替换成你自己的)
echo "你的AppSecret" > ~/.clawdbot/secrets/feishu_app_secret

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 22)May include surrounding context.

md
## Setup

### 1. Create Feishu bot

1. Go to [open.feishu.cn/app](https://open.feishu.cn/app) → Create self-built app → Add **Bot** capability
2. Enable permissions: `im:message`, `im:message.group_at_msg`, `im:message.p2p_msg`

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 81)May include surrounding context.

bash
mkdir -p ~/.clawdbot/secrets
echo "YOUR_APP_SECRET" > ~/.clawdbot/secrets/feishu_app_secret
chmod 600 ~/.clawdbot/secrets/feishu_app_secret

3. Install & run

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 35)May include surrounding context.

bash
mkdir -p ~/.clawdbot/secrets
echo "YOUR_APP_SECRET" > ~/.clawdbot/secrets/feishu_app_secret
chmod 600 ~/.clawdbot/secrets/feishu_app_secret

3. Install & run

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The bridge hard-codes locale: 'zh-CN' in the gateway connect parameters. This is a natural-language/locale policy concern because the skill does not offer user opt-in or any documented reason that the bridge must operate only in Chinese.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 100)May include surrounding context.

md
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 149)May include surrounding context.

md
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 50)May include surrounding context.

md
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 63)May include surrounding context.

md
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 2)May include surrounding context.

js
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 8)May include surrounding context.

js
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 28)May include surrounding context.

js
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 29)May include surrounding context.

js
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 30)May include surrounding context.

js
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 67)May include surrounding context.

js
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 73)May include surrounding context.

js
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 75)May include surrounding context.

js
/**
 * Generate a macOS launchd plist to keep the Feishu bridge running.
 *
 * Usage:
 *   FEISHU_APP_ID=cli_xxx node setup-service.mjs

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 100)May include surrounding context.

md
*   FEISHU_APP_ID=cli_xxx node setup-service.mjs
 *
 * Then:
 *   launchctl load ~/Library/LaunchAgents/com.clawdbot.feishu-bridge.plist
 */

import fs from 'node:fs';

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 50)May include surrounding context.

md
*   FEISHU_APP_ID=cli_xxx node setup-service.mjs
 *
 * Then:
 *   launchctl load ~/Library/LaunchAgents/com.clawdbot.feishu-bridge.plist
 */

import fs from 'node:fs';

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 8)May include surrounding context.

js
*   FEISHU_APP_ID=cli_xxx node setup-service.mjs
 *
 * Then:
 *   launchctl load ~/Library/LaunchAgents/com.clawdbot.feishu-bridge.plist
 */

import fs from 'node:fs';

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 79)May include surrounding context.

js
*   FEISHU_APP_ID=cli_xxx node setup-service.mjs
 *
 * Then:
 *   launchctl load ~/Library/LaunchAgents/com.clawdbot.feishu-bridge.plist
 */

import fs from 'node:fs';

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · setup-service.mjs (reported line 29)May include surrounding context.

js
const SECRET_PATH = process.env.FEISHU_APP_SECRET_PATH || `${HOME}/.clawdbot/secrets/feishu_app_secret`;

const plist = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>

Static analysis

No suspicious patterns detected.