Back to skill

Security audit

Feishu Sheet

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended to manage Feishu spreadsheets, but it includes unsafe image handling, unrestricted URL fetching, and destructive spreadsheet commands that need review before use.

Review this skill before installing. Use only a minimal-permission Feishu app, avoid float_image_url unless URL fetching is sandboxed or allowlisted, do not pass untrusted image paths, and require explicit confirmation before delete or overwrite operations. The token cache should be hardened before use on shared systems.

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
scripts/feishu-sheet.sh:223
Finding

Arbitrary Python Code Execution Through Unsafely Interpolated Image Path

Content
View full analysis
image_path -> interpolation into python3 -c source -> arbitrary Python execution -> local process compromise ``` ### Impact Assessment Successful exploitation provides arbitrary code execution under the account running the Skill. The attacker may: - Read `~/.openclaw/openclaw.json` and recover configured credentials. - Read or modify other files accessible to the process. - Access the cached Feishu tenant token. - I ...[truncated 361 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/feishu-sheet.sh:282
Finding

Unrestricted URL Retrieval Enables SSRF and Local File Exfiltration

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/feishu-sheet.sh:64
Finding

Feishu Bearer Token Cached at a Predictable Path Without Enforced Permissions

Content
View full analysis
/dev/null) local expire_in expire_in=$(echo "$resp" | python3 -c "import sys,json; print(json.load(sys.stdin).get('expire',7200))" 2>/dev/null) if [[ -z "$token" ]]; then echo "{\"error\":\"Failed to get tenant_access_token\"}" >&2 exit 1 fi echo "$token" > "$TOKEN_CACHE" echo $(( now + expire_in - 300 )) > "$TOKEN_EXPIRE" echo "$token" } ``` ### Technical Analysis The tenant access token is written to a predictable path derived only from `TMPDIR` and the numeric user ID. The script does not: - Set a restrictive `umask`. - Explicitly create the cache with mode `0600`. - Verify that the cache is owned by the current user. - Verify that the destination is a regular file rather than a symbolic link. - Create and replace cache contents atomically. - Ensure that `TMPDIR` itself is private and trustworthy. The final file permissions therefore depend on the caller's environment and umask. In a shared or attacker-controlled temporary directory, this can expose the bearer token or permit fil ...[truncated 1549 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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (17)

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

md
credentialPath: "channels.feishu"
    networkAccess: "open.feishu.cn (Feishu Open API only)"
    fileAccess: "Reads local image files only when explicitly passed to insert_image/float_image commands"
    tokenCache: "Tenant access token cached in $TMPDIR with per-user isolation (uid suffix)"
    note: "Credentials are validated against ^[A-Za-z0-9_-]+$ before use. Python inline script uses single-quoted strings to prevent shell injection. Recommend using a minimal-permission Feishu app."
---

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/feishu-sheet.sh (reported line 79)May include surrounding context.

sh
fi
  fi
  local resp
  resp=$(curl -s -X POST "$FEISHU_BASE/auth/v3/tenant_access_token/internal" \
    -H "Content-Type: application/json" \
    -d "{\"app_id\":\"$FEISHU_APP_ID\",\"app_secret\":\"$FEISHU_APP_SECRET\"}")
  local token

Scope Creep

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script uses Feishu Drive media upload APIs (/drive/v1/medias/upload_all) to implement floating-image support, but the skill metadata only declares sheets:spreadsheet permission scope. This is a real capability mismatch that can lead to over-privileged app configuration and broader-than-advertised access to Feishu resources.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/feishu-sheet.sh (reported line 293)May include surrounding context.

sh
filename=$(basename "$image_url" | sed 's/\?.*//')
  [[ "$filename" != *.* ]] && filename="${filename}.png"

  curl -sL "$image_url" -o "$tmpfile"
  if [[ ! -s "$tmpfile" ]]; then
    rm -f "$tmpfile"
    echo '{"error":"Failed to download image from URL"}'

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/feishu-sheet.sh (reported line 417)May include surrounding context.

sh
action_delete_rows() {
  local body="{\"dimension\":{\"sheetId\":\"$2\",\"majorDimension\":\"ROWS\",\"startIndex\":$3,\"endIndex\":$4}}"
  api_call DELETE "/sheets/v2/spreadsheets/$1/dimension_range" -d "$body" | python3 -c "
import sys,json
d = json.load(sys.stdin)
print(json.dumps({'success':d.get('code',1)==0,'msg':d.get('msg','')}, ensure_ascii=False, indent=2))

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/feishu-sheet.sh (reported line 426)May include surrounding context.

sh
action_delete_rows() {
  local body="{\"dimension\":{\"sheetId\":\"$2\",\"majorDimension\":\"ROWS\",\"startIndex\":$3,\"endIndex\":$4}}"
  api_call DELETE "/sheets/v2/spreadsheets/$1/dimension_range" -d "$body" | python3 -c "
import sys,json
d = json.load(sys.stdin)
print(json.dumps({'success':d.get('code',1)==0,'msg':d.get('msg','')}, ensure_ascii=False, indent=2))

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill explicitly instructs use of exec to run a shell script and documents network access to Feishu APIs, but it does not declare a restrictive tool scope such as permissions or allowed-tools. In an agent environment, this weakens enforcement boundaries and can let a broadly capable skill invoke shell and network operations without clear least-privilege constraints.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

创建电子表格

bash
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh create '表格标题'"

返回 spreadsheet_token 和 URL。可选第二参数 folder_token。

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

创建电子表格

bash
exec command="~/.openclaw/skills/feishu-sheet/scripts/feishu-sheet.sh create '表格标题'"

返回 spreadsheet_token 和 URL。可选第二参数 folder_token。

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation exposes destructive operations such as delete_sheet, delete_rows, and delete_cols without any warning, confirmation requirement, or guidance about irreversibility. In agent-driven workflows, this increases the chance of accidental or unauthorized data destruction, especially if a user prompt is ambiguous.

Content

No source excerpt is available for this finding.

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 · scripts/feishu-sheet.sh (reported line 79)May include surrounding context.

sh
fi
  fi
  local resp
  resp=$(curl -s -X POST "$FEISHU_BASE/auth/v3/tenant_access_token/internal" \
    -H "Content-Type: application/json" \
    -d "{\"app_id\":\"$FEISHU_APP_ID\",\"app_secret\":\"$FEISHU_APP_SECRET\"}")
  local token

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The tenant access token is cached in predictable files under /tmp without explicit permission hardening or secure storage controls. On multi-user or weakly isolated systems, another local process may read or race these files, allowing unauthorized reuse of Feishu API credentials.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill exposes a float_image_url action that fetches arbitrary user-supplied URLs, which expands behavior beyond the declared Feishu Sheets-only scope into general outbound network access. This creates SSRF-like risk, unexpected data transfer, and policy/scope mismatch because the tool can be used to contact untrusted hosts and then relay that content into Feishu.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

This network call downloads arbitrary external content from a user-controlled URL, which is outside the core Sheets API behavior and can be abused for SSRF-like access or unreviewed content transfer. In the context of an agent skill, giving the tool arbitrary fetch capability materially increases risk compared with normal Feishu API communication.

Content

Scanner excerpt · scripts/feishu-sheet.sh (reported line 293)May include surrounding context.

sh
filename=$(basename "$image_url" | sed 's/\?.*//')
  [[ "$filename" != *.* ]] && filename="${filename}.png"

  curl -sL "$image_url" -o "$tmpfile"
  if [[ ! -s "$tmpfile" ]]; then
    rm -f "$tmpfile"
    echo '{"error":"Failed to download image from URL"}'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script silently downloads remote content to a local temp file and then uploads it to Feishu, causing cross-boundary data transfer the user may not expect. This is risky because a crafted URL can make the tool retrieve attacker-chosen content and move it into the user's Feishu environment without meaningful warning or review.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The create action defaults the spreadsheet title to '新建电子表格', which imposes a specific language/locale in user-visible output. There is no opt-in, locale detection, or documented justification for forcing Chinese as the default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
61% confidence
Finding

The script mixes English-only help text with a Chinese default spreadsheet title, creating inconsistent locale assumptions rather than offering a user-selected language. This can be considered a language policy issue because user-facing language is imposed without opt-in or documented regional scope.

Content

No source excerpt is available for this finding.