Back to skill

Security audit

快速配置新的agent

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to manage Feishu bot configuration as advertised, but it stores secrets in plaintext, opens bot access broadly by default, and restarts the gateway automatically.

Install only if you are comfortable with it changing your OpenClaw configuration and restarting the gateway. Use restrictive DM policies or allowlists, protect ~/.openclaw/openclaw.json and backups, avoid putting real App Secrets in shell history, and rotate secrets if they may have been exposed.

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

Error
Location
index.js:128
Finding

New Feishu bot accounts default to unrestricted direct-message access

Content
View full analysis

Vulnerability Details

File Location: index.js:128-133
Vulnerability Type: Insecure access-control defaults
Risk Level: High

Vulnerable Code

js
config.channels.feishu.accounts[accountId] = {
  appId: appid,
  appSecret: appsecret,
  botName: botname || 'Feishu Bot',
  dmPolicy: options.dmpolicy || 'open',
  allowFrom: ['*'],
  enabled: true
};

Technical Analysis

Every newly created Feishu account defaults to dmPolicy: 'open' and receives the wildcard authorization setting allowFrom: ['*']. This is a fail-open configuration that does not follow least-privilege principles.

Although the command accepts a --dm-policy option, the allowlist remains ['*'] regardless of the selected policy. The implementation also does not require the operator to confirm the security implications of unrestricted access or provide trusted Feishu user identifiers.

The account may subsequently be bound to an Agent:

js
if (mode === 'account' && agentid) {
  config.bindings.push({
    agentId: agentid,
    match: {
      channel: 'feishu',
      accountId: accountId
    }
  });
}

Consequently, an externally reachable bot can pass messages from untrusted Feishu users to the selected Agent.

Attack Path

  1. An operator runs the Skill without explicitly supplying a restrictive DM policy.
  2. The Skill creates the account with dmPolicy: 'open' and allowFrom: ['*'].
  3. The operator binds the account to an Agent and the Skill restarts the Gateway.
  4. An untrusted user discovers or otherwise reaches the Feishu bot.
  5. The user sends direct messages containing requests or prompt-injection content.
  6. The open policy permits the messages to reach the bound Agent.
  7. The attacker can exercise whatever conversational functions, tools, or data access that Agent exposes, subject to the Agent's own permissions and safeguards.

Impact Assessment

The immed ...[truncated 417 chars]

Remediation
View remediation

Remediation Suggestions

  1. Change the default DM policy from open to pairing or a deny-by-default allowlist.

  2. Do not assign allowFrom: ['*'] automatically. Require explicit trusted Feishu user IDs when allowlist is selected.

  3. Reject unsupported policy values and apply the existing validation module during configuration creation.

  4. Require a clear, explicit high-risk confirmation before allowing the combination of dmPolicy: 'open' and wildcard access.

  5. Generate policy-specific configuration, for example:

    js
    const allowedPolicies = new Set(['pairing', 'allowlist', 'open']);
    const dmPolicy = options.dmpolicy || 'pairing';
    
    if (!allowedPolicies.has(dmPolicy)) {
      throw new Error('Unsupported DM policy');
    }
    
    if (dmPolicy === 'allowlist' && trustedUsers.length === 0) {
      throw new Error('At least one trusted user is required');
    }
    
    const account = {
      appId: appid,
      appSecret: appsecret,
      botName: botname || 'Feishu Bot',
      dmPolicy,
      enabled: true
    };
    
    if (dmPolicy === 'allowlist') {
      account.allowFrom = trustedUsers;
    }
    
  6. Validate the final configuration before writing it and abort safely if its access policy is inconsistent.

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:65
Finding

Feishu App Secrets are accepted through command-line arguments and replicated in plaintext backups

Content
View full analysis

Vulnerability Details

File Location: index.js:65-71, index.js:125-134, and index.js:226-242
Vulnerability Type: Insecure secret handling and plaintext credential storage
Risk Level: Medium

Vulnerable Code

The complete configuration is copied to a timestamped backup:

js
function createBackup() {
  try {
    if (!fs.existsSync(BACKUP_DIR)) {
      fs.mkdirSync(BACKUP_DIR, { recursive: true });
    }
    const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
    const backupPath = path.join(BACKUP_DIR, `openclaw.json.${timestamp}`);
    fs.copyFileSync(CONFIG_PATH, backupPath);
    return backupPath;

The supplied secret is stored directly in the configuration:

js
config.channels.feishu.accounts[accountId] = {
  appId: appid,
  appSecret: appsecret,
  botName: botname || 'Feishu Bot',
  dmPolicy: options.dmpolicy || 'open',
  allowFrom: ['*'],
  enabled: true
};

The interface instructs operators to pass the secret as a process argument:

js
--app-secret <secret>  飞书 App Secret (必填)
js
node index.js --app-id cli_xxx --app-secret yyy --agent-id recruiter --routing-mode account

Technical Analysis

Command-line arguments are an unsuitable channel for long-lived credentials. Depending on the host environment, the App Secret may be retained in shell history, process-monitoring records, terminal logs, diagnostic output, or process metadata visible to other sufficiently privileged local users.

The application also stores the secret in plaintext inside openclaw.json. On each later run, createBackup() copies the existing complete configuration into a timestamped file. Therefore, credentials already present in the configuration are replicated into the backup directory. A secret added during one run can be copied into a backup by a subsequent run.

No explicit file mode is supplied for either the backup directory or the bac ...[truncated 1682 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not accept App Secrets through ordinary command-line arguments.
  2. Read the secret from a hidden interactive prompt, a protected file descriptor, or an approved secret manager. Environment variables are preferable to command-line arguments only when the deployment environment protects them appropriately.
  3. Remove command examples that place real secrets directly in shell commands.
  4. Create the configuration and backup files with explicit restrictive permissions, such as 0600, and the backup directory with 0700.
  5. Verify and repair permissions on pre-existing files before copying sensitive data.
  6. Implement a defined backup retention limit and securely remove expired backups.
  7. Encrypt credential-bearing backups or omit secrets from ordinary backups when a secure credential recovery mechanism exists.
  8. Avoid printing, logging, or embedding the App Secret in errors and status output.
  9. Consider storing only a secret reference in openclaw.json, with the actual value held by an operating-system keychain or dedicated secret manager.
  10. Document credential rotation procedures for cases where process arguments, shell history, or backup files may already have exposed a secret.
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
80% confidence
Finding

The skill handles highly sensitive credentials such as Feishu App Secret and describes modifying runtime configuration and restarting a gateway, yet it declares no explicit tool scope or permissions. If the runtime infers or grants environment access implicitly, the skill may read or expose secrets from env or operate with broader privileges than users expect, increasing the chance of credential leakage or unauthorized configuration changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill stores the provided Feishu App Secret directly into ~/.openclaw/openclaw.json and does so without any warning about plaintext persistence, file sensitivity, or permission hardening. This creates credential exposure risk if the config file is readable by other local users, included in backups, or later exfiltrated through unrelated compromise.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill modifies persistent configuration and then invokes external OpenClaw CLI commands, including a gateway restart, as part of normal execution. Even though the command strings are hardcoded and not obviously shell-injected, this still expands the skill’s side effects beyond configuration editing and can disrupt service availability or apply unexpected system-wide changes when the user only intended to update bot settings.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill performs an automatic gateway restart immediately after updating configuration, without prior explicit consent from the operator. In a bot-management context this can interrupt active service, break ongoing sessions, or create a denial-of-service condition if triggered unexpectedly or repeatedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This file contains natural-language comments and error strings exclusively in Chinese, such as configuration error messages that may be surfaced to users or operators. Under the policy, forcing a specific language without user opt-in or documented locale justification is a language/locale policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest description is written only in Chinese ("飞书多账户机器人配置管理") with no indication that the skill is region-specific or that users may choose another language. Under the policy, forcing a specific language without opt-in can be a natural-language locale violation.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
86% confidence
Finding

The dependency uses a caret range (^1.3.0), which allows installation of newer compatible releases without explicit review. This can introduce supply-chain risk if an upstream package publishes a malicious or breaking version, although in this specific file the risk is somewhat limited because the only listed package is a common library and the package manifest itself contains no additional suspicious signals.

Content

Scanner excerpt · package.json (reported line 10)May include surrounding context.

json
"start": "node index.js"
  },
  "dependencies": {
    "readline": "^1.3.0"
  }
}