Back to skill

Security audit

Weekly Menu 每周菜单

Security checks for vulnerabilities and agentic risk

Overview

The skill’s meal-planning goal is legitimate, but it asks the agent to handle Feishu credentials, read general memory for a folder token, and exposes document delete/move API examples without sufficient scoping or user control.

Review this skill carefully before installing. It is not clearly malicious, but only use it if you are comfortable with it reading meal preferences, making external recipe searches, creating and editing Feishu documents, and handling Feishu credentials. Prefer moving Feishu credentials and folder tokens into a scoped connector or secret store, narrowing activation to explicit weekly-menu document requests, and removing the delete/move API examples unless they become explicit user-confirmed features.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:87
Finding
Broad Agent Memory Access for Feishu Folder Configuration<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:87-91`; `references/feishu-doc-recipe.md:17-20` **Vulnerability Type**: `T05: Unauthorized Access and Privilege Escalation` **Risk Level**: Medium ### Vulnerable Code Snippet From `SKILL.md:87-91`: ```markdown | Key | Location | Description | |-----|----------|-------------| | User profile | `meals/profile.yaml` | Taste preferences and constraints | | Receipts folder | Feishu drive | Token stored in MEMORY.md | | Meal history | `meals/history.yaml` | Past menus to avoid repeats | ``` From `references/feishu-doc-recipe.md:17-20`: ```markdown ## 2. Create Document Receipts folder token: check MEMORY.md for `receipts 文件夹 token`. ``` ### Technical Analysis The skill directs the agent to inspect the general-purpose `MEMORY.md` persistent-memory file to obtain a Feishu folder token. A general memory file may contain unrelated conversation state, identifiers, credentials, private user details, or persistent instructions. Reading the entire resource for one configuration value violates least-privilege and data-minimization principles. The folder token is legitimately needed to place the generated document in the requested directory. The weakness is not the use of that token itself, but the instruction to retrieve it from a broad persistent-memory resource rather than a dedicated configuration or secret store. No evidence shows that the skill explicitly transmits unrelated memory contents or intentionally abuses them. Nevertheless, loading those contents into the active agent context makes them available to later model reasoning, search operations, or API requests. ### Attack Path 1. A user activates the weekly-menu skill. 2. The skill instructs the agent to locate the receipts-folder token in `MEMORY.md`. 3. The agent reads the general memory resource rather than a narrowly scoped configuration entry. 4. Unrelated sensitive state enters the active model context. 5. A later prompt, untrusted sea ...[truncated 633 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Move the receipts-folder token into a dedicated, narrowly scoped configuration entry, such as `meals/config.yaml`, with restrictive filesystem permissions. 2. Prefer a platform-managed secret or connector configuration that exposes only the required folder identifier. 3. Do not instruct the agent to read the complete `MEMORY.md` file. 4. If migration cannot occur immediately, use a deterministic parser that retrieves only the named field without placing the rest of the file into the model context. 5. Document the exact configuration field and validate that it contains a correctly formatted Feishu folder token before use. 6. Separate persistent conversational memory from operational configuration and credentials. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
references/feishu-doc-recipe.md:5
Finding
Feishu Application Secret Passed Through a Shell Command<![CDATA[ ## Vulnerability Details **File Location**: `references/feishu-doc-recipe.md:5-13` **Vulnerability Type**: `T09: Insecure Skill Coding Practices` **Risk Level**: High ### Vulnerable Code Snippet ```markdown ## 1. Get Tenant Access Token ```bash 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>"}' ``` Read `app_id` and `app_secret` from `~/.openclaw/openclaw.json` → `channels.feishu.accounts.default`. ``` ### Technical Analysis The documented procedure instructs the agent to read a long-lived Feishu application secret from a local configuration file and interpolate it into curl request arguments. When placeholders are replaced with real values, the secret can become visible in shell command arguments, execution transcripts, debugging output, audit logs, process-monitoring interfaces, or agent tool-call records. The `-s` option only suppresses curl's progress output; it does not protect command arguments or redact the request body. Possession of both the application ID and application secret allows authentication against Feishu's tenant-token endpoint. The resulting tenant access token inherits the application's configured scopes, including the document and drive permissions identified by the skill prerequisites. No hardcoded credential is included in the repository, and the request is sent to the official Feishu API over HTTPS. The vulnerability concerns unsafe runtime handling of the locally stored secret. ### Attack Path 1. The weekly-menu workflow reaches the Feishu document-creation phase. 2. The agent reads `app_id` and `app_secret` from `~/.openclaw/openclaw.json`. 3. The values are substituted into the curl command's JSON argument. 4. The expanded command is exposed through an agent transcript, shell logging, process inspection, debugging telemetry, or another local observation channel. 5. An attacker o ...[truncated 981 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer the platform's native Feishu connector or credential provider so the agent never reads or handles the raw application secret. 2. Store the secret in an operating-system or platform-managed secret store rather than a general JSON configuration file. 3. Use a secret-aware HTTP client that retrieves credentials internally and redacts sensitive request fields from logs and traces. 4. If direct curl use is unavoidable, generate the request body through protected standard input or a temporary file with owner-only permissions rather than embedding the secret in command arguments. 5. Disable shell tracing and command echoing for the authentication operation. 6. Ensure tool-call logs, execution transcripts, error reports, and observability systems redact `app_secret`, authorization headers, and returned access tokens. 7. Delete any temporary credential material immediately after use and prevent it from entering shell history. 8. Grant the Feishu application only the minimum document and drive scopes required by this workflow. 9. Rotate the application secret if it may already have appeared in command logs or transcripts, and review Feishu audit logs for unauthorized token issuance or API activity. ]]>
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Credential Access

High
Category
Privilege Escalation
Content
Step-by-step API calls for creating a weekly menu Feishu document with images.

## 1. Get Tenant Access Token

```bash
curl -s -X POST "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal" \
Confidence
90% confidence
Finding
The reference explicitly walks through obtaining a tenant access token, which is credential use for a multi-tenant enterprise service. In the context of a meal-planning skill, this materially increases risk because the skill couples benign content generation with privileged enterprise API access that can be reused for broader actions.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrases are broad enough to activate on generic food-planning requests, which can cause the skill to run external searches, create files, and write history when the user may have only wanted a simple chat response. In this skill's context, overbroad invocation expands the chance of unnecessary data processing and external actions without sufficiently clear user intent.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill says it will create a user profile if one does not exist and later append menu history, but it does not require explicit notice or consent before persisting personal preference data. Because the profile includes location, household, equipment, spice tolerance, and schedule, silent creation and updating of these files creates a privacy and transparency issue.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill performs Xiaohongshu searches and downloads dish images from external sources without a clear privacy warning to the user. Even if the queries are recipe-related, they may still encode location, preferences, equipment, or other profile-derived attributes and disclose them to third parties without transparency.

Context-Inappropriate Capability

Medium
Confidence
98% confidence
Finding
The skill explicitly indicates that a Feishu drive token is stored in MEMORY.md, which is a poor secret-handling practice unrelated to normal meal-planning behavior. Storing reusable access tokens in general agent memory increases the chance of unintended disclosure to other skills, prompts, logs, or users, and could allow unauthorized access to Feishu documents and drive contents.

External Transmission

Medium
Category
Data Exfiltration
Content
## 1. Get Tenant Access Token

```bash
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>"}'
```
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The guide instructs the agent to read Feishu app credentials from a local configuration file, which is a sensitive credential source not justified within the visible meal-planning logic. Embedding secret-access instructions in a recipe skill expands the skill from content generation into privileged account access and enables unauthorized API use if the skill is invoked broadly.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The instructions direct access to stored Feishu credentials without disclosing that secrets will be read or that external API actions will occur. This undermines informed consent and makes a seemingly harmless meal-planning skill materially more dangerous because it silently leverages persistent credentials.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
Including document deletion capability is beyond the stated purpose of generating a weekly menu and introduces unnecessary destructive power. If the skill or a downstream agent follows this reference, it could delete arbitrary Feishu documents using the same token without user awareness.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
A destructive delete command is presented as routine reference material with no warning, approval requirement, or guardrails. In an agent setting, undocumented destructive actions create a meaningful risk of accidental or abusive document loss.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The profile template sets `country: "CN"` and `timezone: "Asia/Shanghai"` as defaults, which imposes a specific locale on all users of the template. Under the policy criteria, locale constraints should either be optional, user-selected, or clearly documented as region-specific and justified; that is not present here.

Context-Inappropriate Capability

Low
Confidence
88% confidence
Finding
The move-document API exceeds the minimal permissions needed for menu creation and storage, creating an unnecessary ability to reorganize or hide files. While less destructive than deletion, it still allows unintended modification of user data location and workflow state.

Static analysis

No suspicious patterns detected.