Back to skill

Security audit

Feishu Integration (Lukaizj)

Security checks for vulnerabilities and agentic risk

Overview

This Feishu messaging skill mostly matches its purpose, but it unnecessarily exposes part of an access token and asks for broader permissions than its implemented features need.

Install only if you are comfortable giving the skill access to a Feishu app that can send messages and create/list chats. Use the narrowest Feishu permissions possible, avoid sending secrets or sensitive content through the tool, and remove or avoid exposing the feishu_get_token capability before production use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
feishu.py:267
Finding

Agent-Callable Tool Exposes a Tenant Access Token Fragment

Content
View full analysis
Dict[str, Any]: """ Get Feishu tenant access token. Returns: Dictionary with token info """ client = _get_client() if not client: return {"success": False, "error": "Feishu not configured"} token = client.get_token(force_refresh=True) if token: return {"success": True, "token": token[:20] + "..."} else: return {"success": False, "error": "Failed to get token"} ``` The function is registered as an Agent-callable tool at lines 325-328: ```python { "name": "feishu_get_token", "description": "Get Feishu tenant access token" } ``` ### Technical Analysis Tenant access-token retrieval is an internal authentication operation. It is not necessary for an Agent to directly access token material to send messages, create chats, or list chats because those operations already acquire and apply the token internally. The function forces a token refresh and returns the first 20 characters of the live token. Although the token is truncated, the returned value is still credential material and may be retained in Agent context, execution traces, telemetry, application logs, or user-visible output. Truncation reduces the likelihood of immediate account compromise but does not make disclosure safe. Exposing authentication internals also violates least privilege by allowing arbitrary tool callers to trigger credential operations unrelated to the declared end-user functionality. ### Attack Path 1. Untrusted content or a user request causes the Agent to invoke `feishu_get_token`. 2. The tool calls `get_token(force_refresh=True)`. 3. The client transmits the configured application credentials to Feishu and obtains a live tenant access token. 4. The f ...[truncated 846 chars]
Remediation
View remediation
Dict[str, Any]: client = _get_client() if not client: return { "success": False, "configured": False, "token_valid": False } token = client.get_token() return { "success": bool(token), "configured": True, "token_valid": bool(token) } ``` 6. Ensure logs and telemetry redact authorization headers, application secrets, and token values. 7. Avoid forced token refreshes unless an actual API operation requires a refreshed token. ]]>

T05 · Unauthorized Access and Privilege Escalation

Note
Location
SKILL.md:29
Finding

Documentation Requests Feishu Permissions Beyond Implemented Functionality

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The metadata describes messaging, group management, and workflow automation, but the analysis indicates token retrieval capability is exposed without being clearly declared and that some advertised workflow behavior is not implemented. Mismatches between description and actual behavior are dangerous because they mislead reviewers and users about what the skill can do, especially when credentials and external API access are involved.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
- `im:chat:create`
   - `im:chat:update`
   - `im:message:p2p_msg:send`
4. Publish the app and get the Tenant Access Token
5. Configure environment variables

## Environment Variables

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · claw.json (reported line 17)May include surrounding context.

json
"properties": {
            "chat_id": {
              "type": "string",
              "description": "The chat ID to send message to"
            },
            "message": {
              "type": "string",

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · feishu.py (reported line 229)May include surrounding context.

python
"properties": {
            "chat_id": {
              "type": "string",
              "description": "The chat ID to send message to"
            },
            "message": {
              "type": "string",

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · feishu.py (reported line 314)May include surrounding context.

python
"properties": {
            "chat_id": {
              "type": "string",
              "description": "The chat ID to send message to"
            },
            "message": {
              "type": "string",

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · feishu.py (reported line 5)May include surrounding context.

python
Feishu (飞书) Integration Skill for OpenClaw

Provides capabilities to:
- Send messages to Feishu chats
- Create group chats
- List accessible chats
- Manage feishu workflows

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · feishu.py (reported line 97)May include surrounding context.

python
return None

    def send_message(self, chat_id: str, message: str, msg_type: str = "text") -> Dict[str, Any]:
        """Send message to a chat"""
        token = self.get_token()
        if not token:
            return {"success": False, "error": "Failed to get access token"}

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

This function explicitly exposes access-token retrieval as a tool capability. Providing callers with direct access to authentication artifacts, even partially masked, materially increases the risk of credential leakage, abuse of connected Feishu resources, and future expansion into full token disclosure.

Content

Scanner excerpt · feishu.py (reported line 290)May include surrounding context.

python
async def feishu_get_token() -> Dict[str, Any]:
    """
    Get Feishu tenant access token.

    Returns:
        Dictionary with token info

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

Registering feishu_get_token in the TOOLS list makes credential access directly invocable by the agent/tooling layer. This is inconsistent with least privilege and turns internal authentication into a user-accessible primitive that can facilitate credential abuse.

Content

Scanner excerpt · feishu.py (reported line 339)May include surrounding context.

python
},
    {
        "name": "feishu_get_token",
        "description": "Get Feishu tenant access token"
    }
]

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · claw.json (reported line 63)May include surrounding context.

json
List all accessible Feishu chats for the authenticated app.

### feishu_get_token
Get the Feishu tenant access token for API calls.

## Configuration

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · feishu.py (reported line 59)May include surrounding context.

python
List all accessible Feishu chats for the authenticated app.

### feishu_get_token
Get the Feishu tenant access token for API calls.

## Configuration

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · feishu.py (reported line 100)May include surrounding context.

python
List all accessible Feishu chats for the authenticated app.

### feishu_get_token
Get the Feishu tenant access token for API calls.

## Configuration

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · feishu.py (reported line 148)May include surrounding context.

python
List all accessible Feishu chats for the authenticated app.

### feishu_get_token
Get the Feishu tenant access token for API calls.

## Configuration

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · feishu.py (reported line 183)May include surrounding context.

python
List all accessible Feishu chats for the authenticated app.

### feishu_get_token
Get the Feishu tenant access token for API calls.

## Configuration

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · instructions.md (reported line 19)May include surrounding context.

md
List all accessible Feishu chats for the authenticated app.

### feishu_get_token
Get the Feishu tenant access token for API calls.

## Configuration

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README presents the skill description and usage entirely in Chinese, which can amount to a language policy violation when no user opt-in or alternative language is offered. The policy allows locale constraints only when explicitly offered as a choice or clearly documented as justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file describes capabilities to send messages and list chat records, which can affect user data and privacy, but it provides no user-facing warning about accessing or transmitting conversation data. Under the markdown-specific SQP-2 criteria, skills that may impact privacy or user data should disclose those behaviors.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares required environment variables and clearly describes networked messaging behavior, but it does not declare an explicit tool scope such as allowed tools or permissions. That weakens sandboxing and review because operators cannot easily verify that network and secret access are intentionally constrained to Feishu-related actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill encourages sending messages and webhook notifications but does not warn users that prompt content, chat text, or other user-supplied data may be transmitted to Feishu. This creates a real data-leakage risk because users may provide sensitive information without understanding it will leave the local system and be stored or processed by a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest advertises the ability to send messages to Feishu chats but does not warn users that provided content may be transmitted to an external third-party messaging platform. This creates a real risk of unintended disclosure of sensitive prompts, internal data, or personal information when the skill is invoked in normal agent workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest declares sensitive credentials such as FEISHU_APP_SECRET without any handling, storage, rotation, or disclosure guidance. In an agent skill, omission of credential-handling expectations increases the chance of insecure deployment, accidental logging, or misuse of the connected Feishu tenant.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · feishu.py (reported line 77)May include surrounding context.

python
}

        try:
            response = requests.post(
                f"{AUTH_URL}/access_token",
                headers=headers,
                json={"grant_type": "client_credentials", "app_id": self.app_id, "app_secret": self.app_secret},

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This request sends arbitrary message content to Feishu. The network transmission itself is expected for the integration, but in an agent/tool setting it becomes a real security issue because there is no consent gate or data-sensitivity check before externalizing potentially sensitive content.

Content

Scanner excerpt · feishu.py (reported line 129)May include surrounding context.

python
}

        try:
            response = requests.post(
                f"{MESSAGE_URL}/messages?receive_id_type=chat_id",
                headers=headers,
                json={"receive_id": chat_id, **msg_body},

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

This request changes external state by creating chats in Feishu. Although consistent with the feature set, it is security-relevant because the action affects an external account and can be triggered without a built-in confirmation step or guardrails.

Content

Scanner excerpt · feishu.py (reported line 164)May include surrounding context.

python
}

        try:
            response = requests.post(
                CHAT_URL,
                headers=headers,
                json=chat_data,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The message-sending tool transmits arbitrary user-provided content to Feishu, an external service, without any built-in disclosure or confirmation mechanism. In an agent setting this raises data-loss risk because sensitive prompts, summaries, or secrets could be sent off-platform without the user's informed awareness.

Content

No source excerpt is available for this finding.