Back to skill

Security audit

Feishu Voice Sender (ZheYanyan)

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it can upload any readable local file to a Feishu recipient using stored OpenClaw Feishu credentials with limited safeguards.

Review before installing. Use this only in a trusted workflow, pass an explicit audio file path and recipient, and avoid letting automated agents choose those values from untrusted instructions. The publisher should add audio validation, file size limits, canonical path checks, and a clear confirmation or warning before uploading.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/feishu_voice_sender.py:24
Finding

Arbitrary Readable File Upload Due to Missing Audio Validation

Content
View full analysis
str: """Upload a file and return its file_key.""" filename = os.path.basename(file_path) url = "https://open.feishu.cn/open-apis/im/v1/files" boundary = "----FeishuBoundary" with open(file_path, "rb") as f: content = f.read() ``` The caller-controlled path reaches the upload operation without content or path validation: ```python parser.add_argument("--file", "-f", required=True, help="Audio file path") parser.add_argument( "--receive-id", "-r", default=get_receive_id_from_env(), help="Recipient open_id" ) args = parser.parse_args() if not args.receive_id: print( "Error: specify --receive-id or set OPENCLAW_CHAT_ID", file=sys.stderr ) sys.exit(1) if not os.path.exists(args.file): print(f"Error: file does not exist: {args.file}", file=sys.stderr) sys.exit(1) print("Reading Feishu configuration...") feishu_config = read_openclaw_config() print("Obtaining access token...") token = get_tenant_token( feishu_config["app_id"], feishu_config["app_secret"] ) print(f"Uploading audio file: {args.file}") file_key = upload_file(token, args.file) print("Sending voice message...") message_id = send_audio_message(token, args.receive_id, file_key) ``` ### Technical Analysis The Skill is declared as an audio-message sender, but it accepts any existing filesystem path. It does not verify that the path: - Resolves to a regular file. - Is located in an approved directory. - Has an allowed size. - Contains valid audio data. - Uses an allowed audio codec or container. - Does not resolve through a symbolic link into a sensitive location. The existence check does not provide a security boundary. `open(file_path, "rb")` ...[truncated 2278 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

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 62)May include surrounding context.

md
import urllib.error

def get_tenant_token(app_id: str, app_secret: str) -> str:
    """获取 tenant access token"""
    url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
    data = json.dumps({"app_id": app_id, "app_secret": app_secret}).encode()
    req = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"})

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 · scripts/feishu_voice_sender.py (reported line 12)May include surrounding context.

python
import urllib.error

def get_tenant_token(app_id: str, app_secret: str) -> str:
    """获取 tenant access token"""
    url = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal"
    data = json.dumps({"app_id": app_id, "app_secret": app_secret}).encode()
    req = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"})

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill performs network access and reads environment/config-based secrets, but it does not declare any tool scope or permissions metadata. This creates a transparency and policy-enforcement gap: users or runtimes may invoke a skill with broader capabilities than expected, increasing the chance of unintended data transmission or credential use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill description explains functionality but does not clearly warn that local audio files, recipient identifiers, and authentication-derived requests will be sent to Feishu over the network. In a messaging skill, this omission matters because users may expose sensitive recordings or target identifiers without explicit notice.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill silently discovers and uses Feishu credentials from ~/.openclaw/openclaw.json and recipient identifiers from environment variables instead of requiring explicit user-supplied inputs. That expands the skill's effective privilege and allows it to send messages using existing local credentials without clear consent, which is dangerous in an agent/skill setting where users may not expect credential harvesting from unrelated local config.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code reads sensitive Feishu credentials from a local OpenClaw config file without any warning, confirmation, or transparency to the user. In a skill ecosystem, this can enable unintended secret use and outbound actions under the user's identity, especially when the skill description does not prominently disclose that it will access stored credentials.

Content

No source excerpt is available for this finding.