Back to skill

Security audit

Feishu API Lookup

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a Feishu API lookup guide, but it also tells agents to read local Feishu app secrets and use them for live authenticated tenant API calls without clear user consent or scoping.

Review before installing. Use this only if you are comfortable with an agent seeing Feishu app credentials and potentially making authenticated tenant API calls. Prefer removing or ignoring the local credential-reading snippet, use placeholders or a dedicated secret manager, and require explicit confirmation before any token request or write-capable Feishu API call.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:86
Finding

Unnecessary Access to Privileged Feishu Application Credentials

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 86–96
Vulnerability Type: Violation of least privilege through local credential access
Risk Level: Medium

Vulnerable Code

python
with open('/root/.openclaw/openclaw.json') as f:
    cfg = json.load(f)
app_id = cfg['channels']['feishu']['appId']
app_secret = cfg['channels']['feishu']['appSecret']

req = urllib.request.Request(
    'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal',
    data=json.dumps({"app_id": app_id, "app_secret": app_secret}).encode(),
    headers={"Content-Type": "application/json"}
)
token = json.loads(urllib.request.urlopen(req).read())['tenant_access_token']

Technical Analysis

The Skill is declared as a tool for looking up publicly available Feishu API documentation through web search and page retrieval. That task does not require tenant authentication or access to local application credentials.

However, the authentication section instructs the Agent to open the root-owned OpenClaw configuration file, extract the Feishu application ID and secret, and transmit those credentials to Feishu's tenant-token endpoint. This gives the executing process access to sensitive credentials and creates a tenant bearer token that can be used with the configured application's authorized API scopes.

The network destination shown is the official open.feishu.cn service, and the exchange is part of Feishu's normal authentication flow. Therefore, the reviewed content does not establish malicious exfiltration to an attacker-controlled destination. The security issue is that this sensitive operation exceeds the minimum privileges required for the Skill's declared documentation-lookup functionality.

The generic authenticated-request example later in the file allows the resulting token to be supplied to arbitrary Feishu API paths. Depending on the application's assigned scopes, this may permit both data retrie ...[truncated 1762 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the credential-reading and tenant-token acquisition example from this documentation-lookup Skill.
  2. Keep the Skill limited to public documentation operations such as web_search and web_fetch.
  3. Move authenticated API execution into a separate Skill whose declared purpose explicitly includes acting on Feishu resources.
  4. If authentication must be documented, use nonfunctional placeholders such as FEISHU_APP_ID and FEISHU_APP_SECRET; do not direct the Agent to a root-owned configuration file.
  5. Retrieve secrets through an approved secret-management interface rather than reading the complete OpenClaw configuration.
  6. Require explicit user confirmation before accessing credentials, obtaining a tenant token, or making an authenticated API request.
  7. Restrict the Feishu application to the narrowest API scopes needed for the requested operation.
  8. Prefer read-only scopes and endpoints unless the user explicitly requests a mutation.
  9. Avoid displaying, logging, or persisting application secrets and bearer tokens.
  10. Validate requested API paths against an allowlist if authenticated execution is supported.
  11. Rotate the application secret if there is evidence that it has been exposed outside the intended runtime.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly directs access to a local config file containing appId and appSecret, even though its declared purpose is only documentation lookup. Accessing sensitive local credentials without a strong functional need violates least privilege and can enable secret theft, token minting, and follow-on access to Feishu tenant resources if the skill is misused or prompt-injected.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is presented as a documentation lookup tool, but it goes beyond passive retrieval by instructing the agent to read local Feishu credentials and perform authenticated API calls. This creates an unjustified privilege expansion: a user invoking a doc-search skill could indirectly trigger access to secrets and live tenant operations, increasing the risk of credential exposure, unintended data access, or unauthorized actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill normalizes sensitive credential handling by reading secrets from local storage and sending them to a remote token endpoint, but provides no warning, consent boundary, or handling constraints. Even if the endpoint is legitimate, this pattern encourages silent exfiltration of credentials from the local environment and makes accidental leakage or abuse more likely in an agentic context.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.