Back to skill

Security audit

飞书云盘助手

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Feishu Drive client, but it can upload, download, share, move, and delete drive data using app credentials without enforceable runtime safeguards.

Install only with a dedicated least-privilege Feishu app, preferably limited to a test or approved root folder. Do not expose broad production Drive permissions unless you add external controls for confirmation, allowed folders, upload/download paths, and audit logging. Treat FEISHU_APP_SECRET as sensitive and review every permission grant, upload, download, move, copy, and delete request before allowing an agent to run it.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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_drive_client.py:399
Finding

Destructive file and folder operations do not enforce user confirmation

Content
View full analysis

Vulnerability Details

File Location: feishu_drive_client.py:399-428
Vulnerability Type: Missing safeguard for destructive operations
Risk Level: Medium

Vulnerable Code

python
def delete_folder(self, folder_token: str) -> Dict:
    url = f"{self.base_url}/files/{folder_token}"
    headers = self._get_headers()

    response = requests.delete(f"{url}?type=folder", headers=headers)
    return response.json()

def delete_file(self, file_token: str) -> Dict:
    url = f"{self.base_url}/files/{file_token}"
    headers = self._get_headers()

    response = requests.delete(f"{url}?type=file", headers=headers)
    return response.json()

Technical Analysis

The public deletion methods immediately send authenticated HTTP DELETE requests after receiving a file or folder token. They do not accept a confirmation parameter, verify prior user approval, display the target metadata, or provide another programmatic safeguard against accidental invocation.

This conflicts with the documentation, which states that deletion must be confirmed and advertises deletion as requiring forced confirmation. The confirmation mechanism exists only in example wrapper functions in README.md and SKILL.md; callers can bypass those examples and invoke delete_file() or delete_folder() directly.

Because the methods use the client's tenant access token, the deletion request executes with all relevant Drive privileges granted to the configured Feishu application.

Attack Path

  1. The Skill is initialized with valid Feishu application credentials and write privileges.
  2. An agent, integration, or untrusted input supplies or selects a valid file or folder token.
  3. The caller invokes delete_file(token) or delete_folder(token) directly.
  4. The method obtains an authenticated bearer token without checking for explicit user approval.
  5. An HTTP DELETE request is sent to the Feishu Drive API.
  6. The s ...[truncated 490 chars]
Remediation
View remediation

Remediation Suggestions

  • Add an explicit confirmation requirement to each destructive public method, such as confirmed: bool = False.
  • Refuse to issue the request unless confirmation is explicitly true.
  • Retrieve and present the target's name, type, and token before requesting confirmation.
  • Keep low-level unguarded deletion helpers private and prevent agents from invoking them directly.
  • Consider requiring a short-lived confirmation token bound to the exact target rather than a reusable Boolean.
  • Record deletion attempts and outcomes without logging bearer tokens or application secrets.
  • Update the documentation so its claims precisely match the implemented safeguards.

Example hardening:

python
def delete_file(self, file_token: str, confirmed: bool = False) -> Dict:
    if not confirmed:
        raise PermissionError(
            "Explicit confirmation is required before deleting a file"
        )

    url = f"{self.base_url}/files/{file_token}"
    headers = self._get_headers()
    response = requests.delete(f"{url}?type=file", headers=headers)
    return response.json()

T08 · Insecure Dependencies

Note
Location
SKILL.md:11
Finding

Runtime dependency is installed without version or integrity pinning

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:11-17
Vulnerability Type: Mutable third-party dependency resolution
Risk Level: Low

Vulnerable Code

yaml
bins:
  - python3
  - pip3
primaryEnv: FEISHU_APP_SECRET
install:
  - id: pip-deps
    kind: python
    package: requests
    label: Install Python dependencies

The README similarly instructs users to run:

bash
pip install requests

Technical Analysis

The installation configuration requests the unversioned requests package. As a result, the exact artifact installed depends on the package index state at installation time. The package name is legitimate and no suspicious package source was found, but the installation is not reproducible and does not verify a reviewed artifact using a cryptographic hash.

A compromised package index, compromised upstream release, unexpected future release, or dependency-resolution change could cause installation of code that was not included in this audit. This is particularly sensitive because the Skill processes Feishu application credentials and bearer tokens at runtime.

Attack Path

  1. A user installs the Skill and its declared Python dependency.
  2. The installer resolves requests and its transitive dependencies from the configured package index without an exact version or hash.
  3. The index, an upstream release, or a transitive dependency supplies a compromised or incompatible artifact.
  4. The artifact is installed or processed during package build and installation.
  5. Compromised dependency code later executes when feishu_drive_client.py imports or calls requests.
  6. That code may access process privileges and runtime data, potentially including Feishu credentials, bearer tokens, or uploaded file content.

This path depends on an upstream or package-index compromise; no malicious dependency was present in the audited project itself.

Impact Assessment

Po ...[truncated 410 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin requests and all transitive dependencies to reviewed versions.
  • Use a lock file generated by a dependency-management tool.
  • Require cryptographic hashes for downloaded artifacts, such as with pip --require-hashes.
  • Review and update pinned versions regularly to incorporate security patches.
  • Use only trusted package indexes and disable unintended fallback indexes.
  • Run dependency vulnerability and provenance checks in continuous integration.
  • Keep installation and runtime environments minimally privileged.

Example declaration:

yaml
install:
  - id: pip-deps
    kind: python
    package: requests==2.32.5
    label: Install pinned Python dependencies

The selected version should be verified against the project's compatibility requirements and current security advisories, and preferably installed using a hash-locked requirements file.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (24)

Tainted flow: 'files' from os.environ.get (line 681, 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 · feishu_drive_client.py (reported line 181)May include surrounding context.

python
with open(file_path, "rb") as f:
            files = {"file": f}
            response = requests.post(url, headers=headers, data=data, files=files)

        return response.json()

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

整体上,这段代码的核心目的与“飞书云盘管理技能”基本一致,没有发现明显无关或恶意的越界能力;但声明存在一定夸大。尤其是“完整功能”表述过强,而代码中若干能力仅部分实现或可能无法正常工作。最明显的是搜索功能:代码自己注明该接口不支持 tenant_access_token,但客户端统一使用 tenant_access_token 获取 Authorization,这意味着该功能与声明不一致,属于实质性能力偏差。此外,权限管理更多是‘添加文件夹成员权限’与‘创建后自动授权’,并非广义完整权限管理。因此应判定为存在描述与行为不完全匹配。

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

The skill documents a destructive delete operation on folders using caller-controlled tokens. Even though the markdown advises confirmation, there is no enforceable safeguard in the skill manifest, so an agent or prompt-injected workflow could delete user data by passing an arbitrary folder token.

Content

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

接口说明: 删除指定文件夹(删除后进入回收站)

text
DELETE /open-apis/drive/v1/files/:folder_token?type=folder

请求参数:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

The file deletion endpoint is another destructive operation controlled by a token parameter and capable of moving arbitrary files to trash. In a cloud-drive management skill, this is expected functionality, but absent enforced confirmation and scope boundaries it remains dangerous because an agent can be manipulated into deleting unintended content.

Content

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

接口说明: 删除指定文件(删除后进入回收站)

text
DELETE /open-apis/drive/v1/files/:file_token?type=file

请求参数:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill documentation is presented entirely in Chinese, including the title, feature descriptions, setup, and usage guidance, with no indication that users may choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Cloud Storage Exfiltration

Medium
Category
Data Exfiltration
Confidence
55% confidence
Finding

Data is uploaded to cloud storage (S3 / GCS / Azure Blob). This may be a legitimate backup or exfiltration to an external bucket. Manual review is recommended.

Content

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

上传文件

python
result = client.upload_file(
    file_path="/path/to/file.jpg",
    parent_folder_token=folder_token,
    file_name="uploaded_file.jpg"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares access to environment variables and requires networked API use, but it does not declare an explicit tool scope such as allowed-tools or permissions boundaries. In an agent setting, that weakens least-privilege controls and can let the skill access sensitive credentials and perform remote actions without clear runtime restriction.

Content

No source excerpt is available for this finding.

Cloud Storage Exfiltration

Medium
Category
Data Exfiltration
Confidence
82% confidence
Finding

The skill includes file upload capability to an external cloud drive, which creates a plausible exfiltration path if an agent is induced to upload sensitive local data. In this context the capability is central to the skill, but without scope restrictions, user confirmation, or path/content controls, it can be abused to move secrets off-host.

Content

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

md
result = client.create_folder("新文件夹")

# 在根目录下上传文件
result = client.upload_file("/path/to/file.jpg")

# 列出根目录内容
result = client.list_folder()

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_drive_client.py (reported line 74)May include surrounding context.

python
"app_secret": self.app_secret
        }

        response = requests.post(url, headers=headers, json=data)
        result = response.json()

        if result.get("code") == 0:

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_drive_client.py (reported line 146)May include surrounding context.

python
"app_secret": self.app_secret
        }

        response = requests.post(url, headers=headers, json=data)
        result = response.json()

        if result.get("code") == 0:

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_drive_client.py (reported line 454)May include surrounding context.

python
"app_secret": self.app_secret
        }

        response = requests.post(url, headers=headers, json=data)
        result = response.json()

        if result.get("code") == 0:

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_drive_client.py (reported line 482)May include surrounding context.

python
"app_secret": self.app_secret
        }

        response = requests.post(url, headers=headers, json=data)
        result = response.json()

        if result.get("code") == 0:

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_drive_client.py (reported line 511)May include surrounding context.

python
"app_secret": self.app_secret
        }

        response = requests.post(url, headers=headers, json=data)
        result = response.json()

        if result.get("code") == 0:

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_drive_client.py (reported line 588)May include surrounding context.

python
"app_secret": self.app_secret
        }

        response = requests.post(url, headers=headers, json=data)
        result = response.json()

        if result.get("code") == 0:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

upload_file sends arbitrary local file contents to a remote Feishu endpoint without any built-in disclosure, confirmation, or policy gate. In an agent context, this is dangerous because prompt-driven misuse could cause unintended exfiltration of sensitive local files while appearing to perform routine cloud-drive actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

download_file writes remote content directly to an arbitrary local path with no safety checks or disclosure. In an agent setting, this can overwrite local files, drop untrusted content into sensitive locations, or facilitate later execution/social-engineering attacks if the saved file is treated as trusted.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill performs organizational identity lookup by email and phone number, which expands its data-access scope beyond basic file operations into directory enumeration of personnel data. In the context of a drive-management skill, this creates avoidable privacy risk and can enable user discovery for later permission abuse or targeted data sharing.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

This call transmits user email addresses and/or phone numbers to the Feishu contact API for batch identity resolution. Because it processes organizational personal data beyond core file storage operations, it increases privacy exposure and can support unauthorized user enumeration in the skill context.

Content

Scanner excerpt · feishu_drive_client.py (reported line 272)May include surrounding context.

python
if mobiles:
            data["mobiles"] = mobiles

        response = requests.post(url, headers=headers, json=data)
        result = response.json()

        if result.get("code") == 0:

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

This endpoint modifies folder membership/permissions remotely, allowing the skill to grant access to cloud-drive content. In a drive-management skill this is expected functionality, but without strong authorization boundaries and confirmation it materially increases the risk of unauthorized data exposure by sharing folders with unintended users.

Content

Scanner excerpt · feishu_drive_client.py (reported line 305)May include surrounding context.

python
"type": "user"
        }

        response = requests.post(f"{url}?type=folder", headers=headers, json=data)
        return response.json()

    def create_folder_with_permission(self, name: str, parent_folder_token: str = None,

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The docstring states that search requires a user_access_token, but the code still uses tenant-level authentication headers. This mismatch can cause developers or agents to assume searches are user-scoped when they may fail unpredictably or, if accepted by backend changes/misconfiguration, execute with broader organizational privileges than intended.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

This search request sends search terms to a remote docs search endpoint while the implementation uses tenant-level headers despite documentation warning that user tokens are required. In context, that auth mismatch can lead to overbroad organizational searches, privacy issues, or unsafe assumptions about user-scoped behavior.

Content

Scanner excerpt · feishu_drive_client.py (reported line 619)May include surrounding context.

python
if page_token:
            data["page_token"] = page_token

        response = requests.post(url, headers=headers, json=data)
        return response.json()

    def check_task_status(self, ticket: str) -> Dict:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language instructions present the skill role and all usage documentation entirely in Chinese, effectively constraining interaction to a specific language/locale without stating user choice or opt-in. The policy for this audit flags language or locale requirements when a skill forces a specific language without offering an alternative.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The file's natural-language interface text, including docstrings, comments, exceptions, and printed messages, is exclusively in Chinese. This imposes a specific language/locale on users and developers without any opt-in or alternative language option.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The create_client helper reads FEISHU_APP_ID and FEISHU_APP_SECRET from environment variables, which are sensitive credentials. The docstring lists the variables but does not warn that secrets are being consumed from the environment or provide any handling precautions.

Content

No source excerpt is available for this finding.