Back to skill

Security audit

Alibaba Cloud Platform OpenClaw Setup

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent OpenClaw setup guide, but it steers users toward root-level installs, mutable dependencies, broad messaging access, persistent services, and privileged workspaces that need careful review before use.

Review and harden this before installing on a real host. Use a dedicated unprivileged service account, avoid /root/ as the workspace, pin and verify all packages and plugins, avoid curl-to-bash as root, keep secrets in a protected secret store or chmod 600 config outside the agent workspace, prefer pairing or allowlists for all channels, and inspect the generated service before enabling it.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
Findings (7)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:31
Finding
Root-Level Remote Script Retrieval and Immediate Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:31-33` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```bash ssh root@<server> curl -fsSL https://deb.nodesource.com/setup_20.x | bash - apt-get install -y nodejs ``` ### Technical Analysis The workflow instructs the operator to establish a root SSH session and pipe an externally retrieved script directly into Bash. The downloaded content is neither inspected nor verified using a pinned checksum or cryptographic signature before execution. HTTPS authenticates the connection under normal conditions but does not guarantee that the upstream script is safe, immutable, or uncompromised. Because the command executes as root, any command returned by the endpoint receives unrestricted control over the target host. Installing Node.js is relevant to the declared setup workflow, but executing a mutable remote script as root exceeds the minimum privilege and verification requirements necessary to accomplish that task. ### Attack Path 1. An attacker compromises the upstream host, publishing pipeline, maintainer account, DNS resolution, or another trusted component in the delivery chain. 2. The attacker modifies the response from `https://deb.nodesource.com/setup_20.x`. 3. An operator follows the Skill and executes the response through `bash`. 4. The payload runs with root privileges. 5. The payload can access credentials, modify packages and services, create accounts, alter SSH configuration, or install persistent malware. ### Impact Assessment Successful exploitation provides arbitrary code execution as root and therefore complete control of the target Linux host. The attacker could access OpenClaw and channel credentials, modify system files, intercept future messages, pivot through available SSH or cloud credentials, and establish persistence. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Do not pipe network responses directly into a shell. - Prefer a Node.js version supplied by the operating system's authenticated package repositories. - If NodeSource is required, download a versioned installer or repository configuration as a separate file. - Verify an official cryptographic signature and a pinned checksum before execution. - Inspect the downloaded content before running it. - Perform package installation through narrowly scoped privilege escalation rather than conducting the entire workflow in a root shell. - Pin the expected Node.js major and package versions and document a controlled upgrade process. ]]>

T08 · Insecure Dependencies

Error
Location
SKILL.md:41
Finding
Unpinned OpenClaw and Channel Plugin Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:41-51` **Vulnerability Type**: Unsafe and mutable third-party dependencies **Risk Level**: High ### Vulnerable Code ```bash npm install -g openclaw@latest openclaw --version # DingTalk official connector openclaw plugins install @dingtalk-real-ai/dingtalk-connector --pin # or install from official GitHub repo openclaw plugins install https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git openclaw plugins list | grep dingtalk # Feishu channel openclaw plugins install @openclaw/feishu openclaw plugins list | grep feishu ``` Related dynamic installation guidance appears in `references/channel-discovery.md:31-42`: ```text 1. If docs state channel is built-in: - Do not install plugin. - Configure channel keys and credentials only. 2. If docs provide a plugin package: - Install exactly with documented command. - Verify with `openclaw plugins list`. 3. If docs show interactive onboarding: - Prefer `openclaw onboard` / `openclaw channels add` first. - Use direct JSON edit as fallback for automation. ``` ### Technical Analysis The core package is installed through the mutable `@latest` tag. The Feishu plugin has no explicit version, and the alternative DingTalk installation references a Git repository without an immutable commit hash. Although the DingTalk registry command includes `--pin`, the initially resolved version and integrity are not specified in the audited Skill. The discovery workflow further expands the trust boundary by directing the agent to execute installation commands from online documentation that may change after review. No mandatory source review, integrity verification, signature validation, or administrator approval is required before newly discovered code is installed. Plugins operate within the OpenClaw environment and may inherit access to channel secrets, model API credentials, messages, configuration files, and the configured workspace. ## ...[truncated 977 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pin OpenClaw and every plugin to reviewed, exact versions. - Pin Git-based dependencies to immutable full commit hashes rather than repository default branches. - Verify package integrity hashes and publisher signatures where available. - Maintain an approved package and publisher allowlist. - Review package contents, lifecycle scripts, transitive dependencies, and release provenance before installation. - Replace automatic execution of online documentation commands with a review-and-approval step. - Record approved versions in a lockfile or deployment manifest. - Test upgrades in an isolated environment before production deployment. - Run plugins under a dedicated, unprivileged service account with restricted filesystem and network access. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/config.md:80
Finding
Agent Workspace Grants Access to the Root User’s Home Directory<![CDATA[ ## Vulnerability Details **File Location**: `references/config.md:80-82` **Vulnerability Type**: Excessive filesystem privileges **Risk Level**: Critical ### Vulnerable Code ```json "workspace": "/root/", "compaction": {"mode": "safeguard"}, "maxConcurrent": 4, ``` ### Technical Analysis The configuration assigns `/root/` as the agent workspace. This directory may contain SSH keys, shell history, cloud CLI credentials, deployment files, administrative scripts, and OpenClaw configuration. Providing an AI agent and its plugins general workspace access to this directory violates least privilege because channel messaging and model invocation do not require access to the root administrator's home. The risk is compounded by open channel policies and third-party plugins. Prompt injection or plugin compromise could cause sensitive root-owned data to be read, modified, or used for lateral movement. ### Attack Path 1. An untrusted message reaches the agent through an enabled messaging channel, or an installed plugin is compromised. 2. The malicious input induces file access or the plugin directly traverses the configured workspace. 3. The process reads sensitive files beneath `/root/`, such as SSH or cloud credentials. 4. The credentials are exposed through an agent response, logs, plugin-controlled traffic, or subsequent tool use. 5. The attacker uses the recovered credentials for host compromise or lateral movement. ### Impact Assessment The agent can potentially access all data beneath the root user's home that its runtime account can read or modify. If OpenClaw runs as root as implied by the setup instructions, this can expose administrative credentials and enable modification of privileged files, resulting in full host compromise and access to connected infrastructure. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Run OpenClaw under a dedicated, unprivileged operating-system account. - Replace `/root/` with a dedicated workspace such as `/var/lib/openclaw/workspace` or a restricted directory under the service account's home. - Grant access only to files required for the declared workflow. - Explicitly deny access to SSH keys, shell history, cloud credentials, system configuration, and unrelated user data. - Apply restrictive ownership and permissions to the workspace. - Add service sandboxing controls such as `ProtectSystem`, `ProtectHome`, `PrivateTmp`, `NoNewPrivileges`, and a narrow `ReadWritePaths` list where systemd supports them. - Separate administrative setup operations from the long-running message-processing service. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
references/config.md:98
Finding
Open DingTalk and Feishu Policies Expose the Agent to Untrusted Senders<![CDATA[ ## Vulnerability Details **File Location**: `references/config.md:98-109` **Vulnerability Type**: Unsafe channel access-control defaults **Risk Level**: High ### Vulnerable Code ```json "dingtalk-connector": { "enabled": true, "clientId": "<APP_KEY>", "clientSecret": "<APP_SECRET>", "gatewayToken": "<OPENCLAW_GATEWAY_TOKEN>", "sessionTimeout": 1800000, "dmPolicy": "open", "allowFrom": ["*"] }, "feishu": { "enabled": true, "domain": "feishu", "dmPolicy": "pairing", "groupPolicy": "open", ``` The Feishu guide repeats the open group default at `references/feishu-setup.md:54-60`: ```json "feishu": { "enabled": true, "domain": "feishu", "dmPolicy": "pairing", "groupPolicy": "open", "accounts": { ``` ### Technical Analysis DingTalk direct messages are accepted from any sender through `dmPolicy: "open"` and `allowFrom: ["*"]`. Feishu group processing is also configured as open. These defaults unnecessarily expose the agent to untrusted input and make prompt-injection attempts, unauthorized resource consumption, social engineering, and unintended tool invocation more likely. This exposure is especially dangerous because the same template grants the agent a `/root/` workspace and enables third-party plugins. Open messaging access should not be combined with privileged filesystem or tool access. ### Attack Path 1. An untrusted enterprise user sends the DingTalk bot a direct message or posts in a Feishu group accessible to the bot. 2. The open policy admits and processes the message without explicit administrator pairing or allowlisting. 3. The message contains prompt-injection instructions designed to access files, expose secrets, invoke tools, or alter operations. 4. The agent or a vulnerable plugin acts on those instructions using available filesystem, channel, model, or gateway privileges. 5. Sensitive information or unauthorized actions ar ...[truncated 467 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Default all direct-message policies to pairing or explicit sender allowlists. - Default all group policies to explicit group or channel allowlists. - Require explicit bot mentions in approved groups. - Restrict pairing approval to authorized administrators and review pending requests. - Separate high-privilege administrative capabilities from public or broadly accessible messaging interfaces. - Minimize tools and filesystem access available to channel-originated sessions. - Add prompt-injection defenses, output filtering, action confirmation, and audit logging. - Document safe policy examples as the primary templates rather than presenting open access as the default. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/config.md:98
Finding
Reusable Channel Secrets Are Stored in Plaintext Configuration<![CDATA[ ## Vulnerability Details **File Location**: `references/config.md:98-120` **Vulnerability Type**: Plaintext sensitive credential storage **Risk Level**: Medium ### Vulnerable Code ```json "dingtalk-connector": { "enabled": true, "clientId": "<APP_KEY>", "clientSecret": "<APP_SECRET>", "gatewayToken": "<OPENCLAW_GATEWAY_TOKEN>", "sessionTimeout": 1800000, "dmPolicy": "open", "allowFrom": ["*"] }, "feishu": { "enabled": true, "domain": "feishu", "dmPolicy": "pairing", "groupPolicy": "open", "accounts": { "main": { "appId": "<FEISHU_APP_ID>", "appSecret": "<FEISHU_APP_SECRET>", "botName": "OpenClaw Assistant" } } }, "discord": { "enabled": true, "token": "<DISCORD_BOT_TOKEN>", ``` The repository contains placeholders rather than live secrets. The vulnerability is the recommended storage pattern and absence of mandatory permission controls. ### Technical Analysis The configuration template directs users to place reusable DingTalk, Feishu, Discord, and gateway credentials directly in a JSON file. The documentation does not require strict ownership or file modes and does not consistently prefer a secret manager or protected service-credential mechanism. Plaintext storage increases exposure to other local users, compromised plugins, broad backup jobs, diagnostic bundles, support artifacts, and accidental configuration sharing. Storing these credentials beneath a root workspace also makes them potentially accessible to the agent itself. ### Attack Path 1. An administrator replaces the placeholders with production credentials. 2. The configuration is created with permissive default permissions, included in a backup, or exposed to an installed plugin. 3. A local process, user, compromised plugin, or collected diagnostic artifact reads the JSON file. 4. The attacker extracts the channel or gateway cred ...[truncated 439 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Prefer a managed secret store, systemd credentials, or another protected runtime secret-injection mechanism. - Where environment variables are used, ensure they are not exposed through shell history, process diagnostics, or unsafe service configuration. - If file storage is unavoidable, use a dedicated service account, strict ownership, and mode `0600`. - Keep secret files outside the agent workspace. - Prevent configuration files from being included in source control, support bundles, and general backups unless encrypted. - Redact credentials and authorization headers from logs and evidence artifacts. - Use separate credentials per deployment with minimum API scopes. - Document immediate rotation and revocation procedures. ]]>

T06 · System Persistence

Error
Location
SKILL.md:108
Finding
Gateway Installation Establishes a Persistent Service from Unverified Components<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:108-120` **Vulnerability Type**: Persistent service installation **Risk Level**: High ### Vulnerable Code ```bash ## Step 5: Install and Start Gateway ```bash openclaw gateway install openclaw gateway start openclaw gateway status ``` If running with user-level systemd, reload after config changes: ```bash systemctl --user import-environment DASHSCOPE_API_KEY systemctl --user daemon-reload systemctl --user restart openclaw-gateway ``` ``` ### Technical Analysis The workflow installs and starts a gateway service and later manages it through systemd. A persistent service is consistent with the declared goal of operating a messaging gateway, so persistence is not inherently malicious in isolation. However, the Skill installs unpinned OpenClaw and plugin code before creating the service, and it does not require inspection of the generated unit, explicit user approval, service hardening, or verification of the executable path. As a result, compromised dependency code can continue executing after the setup session and across service restarts. Importing the model API key into the service environment also gives the persistent process access to that credential. ### Attack Path 1. A malicious or compromised OpenClaw or plugin version is installed through an unpinned dependency source. 2. `openclaw gateway install` creates a persistent service referencing the installed code. 3. The service is started and supplied with the DashScope credential. 4. The malicious component executes whenever the gateway service starts or restarts. 5. It retains ongoing access to messages, configuration, credentials, and files permitted to the service account. ### Impact Assessment The service survives the interactive setup session and can maintain ongoing access to configured channels and credentials. If it runs under the documented root-oriented account, compromise may affect the entire host. Even as a user service, i ...[truncated 121 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Require explicit administrator approval before creating a persistent service. - Pin and verify OpenClaw and all plugin artifacts before service installation. - Display and review the generated unit file, executable path, environment, and working directory. - Run the gateway as a dedicated unprivileged account. - Apply systemd sandboxing, capability restrictions, filesystem protections, and network egress controls. - Use protected service credentials rather than importing secrets broadly from an interactive environment. - Document commands to stop, disable, audit, and uninstall the service. - Verify service integrity and dependency versions during each deployment and upgrade. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/dingtalk-setup.md:49
Finding
DingTalk Guide Requests Broad Administrative and Directory Permissions<![CDATA[ ## Vulnerability Details **File Location**: `references/dingtalk-setup.md:49-56` **Vulnerability Type**: Excessive enterprise application permissions **Risk Level**: High ### Vulnerable Code ```text Required permissions: - `qyapi_chat_manage` - Group chat management - `qyapi_robot_sendmsg` - Robot send message - `Contact.User.Read` - Read user info - `Card.Streaming.Write` - AI card streaming write - `Card.Instance.Write` - AI card instance write ``` ### Technical Analysis The guide labels all listed permissions as required, including group-chat management and user-directory reading. Basic bot messaging does not necessarily require administrative chat management or broad user-information access in every deployment. The documentation does not explain which feature needs each scope, distinguish mandatory scopes from optional ones, or recommend testing with a minimum permission set. If the plugin, host, or application secret is compromised, these broad grants become available to the attacker. This violates least privilege unless every scope is specifically justified by enabled functionality. ### Attack Path 1. An administrator follows the guide and grants every listed DingTalk permission. 2. The connector's app secret is stored on the OpenClaw host. 3. An attacker compromises the host, connector plugin, configuration file, or application credentials. 4. The attacker authenticates to DingTalk APIs using the stolen application identity. 5. The attacker reads permitted user information, manages group chats, and sends or modifies bot content within the application's authorized scope. ### Impact Assessment A compromise may expose enterprise user information and enable unauthorized management of group-chat resources in addition to ordinary bot messaging. The affected scope depends on tenant configuration and DingTalk's interpretation of the granted application permissions, but it can extend beyond the minimum functionality of receiving and sending bot ...[truncated 13 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Separate mandatory messaging scopes from optional feature-specific scopes. - Begin with only the minimum send/receive permissions required for the selected bot mode. - Omit `qyapi_chat_manage` unless the deployment explicitly requires group-chat administration. - Omit `Contact.User.Read` unless user-directory lookup is necessary and approved. - Document the exact connector feature that requires each permission. - Use a dedicated enterprise application for the bot rather than reusing a broadly privileged application. - Periodically review granted permissions and revoke unused scopes. - Rotate the application secret after suspected host or plugin compromise. ]]>
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
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Session Persistence

Medium
Category
Rogue Agent
Content
## Step 4: Configure `openclaw.json`

Create or update `~/.openclaw/openclaw.json` with:

- `models.providers.bailian` for DashScope endpoint and models.
- `agents.defaults.model.primary` in `provider/model` format, default to `bailian/glm-5`.
Confidence
78% confidence
Finding
The skill instructs operators to create or update persistent local configuration in `~/.openclaw/openclaw.json` containing provider settings and channel credentials. Persisting secrets and operational state in a user home directory increases the chance of credential leakage through weak file permissions, backups, shell access, or accidental sharing of config files and logs.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
Lines L165-L167 describe a generic workflow centered on determining whether an operation is read-only or mutating and running a minimal read-only query first. However, the rest of the skill is an imperative setup procedure that installs packages/plugins, writes configuration files, and starts/restarts services, with no corresponding read-only verification step before mutation. This is an active contradiction in the documentation, not merely omitted detail.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The example configuration enables a DingTalk connector with `dmPolicy: "open"` and `allowFrom: ["*"]`, which permits messages from any sender without documenting the exposure risk. In the context of an agent-installation/configuration skill for production Linux hosts, this can lead operators to deploy an internet- or org-wide reachable bot that accepts untrusted input by default, increasing the chance of abuse, prompt injection, data exposure, or unauthorized agent use.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The guide instructs operators to retrieve and use the DingTalk AppSecret but does not identify it as a sensitive credential or warn against placing it in plaintext configs, logs, screenshots, or source control. In an infrastructure/setup skill, this omission materially increases the chance of credential leakage, which could allow unauthorized use of the DingTalk app integration.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
1. Navigate to: **Version Management and Release**
2. Create new version
3. Fill in version details
4. Submit for review (internal apps usually auto-approve)
5. Publish to enterprise

## Step 6: Install Official OpenClaw Connector
Confidence
85% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The configuration mapping tells users to place clientSecret into the OpenClaw configuration but provides no secure handling guidance. Because this skill is used for provisioning and standardizing deployments, the omission can normalize insecure secret storage practices across multiple hosts and environments.

Session Persistence

Medium
Category
Rogue Agent
Content
## Contents

1. Prerequisites
2. Create Discord bot
3. Configure OpenClaw
4. Start and verify
5. Pairing and policy checks
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.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The guide instructs users to place a live Discord bot token in a JSON config file or export it as an environment variable, but it does not explicitly warn that the token is a sensitive secret that must not be committed, logged, shared, or left in shell history. In an infrastructure setup skill, this omission increases the chance of credential leakage, which could let an attacker control the bot, read or send messages via the configured integration, and abuse the OpenClaw channel.

Session Persistence

Medium
Category
Rogue Agent
Content
openclaw plugins list | grep feishu
```

## Create Feishu App

1. Visit Feishu Open Platform (`https://open.feishu.cn/app`) and create an enterprise app.
2. Copy `App ID` and `App Secret` from credentials page.
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.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The guide explicitly instructs users to copy the Feishu App Secret but does not label it as sensitive or warn against exposing it in docs, terminals, screenshots, or shared notes. In an infrastructure setup skill, this omission can normalize unsafe handling of credentials and increase the chance of token leakage that would let an attacker impersonate the app or abuse the Feishu integration.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The example shows a plaintext appSecret stored in ~/.openclaw/openclaw.json without any warning about filesystem permissions, secret management, or safer alternatives. Because this skill is for provisioning real Linux hosts, users are likely to copy the example directly, creating a durable local secret exposure that could be harvested by other users, backups, support bundles, or malware on the host.

External Script Fetching

Low
Category
Supply Chain
Content
```bash
ssh root@<server>
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
node --version
npm --version
Confidence
97% confidence
Finding
The command `curl -fsSL https://deb.nodesource.com/setup_20.x | bash -` downloads and immediately executes a remote script as root, creating a direct supply-chain and remote-code-execution risk. If the remote endpoint, transport, DNS, or hosting chain is compromised, arbitrary commands would run with full privileges on the target host.

Static analysis

No suspicious patterns detected.