Back to skill

Security audit

飞书文档搜索助手

Security checks for vulnerabilities and agentic risk

Overview

This Feishu document-search skill is coherent in purpose, but it exposes app credentials and can automatically forward user questions to another bot.

Do not install this version until the Feishu App Secret has been revoked/rotated and removed from the package. Also require explicit user confirmation before forwarding questions to another bot, narrow the trigger conditions, and redact internal URLs/IDs when showing configuration.

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

Error
Location
SKILL.md:323
Finding

Hard-Coded Feishu Application Credentials

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 323–330
Vulnerability Type: Plaintext hard-coded application secret
Risk Level: Critical

Vulnerable Code

markdown
**App ID**: `cli_a932525f7ef99bd4`  
**App Secret**: `w3RGN8nNkpUEcTUTJsq8vdQugdSKMxL8`

**获取 tenant_access_token**:
```bash
curl -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d '{"app_id":"cli_a932525f7ef99bd4","app_secret":"w3RGN8nNkpUEcTUTJsq8vdQugdSKMxL8"}'
text

### Technical Analysis

The Skill embeds a Feishu App ID and App Secret in plaintext and supplies the exact API request needed to exchange them for a tenant access token. Any party with access to the package or its repository history can extract and reuse these credentials without needing access to the legitimate deployment environment.

The App Secret functions as an authentication credential, not as a public identifier. Storing it in Skill documentation exposes it wherever the package is downloaded, copied, indexed, logged, or shared. Moving it to another tracked file would not resolve the issue; it must be injected at runtime from protected secret storage.

Successful exploitation depends on whether the credential remains valid. The operations available after token acquisition depend on the Feishu application's configured API scopes and the tenant's authorization. The repository does not establish those scopes, so no broader privilege claim can be confirmed.

### Attack Path

1. Obtain a copy of the Skill package or repository history.
2. Read `SKILL.md` and extract the hard-coded App ID and App Secret.
3. Submit the exposed credentials to Feishu's internal tenant-token endpoint:
   `https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal`.
4. If the credentials remain valid, receive a tenant access token.
5. Use that token to invoke Feishu APIs authorized for the application.
6. Access, enumerate, or modify ten
...[truncated 650 chars]
Remediation
View remediation

Remediation Suggestions

  1. Immediately revoke and rotate the exposed App Secret in the Feishu developer console.
  2. Review token issuance and API audit logs for use of the exposed credentials.
  3. Remove the secret from SKILL.md, all tracked files, published packages, generated artifacts, and repository history.
  4. Store the replacement credential in a managed secret store or protected deployment environment variable.
  5. Inject the secret only at runtime and prevent it from appearing in prompts, command output, logs, exceptions, or user-visible responses.
  6. Grant the Feishu application only the minimum API scopes and resource access required for document search.
  7. Where feasible, use separate credentials for development, testing, and production.
  8. Add automated secret scanning to pre-commit hooks and CI pipelines, and block releases containing credential patterns.
  9. Treat the exposed credential as compromised even if the repository or package was intended to be private.
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Natural-Language Policy Violations

Critical
Category
Not specified by scanner
Confidence
100% confidence
Finding

A plaintext App Secret is embedded directly in the skill documentation. This is a direct credential disclosure that can be immediately abused to mint access tokens, impersonate the application, and access protected Feishu resources.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level description says the skill should trigger whenever a user expresses search or knowledge-query intent, which is extremely broad for a tool with document access and forwarding behavior. Over-broad activation increases the chance that unrelated or sensitive conversations are captured, processed, and possibly routed to external spaces or bots unintentionally.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Generic trigger phrases such as '文档', '资料', '知识库', '手册', and '指南' can match many ordinary conversations with little evidence the user intended this skill. Because the skill can read internal documents and disclose stored configuration, accidental invocation expands unnecessary data exposure risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill claims to search only within a configured Feishu document space, but also defines behavior to forward certain user questions to a separate technical bot/person. That creates an undocumented data flow beyond the declared search boundary and can expose user queries or sensitive context to another principal without explicit user consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill embeds a live-looking App ID and plaintext App Secret together with token-retrieval instructions. Exposing credentials in documentation enables anyone with access to the skill file to obtain access tokens and interact with Feishu APIs as the app, potentially accessing or modifying sensitive tenant data.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The configuration flow instructs the assistant to echo back full user-provided document links and related configuration values in chat. Re-displaying internal URLs and structure can leak sensitive workspace locations to anyone viewing the conversation and increases inadvertent data exposure in shared channels.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill describes automatic forwarding of technical questions to another bot/person but does not prominently warn users in the skill description or at trigger time. Users may disclose sensitive operational details believing the query stays within the current assistant, when it may actually be transmitted to another recipient.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill allows natural-language requests like '查看配置' to reveal stored configuration, including internal document root URLs and keywords, without any mention of authorization checks. In shared or compromised chat contexts, this can disclose internal repository locations and search scope details to unauthorized users.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documented core principle says the assistant only searches within the configured document space, yet earlier sections instruct it to forward technical questions externally. This inconsistency can mislead users and reviewers about where their data goes, undermining trust boundaries and increasing the chance of unauthorized disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document includes credential handling and API access instructions without any warning about secret management or the sensitivity of accessed document content. Combined with exposed credentials, this normalizes unsafe handling of privileged access and can lead users or operators to misuse tokens and retrieve sensitive data insecurely.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 328)May include surrounding context.

获取 tenant_access_token:

bash
curl -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
  -H "Content-Type: application/json" \
  -d '{"app_id":"cli_a932525f7ef99bd4","app_secret":"w3RGN8nNkpUEcTUTJsq8vdQugdSKMxL8"}'

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This manifest file defines very generic trigger terms such as "运营", "活动", "数据", and "营销", plus a broad semantic trigger covering "App运营相关的数据、活动、推广、用户增长等问题". These terms overlap with common business discussions and the file does not provide sufficiently narrow constraints or negative examples for the main skill trigger, increasing the risk of accidental activation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language configuration specifies Chinese response behavior ("专业简洁,引用原文") and a Chinese not-found message, with no indication that users may choose another language or opt in to this locale. This can violate language/locale policy when the skill is used by users who have not explicitly selected Chinese.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The configuration explicitly gives the owner 'full_access' and says they can ask 'any question', which exceeds the skill’s declared purpose of searching a specific Feishu document space. This creates a policy bypass path where scope restrictions may be ignored for one identity, increasing the risk of unauthorized use, prompt abuse, or data handling outside the documented boundaries.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This configuration allows certain queries to be forwarded to an external technical bot, which expands the skill from a single-space document searcher into a cross-agent routing mechanism. That introduces data-flow and trust-boundary risks, because user prompts or retrieved content may be shared with another bot not covered by the original skill description or user expectations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The 'tech_collaboration' block defines cross-bot collaboration rules that are not justified by a document-search assistant’s stated role. This broadens the attack surface by enabling delegated handling of technical questions, potentially leaking sensitive business context or allowing the skill to act beyond its least-privilege search function.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.