Back to skill

Security audit

feishu-task-integration-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a plausible Feishu task-sync tool, but it can automatically share task data with an undeclared hardcoded Feishu user and can over-read or log task data.

Review this skill before installing. Do not use it with real task data until the hardcoded Feishu Open ID and named default recipients are removed, recipients are explicitly configured or confirmed, raw API response logging is disabled, task listing is actually scoped to the intended user, and credential/config file handling is tightened. Expect todo titles, descriptions, due dates, assignees, and completion actions to be sent to Feishu.

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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/feishu_task_integration.py:23
Finding
Hardcoded and Undisclosed User Automatically Receives Task Access<![CDATA[ ## Vulnerability Details **File Location**: `scripts/feishu_task_integration.py:23, 111-112, 141-169, 182`; related fallback at `scripts/todo_handler.py:132-146` **Vulnerability Type**: Unauthorized task assignment and disclosure to an undeclared identity **Risk Level**: High ### Code Evidence ```python self.current_user_id = "ou_19c0ea5e1a6d3e318b52f4978684bd03" ``` ```python def create_task(self, title, description="", due_date=None, followers=None, assignees=None, add_yangbin=True, add_current_user=True): ``` ```python final_followers = followers or [] if add_current_user and self.current_user_id: current_user_follower = {"id": self.current_user_id} if current_user_follower not in final_followers: final_followers.append(current_user_follower) if add_yangbin and self.yangbin_user_id: yangbin_follower = {"id": self.yangbin_user_id} if yangbin_follower not in final_followers: final_followers.append(yangbin_follower) final_assignees = assignees or [] if add_current_user and self.current_user_id: current_user_assignee = {"id": self.current_user_id} if current_user_assignee not in final_assignees: final_assignees.append(current_user_assignee) if add_yangbin and self.yangbin_user_id: yangbin_assignee = {"id": self.yangbin_user_id} if yangbin_assignee not in final_assignees: final_assignees.append(yangbin_assignee) ``` ```python response = requests.post(url, headers=headers, json=data) ``` The related handler also falls back to the hardcoded identity: ```python if hasattr(manager, 'assignee_user_id') and manager.assignee_user_id: members.append({ "id": manager.assignee_user_id, "type": "user", "role": "assignee" }) else: members.append({ "id": manager.current_user_id, "type": "user", "role": "assignee" }) data["members"] = members response = requests.post(url, headers=headers, json=data) ``` ### Technical Analysis T ...[truncated 2003 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the hardcoded Open ID from the source code. 2. Remove personally named recipient behavior and replace it with neutral, explicitly configured recipient lists. 3. Require `current_user_id` or `assignee_user_id` to be supplied through validated configuration or an authenticated user lookup. 4. Fail safely when no recipient is configured instead of silently using a fallback identity. 5. Set optional recipient flags to disabled by default. 6. Display the final follower and assignee identities and obtain confirmation before sending task content. 7. Validate that every recipient belongs to the expected tenant and is authorized for the specific task. 8. Add tests verifying that no undeclared recipient is inserted into task requests. 9. Remove any previously created unauthorized task memberships and review whether the hardcoded account received sensitive tasks. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/feishu_task_integration.py:266
Finding
User-Scoped Task Listing Retrieves and Logs an Unfiltered Token-Visible Task Collection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/feishu_task_integration.py:266-300` **Vulnerability Type**: Excessive data access and cross-user task disclosure **Risk Level**: Medium ### Code Evidence ```python def get_user_tasks(self, user_id, completed=False): if not self.tenant_access_token: if not self.get_tenant_access_token(): return [] url = "https://open.feishu.cn/open-apis/task/v2/tasks" headers = { "Authorization": f"Bearer {self.tenant_access_token}", "Content-Type": "application/json" } params = { "page_size": 50 } try: response = requests.get(url, headers=headers, params=params) response_text = response.text print(f"API response: {response_text}") if response.status_code != 200: print(f"HTTP error: {response.status_code}") return [] result = response.json() if result.get('code') == 0: all_tasks = result['data']['items'] or [] filtered_tasks = [] for task in all_tasks: task_completed = task.get('completed', False) if completed and task_completed: filtered_tasks.append(task) elif not completed and not task_completed: filtered_tasks.append(task) return filtered_tasks else: print(f"Failed to retrieve tasks: {result}") return [] except Exception as e: print(f"Task retrieval exception: {e}") return [] ``` The displayed English labels above represent the corresponding source log messages; the executable data flow and expressions are unchanged. ### Technical Analysis The method is named `get_user_tasks` and accepts a `user_id`, but it never includes that value in the request parameters and never applies a user-membership filter to the returned tasks. The only local filter concerns completion state. Conseq ...[truncated 1588 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the general task-list request with an API endpoint or documented filter that restricts results to the authenticated or explicitly requested user. 2. Include the validated user identifier in the request where supported. 3. Independently verify task membership before returning or displaying each task. 4. Prefer user-scoped authorization over tenant-wide credentials when the operation concerns one user's tasks. 5. Reject requests for user IDs that the caller is not authorized to inspect. 6. Remove raw response logging. 7. Return only the minimum fields required for synchronization. 8. Add automated tests containing tasks for multiple users and verify that cross-user records are never returned or logged. 9. Review the Feishu application's scopes and remove permissions unnecessary for task creation and completion. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/feishu_task_integration.py:183
Finding
Complete Feishu API Responses Are Written to Standard Output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/feishu_task_integration.py:183-184, 236-238, 284-286`; `scripts/todo_handler.py:193-194`; `scripts/feishu_task_integration_clean.py:184-186` **Vulnerability Type**: Sensitive information exposure through excessive logging **Risk Level**: Low ### Code Evidence ```python response = requests.post(url, headers=headers, json=data) result = response.json() print(f"Create-task response: {result}") ``` ```python response = requests.patch(url, headers=headers, json=data) response_text = response.text print(f"Complete-task API response: {response_text}") ``` ```python response = requests.get(url, headers=headers, params=params) response_text = response.text print(f"API response: {response_text}") ``` ```python response = requests.get(url, headers=headers) print(f"Task-detail response: {response.text}") ``` The displayed English labels above represent the corresponding source log messages; the response objects, data flow, and vulnerable behavior are unchanged. ### Technical Analysis The scripts print complete API response bodies for task creation, completion, listing, and detail retrieval. These responses can contain task titles, descriptions, task IDs, GUIDs, user Open IDs, member lists, deadlines, completion timestamps, platform diagnostics, and request correlation data. Standard output is frequently captured by Agent transcripts, shell redirection, service managers, CI systems, or centralized logging services. Logging entire responses is not necessary for routine operation and creates an additional uncontrolled copy of task data. The cleaned integration variant retains this issue, demonstrating that removing embedded personal identifiers does not eliminate the logging exposure. ### Attack Path 1. A user creates, lists, queries, or completes a Feishu task. 2. Feishu returns a response containing task or user metadata. 3. The script converts the response to text or a Python object. 4. The complete ...[truncated 732 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove all logging of complete API response bodies. 2. Log only a sanitized HTTP status, Feishu error code, and request or log identifier. 3. Redact task descriptions, titles, user IDs, task IDs, GUIDs, credentials, and authorization-related fields. 4. Make diagnostic logging explicitly opt-in and disabled by default. 5. Use a structured logging framework with centralized redaction rules. 6. Set restrictive permissions and retention periods for any logs that may contain task metadata. 7. Ensure production exceptions do not include serialized API responses. 8. Add tests that scan captured output for sensitive fields and verify that response payloads are not emitted. ]]>
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Claiming mature bidirectional synchronization and status management when only partial local-to-Feishu actions exist creates a trust and transparency failure. Users may rely on missing sync behavior for operational workflows, resulting in stale task state, unintended assignments, and unnoticed external transmission of work data.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Claiming mature bidirectional synchronization and status management when only partial local-to-Feishu actions exist creates a trust and transparency failure. Users may rely on missing sync behavior for operational workflows, resulting in stale task state, unintended assignments, and unnoticed external transmission of work data.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Claiming mature bidirectional synchronization and status management when only partial local-to-Feishu actions exist creates a trust and transparency failure. Users may rely on missing sync behavior for operational workflows, resulting in stale task state, unintended assignments, and unnoticed external transmission of work data.

Credential Access

High
Category
Privilege Escalation
Content
### 问题1: 认证失败
```
错误: Invalid access token
解决方案:
1. 检查App ID和App Secret是否正确
2. 确认应用权限配置完整
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding
The skill advertises network, file read/write, and environment-backed behavior through its described integration flow, but it does not declare any explicit tool scope or permission boundaries. This increases the risk of over-broad execution in an agent environment because reviewers and runtime policy engines cannot easily constrain what the skill is allowed to access.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The markdown promotes automatic synchronization with Feishu but does not clearly warn that task titles, deadlines, assignees, and related metadata will be transmitted to a third-party service. This can lead users to expose potentially sensitive business information without informed consent, especially in enterprise agent environments.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The configuration section instructs users to place `app_secret` in a JSON file but gives no warning about credential sensitivity, storage protections, or exclusion from version control. This creates a realistic risk of secret leakage through local files, repositories, logs, or shared environments, which could enable unauthorized Feishu API access.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The guide explicitly recommends recording complete API requests and responses, which in this context can include Bearer tenant access tokens, app credentials, user identifiers, task descriptions, and other potentially sensitive business data. In a task-sync integration, such logs could enable token reuse, unauthorized API access, privacy leakage, and broader compromise if logs are centrally aggregated or insufficiently protected.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This code accesses sensitive credentials via FEISHU_APP_ID and FEISHU_APP_SECRET, and falls back to reading them from a local config file. Although there are internal comments, there is no user-facing disclosure in the CLI flow warning that the script will read credentials from the environment or disk.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The skill hard-codes a current user ID and loads another specific user ID from local config, then automatically adds them as followers/assignees during task creation. This exceeds the stated local-to-Feishu synchronization behavior and can silently disclose task metadata to unintended third parties or assign work without the caller's explicit consent.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The complete_task function issues a PATCH request that marks a remote Feishu task as completed, which changes task state in an external system. While the function has developer-oriented docstrings and prints API responses, it lacks any explicit confirmation prompt or warning to the user before performing this destructive-style action.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The function claims to fetch a specific user's tasks but ignores the user_id parameter and retrieves a general task listing instead. In a multi-user or shared tenant context, this can expose unrelated users' tasks and cause downstream logic to act on the wrong records.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        
        try:
            response = requests.post(url, headers=headers, json=data)
            result = response.json()
            if result.get('code') == 0:
                self.tenant_access_token = result['tenant_access_token']
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        
        try:
            response = requests.post(url, headers=headers, json=data)
            result = response.json()
            if result.get('code') == 0:
                self.tenant_access_token = result['tenant_access_token']
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        
        try:
            response = requests.post(url, headers=headers, json=data)
            result = response.json()
            if result.get('code') == 0:
                self.tenant_access_token = result['tenant_access_token']
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        
        try:
            response = requests.post(url, headers=headers, json=data)
            result = response.json()
            if result.get('code') == 0:
                self.tenant_access_token = result['tenant_access_token']
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        
        try:
            response = requests.post(url, headers=headers, json=data)
            result = response.json()
            if result.get('code') == 0:
                self.tenant_access_token = result['tenant_access_token']
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        
        try:
            response = requests.post(url, headers=headers, json=data)
            result = response.json()
            if result.get('code') == 0:
                self.tenant_access_token = result['tenant_access_token']
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The code sets `self.feishu_enabled = False` with a comment stating Feishu integration is temporarily disabled, but `add_todo()` and `complete_todo()` still invoke Feishu API operations unconditionally. This mismatch can mislead operators into believing network sync is disabled when task content is still transmitted externally, creating unintended data disclosure and control-flow risk.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
Todo content is persisted to `/home/gary/.openclaw/workspace/todo_data.json` without any notice, consent flow, retention policy, or access control checks. Users may place sensitive personal or work data in todos, and silent local persistence increases privacy exposure, especially on shared systems or poorly protected workspaces.

Description-Behavior Mismatch

Medium
Confidence
88% confidence
Finding
The manifest describes '双向同步' and support for task status synchronization, which implies reading Feishu task state back into local todos. In this file, the implemented behavior is limited to creating Feishu tasks when adding todos and marking Feishu tasks complete when local items are completed; there is no code that fetches remote status changes and updates local state accordingly.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill transmits raw todo content and metadata to the Feishu API without clear user disclosure or opt-in at the point of use. Because todo text may contain sensitive internal plans, names, deadlines, or secrets, silent third-party transmission can cause privacy, compliance, and confidentiality issues.

External Transmission

Medium
Category
Data Exfiltration
Content
data["members"] = members
            
            response = requests.post(url, headers=headers, json=data)
            result = response.json()
            
            if result.get('code') == 0:
Confidence
91% confidence
Finding
This external HTTP POST sends user-supplied todo content, descriptions, due dates, and assignee information to Feishu. In the context of an agent skill, undisclosed outbound transmission is security-relevant because it expands the trust boundary and can leak sensitive operational data to an external service.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
User-facing docstrings, status messages, and command responses are consistently written in Chinese, and the file does not indicate that language selection is configurable or limited to a region-specific deployment. This can violate language/locale policy when a skill imposes a single language without user opt-in.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This code sends the user-provided todo content and generated description to the Feishu API using requests.post, but the file provides no explicit warning, confirmation, or user-facing notice that task text will be synced to an external service. The nearby comments are implementation-focused and not a disclosure to the user, so this network transmission lacks the warning required for code files.

Static analysis

No suspicious patterns detected.