Back to skill

Security audit

Anygen Workflow Generate

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent content-generation workflow, but its Feishu/Lark delivery path directly reads local app secrets and uses raw API calls without clear user consent or secret-handling safeguards.

Review this skill carefully before installing. It will send prompts and reference files to Anygen, and its Feishu/Lark path may read local app credentials and use them to upload and send files. Only use it in an environment where those credentials are intended for agent use, logs are protected, and the @anygen/cli package source and version are acceptable.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:74
Finding
Unsafe Extraction and Handling of Feishu Application Credentials## Vulnerability Details **File Location**: `SKILL.md`, lines 74–76 **Vulnerability Type**: Plaintext credential exposure and excessive secret access **Risk Level**: High **Vulnerable Code**: ```markdown **Feishu/Lark** (message tool corrupts non-ASCII filenames, use curl instead): 1. Get credentials: read `app_id` and `app_secret` from the config file (e.g. `cat ~/.openclaw/openclaw.json | jq '.channels.feishu'` instead of `openclaw config get`). Make sure to use the credentials matching the current account. 2. Get token: `curl -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>"}'` ``` ### Technical Analysis The workflow directs the agent to read the entire `.channels.feishu` configuration object from `~/.openclaw/openclaw.json`, including the plaintext `app_secret`, and then interpolate that secret into a command-line request. This handling pattern violates least-exposure principles. Sensitive values may enter the agent context, tool-call records, shell history, process-monitoring output, debugging logs, or audit transcripts. Reading the complete Feishu channel configuration also accesses more data than is strictly necessary to obtain the two required fields. Although the request is sent to the official `open.feishu.cn` endpoint, the local secret-handling method creates a credential-disclosure risk independent of transport security. ### Attack Path 1. A user invokes the Skill and requests delivery through Feishu/Lark. 2. The agent executes the prescribed command to read `.channels.feishu` from `~/.openclaw/openclaw.json`. 3. The Feishu application ID and secret are returned through the command or tool context. 4. The agent embeds the secret in the `curl` command body. 5. A party with access to agent transcripts, tool logs, shell history, process arguments, or debugging output obtains the ...[truncated 820 chars]
Remediation
## Remediation Suggestions 1. Use the platform-native authenticated messaging interface instead of manually retrieving and transmitting application credentials. 2. Store credentials in a dedicated secret manager or protected credential provider rather than a general configuration file. 3. Retrieve only the exact required values; do not print or return the complete Feishu channel configuration. 4. Pass secrets through protected environment variables, standard input, or an API client that prevents their appearance in process arguments. 5. Disable shell tracing and command echoing for credential-bearing operations, and prevent sensitive commands from being written to shell history. 6. Redact `app_secret`, access tokens, and related authorization values from tool output, logs, exceptions, and agent transcripts. 7. Apply restrictive filesystem permissions to credential storage and restrict access to the account executing the Skill. 8. Grant the Feishu application only the minimum API scopes required for file delivery. 9. Rotate the application secret if the existing workflow has already exposed it through logs or transcripts.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:8
Finding
Unpinned Executable npm Dependency## Vulnerability Details **File Location**: `SKILL.md`, lines 8–12 **Vulnerability Type**: Unpinned third-party executable dependency **Risk Level**: Medium **Vulnerable Code**: ```yaml install: - id: node kind: node package: "@anygen/cli" bins: ["anygen"] ``` ### Technical Analysis The Skill declares the executable npm package `@anygen/cli` without an exact version or integrity hash. Consequently, installation may resolve to a future mutable release that was not represented in or reviewed with this project. npm packages may execute code during installation through lifecycle scripts and later when their binaries are invoked. If the package, publisher account, release pipeline, or a transitive dependency is compromised, malicious code could run with the permissions of the user installing or invoking the Skill. No evidence establishes that the current `@anygen/cli` package is malicious. The vulnerability is the absence of dependency pinning and integrity controls, which leaves the effective executable implementation outside the reviewed artifact and allows it to change after audit. ### Attack Path 1. An attacker compromises the package publisher, release pipeline, registry account, or a transitive dependency. 2. The attacker publishes a malicious release that satisfies the unversioned `@anygen/cli` dependency declaration. 3. A user installs or reinstalls the Skill after the malicious release becomes the package manager’s resolved version. 4. The malicious package executes through an npm lifecycle script or when the `anygen` binary is invoked. 5. The package accesses resources available to the executing account, potentially including `ANYGEN_API_KEY`, input files, generated artifacts, user configuration, and network connectivity. 6. Stolen data or credentials are transmitted to an attacker-controlled destination, or local files are modified within the user’s permission boundary. ### Impact Assess ...[truncated 541 chars]
Remediation
## Remediation Suggestions 1. Pin `@anygen/cli` to a reviewed exact version rather than using an unconstrained package reference. 2. Commit and enforce a lockfile that pins all transitive dependencies. 3. Verify package integrity with registry-provided cryptographic hashes and trusted provenance or signed attestations. 4. Review the package’s lifecycle scripts and disable installation scripts where they are not required. 5. Install and execute the CLI in a restricted environment with minimal filesystem, credential, and network access. 6. Run automated dependency vulnerability and provenance checks before accepting upgrades. 7. Require explicit review and testing for every dependency version change. 8. Avoid exposing `ANYGEN_API_KEY` to installation processes and provide it only to the runtime command that requires it.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: anygen-workflow-generate
version: 1.0.0
description: "AI-powered content creation suite. Create slides/PPT, documents, diagrams, websites, data visualizations, research reports, storybooks, financial analysis, and images. Supports: pitch decks, keynotes, technical docs, PRDs, white papers, architecture diagrams, flowcharts, mind maps, org charts, ER diagrams, sequence diagrams, UML, landing pages, CSV analysis, earnings research, posters, banners, comics, and more."
metadata:
  requires:
    bins: ["anygen"]
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.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The skill description is extremely broad and can match many ordinary user requests, increasing the chance the agent invokes this skill in contexts far beyond tightly scoped content generation. Over-broad routing is dangerous because it widens exposure to the skill's more sensitive behaviors, including file upload, task creation, and external delivery flows.

External Transmission

Medium
Category
Data Exfiltration
Content
- Schema: run `anygen schema <resource.method>` to check required params and response if needed.
- Long-running: `--wait` commands will block, MUST use `sessions_spawn` to run in the background.
- Sending files on Feishu/Lark: Do not use the message tool to send files. It corrupts non-ASCII filenames into `%XX` garbage. Strictly follow the curl process in "Sending files".

## Steps
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
97% confidence
Finding
The skill instructs the agent to read Feishu app credentials from a local config file and use them to obtain access tokens for direct API calls. This exceeds the core content-generation function and creates a clear path for credential access and external use of privileged secrets, which could expose internal messaging capabilities or enable unauthorized data transfer.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The instructions describe reading credentials and sending data to Feishu APIs without an explicit user-facing warning that local secrets will be accessed and generated files transmitted to an external service. Users may not understand that account-level credentials are being used or that content is leaving the local environment, creating consent, privacy, and secret-handling risks.

External Transmission

Medium
Category
Data Exfiltration
Content
**Feishu/Lark** (message tool corrupts non-ASCII filenames, use curl instead):
1. Get credentials: read `app_id` and `app_secret` from the config file (e.g. `cat ~/.openclaw/openclaw.json | jq '.channels.feishu'` instead of `openclaw config get`). Make sure to use the credentials matching the current account.
2. Get token: `curl -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>"}'`
3. Upload + Send per file type:
   - **Images** (thumbnail, png, jpg, etc.):
     Upload: `curl -X POST 'https://open.feishu.cn/open-apis/im/v1/images' -H 'Authorization: Bearer <tenant_access_token>' -F 'image_type=message' -F 'image=@./preview.png'`
Confidence
96% confidence
Finding
The skill directs the agent to send app credentials to Feishu's token endpoint to obtain a bearer token for subsequent uploads and message sends. This is dangerous because it operationalizes external transmission using sensitive local secrets and can enable unauthorized messaging, data exfiltration, or misuse of the connected workspace if the workflow is triggered inappropriately.

Static analysis

No suspicious patterns detected.