Back to skill

Security audit

Feishu SuperToolkit

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real Feishu automation toolkit, but it exposes powerful Feishu actions and local file sending with weak safeguards and includes a real-looking app secret in the documentation.

Do not install or run this as-is in a real Feishu tenant. First rotate or prove inactive the published Feishu secret, replace it with placeholders, add authentication and authorization to every route, restrict local file sending to an approved upload flow or safe directory, limit recipients and Feishu app scopes, and require explicit confirmation for approval, calendar deletion, and table-write operations.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:80
Finding

Feishu Application Secret Exposed in Documentation

Content
View full analysis
Remediation
View remediation
" export FEISHU_APP_SECRET="" ``` 4. Store production secrets in a dedicated secret manager or protected runtime environment, not source files, examples, logs, or documentation. 5. Ensure `.env` and other credential files are excluded from version control and are readable only by the service account. 6. Apply the minimum Feishu permissions required for the enabled modules. Separate high-impact approval, contacts, and attendance capabilities into different applications where practical. 7. Establish automatic secret scanning in the development and release pipeline. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server/feishu_supertoolkit/main.py:29
Finding

Privileged Feishu Operations Exposed Without Caller Authentication or Authorization

Content
View full analysis
dict: payload = { "approval_code": req.approval_code, "instance_code": req.instance_code, "task_id": req.task_id, "user_id": req.open_id, # 结合 user_id_type=open_id } if req.comment: payload["comment"] = req.comment if req.form: payload["form"] = req.form feishu_request( "POST", "/open-apis/approval/v4/tasks/approve", params={"user_id_type": "open_id"}, json_body=payload, ) return {"success": True, "task_id": req.task_id, "instance_code": req.instance_code} ``` ### Technical Analysis The FastAPI application do ...[truncated 2908 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server/feishu_supertoolkit/messaging_api.py:96
Finding

Unauthenticated Arbitrary Local-File Disclosure Through the File-Sending Endpoint

Content
View full analysis
dict: """发送文件到飞书(支持图片、音频、视频、文档) - 图片:直接预览 - 音频:自动转换为 OPUS,使用内嵌播放器卡片 - 视频:文件卡片(大视频自动截取封面) - 其他:文件卡片 """ import requests from requests_toolbelt import MultipartEncoder file_path = req.file_path if not os.path.exists(file_path): raise Exception(f"文件不存在:{file_path}") # 检测文件类型 file_type = detect_file_type(file_path) # 获取访问令牌 app_id = os.getenv("FEISHU_APP_ID") app_secret = os.getenv("FEISHU_APP_SECRET") token = get_tenant_access_token(app_id, app_secret) headers = {"Authorization": f"Bearer {token}"} # 上传文件 with open(file_path, "rb") as f: file_name = os.path.basename(file_path) ``` For ordinary files, the selected path is subsequently reopened and uploaded to Feishu: ```python else: upload_path = file_path upload_type = "file" duration = 0 # 上传到飞书 with open(upload_path, "rb") as f: form = MultipartEncoder( fields={ "file_type": upload_type if file_type == "audio" else "stream", "file_name": file_name, "file": (file_name, f, "application/octet-stream"), } ) upload_headers = headers.copy() upload_headers["Content-Type"] = form.content_type upload_url = "https://open.feishu.cn/open-apis/im/v1/files" ...[truncated 3418 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (41)

Tainted flow: 'upload_headers' from os.getenv (line 159, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · server/feishu_supertoolkit/messaging_api.py (reported line 163)May include surrounding context.

python
upload_headers["Content-Type"] = form.content_type
            
            upload_url = "https://open.feishu.cn/open-apis/im/v1/files"
            upload_response = requests.post(
                upload_url,
                headers=upload_headers,
                data=form,

Tainted flow: 'headers' from os.getenv (line 121, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · server/feishu_supertoolkit/messaging_api.py (reported line 215)May include surrounding context.

python
"content": content,
    }
    
    send_response = requests.post(
        send_url,
        headers=headers,
        params=params,

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding indicates another variant of the same documentation-to-behavior mismatch, including claims about calendar and other office modules without matching evidence. Overstated capabilities around enterprise systems are risky because they encourage users to grant trust, credentials, or permissions under false assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding indicates another variant of the same documentation-to-behavior mismatch, including claims about calendar and other office modules without matching evidence. Overstated capabilities around enterprise systems are risky because they encourage users to grant trust, credentials, or permissions under false assumptions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding indicates another variant of the same documentation-to-behavior mismatch, including claims about calendar and other office modules without matching evidence. Overstated capabilities around enterprise systems are risky because they encourage users to grant trust, credentials, or permissions under false assumptions.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation contains a plaintext Feishu application secret, which is sensitive credential material. If this value is real, anyone with access to the document can abuse the integration, impersonate the application, or access connected Feishu resources depending on granted scopes.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

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

bash
cd server/
uv venv && uv pip install -e ".[dev]"
uv run --env-file .env uvicorn feishu_supertoolkit.main:app --host 127.0.0.1 --port 8002

3. 验证

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · server/feishu_supertoolkit/approval_api.py (reported line 94)May include surrounding context.

python
```bash
cd server/
uv venv && uv pip install -e ".[dev]"
uv run --env-file .env uvicorn feishu_supertoolkit.main:app --host 127.0.0.1 --port 8002
```

### 3. 验证

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · server/feishu_supertoolkit/approval_api.py (reported line 125)May include surrounding context.

python
```bash
cd server/
uv venv && uv pip install -e ".[dev]"
uv run --env-file .env uvicorn feishu_supertoolkit.main:app --host 127.0.0.1 --port 8002
```

### 3. 验证

Possible Typosquatting: 'uvicorn' resembles popular package 'gunicorn'

High
Category
Supply Chain
Confidence
70% confidence
Finding

Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises installation/runtime requirements that imply environment access, network communication, and shell execution, but it does not declare any explicit tool scope or allowed-tools boundary. This weakens user consent and runtime confinement, making it easier for a broad skill to perform sensitive actions beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The documentation describes broad read/write operations across calendars, approvals, tables, contacts, and attendance without any user-facing warning that these actions can expose private data or modify enterprise records. Lack of privacy and write-action warnings increases the chance of unsafe use and uninformed authorization in a sensitive business context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The example commands are broad and action-oriented, including reservation, approval initiation, record creation, and attendance lookup, but they do not state confirmation requirements, boundaries, or excluded operations. In an enterprise integration skill, vague activation patterns can cause unintended high-impact actions or excessive data access from natural-language prompts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document exposes capabilities to send arbitrary files and text messages to Feishu recipients but does not warn about confidentiality, recipient validation, or the risk of disclosing local files and sensitive content. In an agent skill context, this omission is dangerous because downstream agents may treat these endpoints as routine actions and exfiltrate data to users or group chats without sufficient user confirmation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · references/file-sender.md (reported line 115)May include surrounding context.

md
import requests

# 发送音频卡片
response = requests.post(
    "http://127.0.0.1:8002/messaging/send-file",
    json={
        "file_path": "C:/Music/song.mp3",

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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 · references/file-sender.md (reported line 115)May include surrounding context.

md
import requests

# 发送音频卡片
response = requests.post(
    "http://127.0.0.1:8002/messaging/send-file",
    json={
        "file_path": "C:/Music/song.mp3",

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · references/file-sender.md (reported line 115)May include surrounding context.

md
import requests

# 发送音频卡片
response = requests.post(
    "http://127.0.0.1:8002/messaging/send-file",
    json={
        "file_path": "C:/Music/song.mp3",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · references/file-sender.md (reported line 126)May include surrounding context.

print(response.json())

text

### cURL
```bash
# 发送文本
curl -X POST http://127.0.0.1:8002/messaging/send-text \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The endpoints for approving, rejecting, transferring, and canceling approvals immediately submit state-changing requests to the Feishu approval API and return success, but there is no confirmation prompt, user-facing log/print, or cautionary comment/docstring warning that these actions alter live approval workflows. These are safety-relevant operations because they can materially change or terminate business approval processes.

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 · server/feishu_supertoolkit/auth.py (reported line 20)May include surrounding context.

python
"""获取飞书 tenant_access_token"""
    url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
    payload = {"app_id": app_id, "app_secret": app_secret}
    response = requests.post(url, json=payload, timeout=10)
    response.raise_for_status()
    data = response.json()
    if data.get("code") != 0:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The code performs remote data writes to Feishu Bitable by creating and updating records, which can affect user data. While the function docstrings describe the action, there is no explicit warning, confirmation, or user disclosure about modifying persistent remote data in these endpoints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The delete_event route issues a DELETE request that removes a calendar event, but the code provides no confirmation prompt, user-facing warning, logging, or cautionary comment/docstring beyond the bare operation name. For a destructive action, this file does not disclose the irreversible effect to the user beyond the endpoint label itself.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This module exposes organization-wide directory search and lookup capabilities backed by a tenant_access_token, allowing an agent or caller to enumerate users, departments, and membership data at broad scope. There is no visible authorization, scope reduction, consent prompt, or data-minimization control in these routes, so sensitive employee directory information could be queried or bulk harvested beyond user expectations.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · server/feishu_supertoolkit/messaging_api.py (reported line 51)May include surrounding context.

python
"-y",
            output_path,
        ]
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
        return result.returncode == 0
    except Exception as e:
        print(f"FFmpeg 转换失败:{e}")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · server/feishu_supertoolkit/messaging_api.py (reported line 68)May include surrounding context.

python
"-of", "default=noprint_wrappers=1:nokey=1",
            file_path,
        ]
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
        if result.returncode == 0:
            return int(float(result.stdout.strip()))
    except Exception as e: