Back to skill

Security audit

opclawtm CLI

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a legitimate opclawtm setup guide, but it asks users to grant very broad Feishu permissions and handle secrets/log identifiers with too little scoping or safety guidance.

Review this skill before installing. Only use it in a Feishu/OpenClaw environment where you are authorized to create apps, bind users, and grant organization permissions. Reduce Feishu scopes to the minimum needed, avoid granting delete/offline/user-context permissions unless required, protect App Secrets and logs, and avoid running the global npm install with administrator privileges unless you have verified the package source.

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

T08 · Insecure Dependencies

Error
Location
references/installation-flow.md:23
Finding

Unpinned Global Installation of an Unreviewed npm Package

Content
View full analysis

Vulnerability Details

File Location: references/installation-flow.md:23-28
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: High

Complete Code Snippet:

bash
npm install -g opclawtm

A secondary installation path also uses an alternative registry:

bash
npm install -g opclawtm --registry=https://registry.npmmirror.com

Technical Analysis

The Skill instructs the agent to install the latest available version of opclawtm globally without specifying an exact version or validating package integrity. npm installation can execute package lifecycle scripts, including preinstall, install, and postinstall. Consequently, code absent from this audited repository may run on the host during installation.

Global installation increases the effect of a compromised dependency by placing executables in a system-wide or user-wide command path. The accompanying instructions also recommend administrator privileges when permission errors occur, which could cause lifecycle scripts to execute with elevated operating-system permissions.

The fallback to registry.npmmirror.com creates an additional supply-chain trust boundary. The repository contains no lockfile, checksum, signature, package provenance verification, or source code for the installed CLI.

Attack Path

  1. An attacker compromises the opclawtm npm package, its publisher account, a transitive dependency, or a registry distribution path.
  2. The attacker publishes a modified version containing a malicious npm lifecycle script or CLI executable.
  3. A user or agent follows the Skill and runs the unpinned global installation command.
  4. npm downloads the attacker-controlled current version and executes its lifecycle scripts.
  5. If the installation is run with administrator privileges as suggested by the documentation, the payload inherits those elevated privileges.
  6. The installed executable remain ...[truncated 614 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the dependency to a reviewed exact version, such as opclawtm@X.Y.Z.
  2. Record and verify the package integrity hash before installation.
  3. Use the official npm registry unless an alternative registry has been formally assessed and approved.
  4. Publish or vendor the CLI source and its dependency lockfile so its runtime behavior can be audited.
  5. Verify npm provenance signatures and publisher identity in an automated installation wrapper.
  6. Avoid global installation where possible. Install into an isolated project, container, or restricted service account.
  7. Do not recommend administrator privileges as a generic response to installation failures.
  8. Disable lifecycle scripts during initial inspection with npm install --ignore-scripts, inspect the package, and only permit required scripts after review.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/feishu-config-flow.md:51
Finding

Feishu Configuration Requests Permissions Beyond the Stated Bot Workflow

Content
View full analysis

Vulnerability Details

File Location: references/feishu-config-flow.md:51-147
Vulnerability Type: Excessive OAuth and application permissions
Risk Level: High

Complete Code Snippet:

json
{
  "scopes": {
    "tenant": [
      "contact:contact.base:readonly",
      "docx:document:readonly",
      "im:chat:read",
      "im:chat:update",
      "im:message.group_at_msg:readonly",
      "im:message.p2p_msg:readonly",
      "im:message.pins:read",
      "im:message.pins:write_only",
      "im:message.reactions:read",
      "im:message.reactions:write_only",
      "im:message:readonly",
      "im:message:recall",
      "im:message:send_as_bot",
      "im:message:send_multi_users",
      "im:message:send_sys_msg",
      "im:message:update",
      "im:resource",
      "application:application:self_manage",
      "cardkit:card:write",
      "cardkit:card:read"
    ],
    "user": [
      "contact:user.employee_id:readonly",
      "offline_access",
      "base:app:copy",
      "base:field:create",
      "base:field:delete",
      "base:field:read",
      "base:field:update",
      "base:record:create",
      "base:record:delete",
      "base:record:retrieve",
      "base:record:update",
      "base:table:create",
      "base:table:delete",
      "base:table:read",
      "base:table:update",
      "base:view:read",
      "base:view:write_only",
      "base:app:create",
      "base:app:update",
      "base:app:read",
      "board:whiteboard:node:create",
      "board:whiteboard:node:read",
      "calendar:calendar:read",
      "calendar:calendar.event:create",
      "calendar:calendar.event:delete",
      "calendar:calendar.event:read",
      "calendar:calendar.event:reply",
      "calendar:calendar.event:update",
      "calendar:calendar.free_busy:read",
      "contact:contact.base:readonly",
      "contact:user.base:readonly",
  
...[truncated 3755 chars]
Remediation
View remediation

Remediation Suggestions

  1. Create a documented capability-to-scope matrix and grant only scopes required by each bot role.
  2. Remove user-token scopes when bot-level permissions can satisfy the workflow.
  3. Remove offline_access unless persistent user authorization is essential and explicitly disclosed.
  4. Remove document deletion, movement, file transfer, calendar mutation, Base mutation, Wiki mutation, task mutation, system-message, recall, and application self-management permissions unless each has a reviewed requirement.
  5. Separate bots by role and use distinct minimal permission profiles rather than importing one broad profile for every agent.
  6. Require tenant administrators to review the final scope diff before publishing each application.
  7. Store App Secrets and tokens in an operating-system credential vault or dedicated secret manager, never in plaintext configuration or logs.
  8. Encrypt credentials at rest, restrict file permissions, rotate secrets regularly, and provide immediate revocation procedures.
  9. Audit all API activity and alert on deletion, bulk download, user-context messaging, and other high-risk operations.
  10. Publish documentation explaining credential storage, token refresh behavior, remote endpoints, and data retention.

T09 · Insecure Skill Coding Practices

Warning
Location
references/feishu-config-flow.md:269
Finding

Unscoped Gateway Log Search Can Expose or Misbind Feishu User Identifiers

Content
View full analysis

Vulnerability Details

File Location: references/feishu-config-flow.md:269-287
Vulnerability Type: Unsafe extraction and disclosure of identifiers from shared logs
Risk Level: Medium

Complete Code Snippet:

bash
cat ~/.openclaw/logs/gateway.log | grep "ou_"

The workflow then instructs the agent to display every matching ou_ identifier to the user and use an identifier for account binding.

Technical Analysis

The command scans the entire gateway log for the generic Feishu Open ID prefix. It does not constrain the search by timestamp, current pairing code, bot, chat, tenant, expected user, or authenticated session.

If the gateway has processed events from multiple users, groups, or bots, the command can return several unrelated Open IDs. Since grep prints complete matching lines by default, adjacent log fields may also be exposed. The instruction to display the results directly can disclose identifiers or other log metadata that are not necessary for the current binding operation.

The absence of identity correlation also creates an integrity risk: an operator may select an unrelated Open ID and bind the wrong Feishu user to a local agent or account.

Attack Path

  1. The gateway processes messages from multiple Feishu users and writes their events to a shared log.
  2. One or more log entries contain each sender's ou_ Open ID and potentially other event metadata.
  3. The agent runs the broad grep command while assisting one user.
  4. Every matching line is returned without filtering by the active pairing session.
  5. Unrelated identifiers or adjacent log details are displayed to the current user.
  6. The operator may select the wrong identifier during TUI binding.
  7. Subsequent authorization or routing decisions may be associated with the wrong Feishu identity.

Impact Assessment

Exploitation or accidental misuse may disclose Feishu user identifiers and any additional data pre ...[truncated 380 chars]

Remediation
View remediation

Remediation Suggestions

  1. Obtain the Open ID from an authenticated Feishu API response or the structured event associated with the active pairing transaction.
  2. Correlate identity using the pairing code, application ID, tenant, bot, chat, timestamp, and expected user.
  3. Parse structured logs rather than searching arbitrary text with grep.
  4. Return only the required identifier and redact message contents, tokens, secrets, and unrelated metadata.
  5. If multiple candidates exist, stop the binding process rather than asking the operator to guess.
  6. Require the user to confirm the binding through the same authenticated Feishu account.
  7. Restrict gateway log permissions to the gateway service account and authorized administrators.
  8. Apply log minimization, redaction, rotation, and retention controls.
  9. Record an auditable binding event containing the correlation method without storing unnecessary message content.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill guides actions that can modify real systems, including creating teams, binding bots and chat groups, linking user IDs, and activating accounts, but it does not prominently warn users that these are external, potentially irreversible changes. In this context, the missing warnings make accidental misconfiguration more likely and are more dangerous because the skill explicitly targets organizational collaboration setup across an external platform (Feishu).

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger list includes generic phrases such as authorization/configuration problems and private skill creation, which can cause the skill to activate in conversations where the user did not intend to operate this specific tool. Because the skill can lead an agent toward account setup, team initialization, and Feishu integration workflows, unintended activation increases the chance of confusing or unsafe actions in the wrong context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file is written as a directive to the AI agent entirely in Chinese, beginning with '你是 AI Agent', and does not provide any user choice or opt-in regarding language. Under the policy, forcing a specific language without user selection is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The guide tells users to copy the App Secret and paste it into the TUI without any warning about secret handling, storage, masking, or avoiding transcript/log exposure. Secrets entered into interactive tools can be leaked through shell history, screenshots, logs, or shared terminals if the workflow does not explicitly protect them.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly instructs the agent/operator to read local gateway logs and grep for ou_ identifiers, then display those IDs to the user. This creates an unnecessary access path to local log data and can expose identifiers or adjacent sensitive log content outside the minimum required setup flow, especially if logs contain data from other users or sessions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instructions direct reading gateway logs to extract ou_ Open IDs and showing them to the user, but provide no privacy notice, consent step, or data-minimization boundary. Even if Open IDs are not full credentials, they are user-linked identifiers and their disclosure from logs can violate privacy expectations and normalize unsafe log inspection practices.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document instructs an agent to run a global package installation command (npm install -g opclawtm) without any warning that it will modify the system, fetch code from the network, and execute npm lifecycle behavior in the user's environment. In an agent setting, this is risky because it can lead to unreviewed software installation and supply-chain exposure, especially when the agent may execute commands on behalf of the user rather than merely suggesting them.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions are overly broad and include common natural-language phrases like “我想要...” and “我需要一个...”, which can cause the skill to activate during ordinary conversation rather than only during explicit skill-creation or requirement-analysis requests. In this workflow, unintended activation could route user messages into task creation or requirement-analysis flows, causing confusion, misclassification of intent, or accidental downstream actions through the assistant/team workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instructions explicitly tell the agent to have the user enter the assistant name in Chinese ("可用中文") and later discourage manual ID entry to avoid Chinese input issues, while the entire workflow is presented only in Chinese. This creates a language/locale constraint without any user opt-in or justification that the skill is region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guide explicitly instructs the agent to read local gateway logs, extract ou_ user identifiers, and directly reveal them to the user. Even if intended for troubleshooting, this encourages disclosure of potentially sensitive identifiers from logs without verifying authorization, minimizing disclosure, or warning about privacy implications; in an agent workflow, such instructions can normalize data exfiltration from local artifacts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The entire skill is presented only in Chinese and directs the agent's behavior in that language, with no indication that the user can choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language instructions throughout the file are entirely in Chinese and are framed as the operative guidance for the agent, with no indication that users may choose another language. Under the language/locale policy, forcing a specific language without user opt-in is a policy concern unless clearly justified.

Content

No source excerpt is available for this finding.