Back to skill

Security audit

飞书文档修订工具(高亮/下划线/批注)

Security checks for vulnerabilities and agentic risk

Overview

This skill is meant to edit Feishu documents, but it ships a Feishu app secret and can make credential-backed document changes without tight user controls.

Review before installing. The publisher should remove and rotate the exposed Feishu secret, require credentials from a protected runtime source, JSON-encode comment content, narrow activation to explicit Feishu document URLs or requests, and require confirmation before each document-changing action.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/add_comment.sh:13
Finding

Hardcoded Feishu Application Secret

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/add_comment.sh:30
Finding

Unsafe JSON Construction Using Unescaped Comment Text

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill advertises three document-editing capabilities, but the documented implementation only concretely covers comment insertion via a shell script and direct API call. This mismatch can mislead users and reviewers about what code actually exists and what trust boundary applies, which is dangerous when hidden or undocumented behavior may be introduced later.

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/add_comment.sh (reported line 17)May include surrounding context.

sh
APP_SECRET="${FEISHU_APP_SECRET:-lo4II96JWo5W0DMjgYfZ1diOodp8xlnj}"

# 获取 tenant_access_token
TOKEN=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['tenant_access_token'])")

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/add_comment.sh (reported line 28)May include surrounding context.

sh
fi

# 添加批注
RESULT=$(curl -s -X POST \
  "https://open.feishu.cn/open-apis/drive/v1/files/${DOC_TOKEN}/comments?file_type=docx" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill invokes a shell script for comment creation but does not declare tool scope such as allowed-tools or permissions. That increases the chance an agent can use broader execution capabilities than users expect, which is risky because the same skill also handles credentials and external API calls.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrases are broad enough to match generic requests like 'review一下文档' or '标注一下', which could cause the skill to activate outside the intended Feishu context. Because the skill performs write operations on documents, overbroad activation raises the risk of accidental modification of the wrong target or use in situations the user did not intend.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instructions tell the agent to perform highlight, underline, and comment operations that modify a live document, but they do not require an explicit user-facing warning or confirmation before making changes. In a document-review context this is risky because users may believe they are asking for analysis rather than immediate edits, leading to unintended persistent modifications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs use of sensitive credentials and direct POST requests to an external API without clearly warning the user that authentication material will be used and data will be transmitted to Feishu. This is dangerous because it obscures external data flow and credential-backed actions behind a simple review request, reducing transparency and increasing the chance of unauthorized or unexpected network activity.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation authorizes use of a specific app ID and suggests reading the app secret from environment variables or even using a directly known secret value. Embedding or encouraging direct use of credentials in skill instructions expands access beyond ordinary document review and creates a serious risk of secret exposure, misuse, or unauthorized API actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script embeds a default Feishu app secret directly in code via the fallback value for FEISHU_APP_SECRET. Hard-coded secrets are dangerous because anyone with access to the script can recover and abuse the credential to mint access tokens and act against the associated Feishu tenant.

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/add_comment.sh (reported line 17)May include surrounding context.

sh
APP_SECRET="${FEISHU_APP_SECRET:-lo4II96JWo5W0DMjgYfZ1diOodp8xlnj}"

# 获取 tenant_access_token
TOKEN=$(curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d "{\"app_id\":\"$APP_ID\",\"app_secret\":\"$APP_SECRET\"}" \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['tenant_access_token'])")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script performs an HTTP request to obtain an access token and then uses that token to call the Feishu API, transmitting credentials and user-supplied comment content. Although there are inline comments describing the mechanics, there is no user-facing warning, confirmation, or disclosure that document data and secrets will be sent to an external service.

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/add_comment.sh (reported line 28)May include surrounding context.

sh
fi

# 添加批注
RESULT=$(curl -s -X POST \
  "https://open.feishu.cn/open-apis/drive/v1/files/${DOC_TOKEN}/comments?file_type=docx" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The activation guidance and example invocations are presented only in Chinese, implying a language-specific usage model without documenting user opt-in or a justified region-specific constraint. Under the policy rule, forcing or assuming a specific language without choice can be a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

Comments and user-facing messages in the script are written only in Chinese, including the usage text and success or failure output. The file does not offer any language choice or explain that the skill is intentionally restricted to a Chinese-speaking context, which can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.