Back to skill

Security audit

添加QQBot账号

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but users should take extra care because it handles QQ Bot secrets.

Install only if you want an agent to help modify OpenClaw QQ Bot configuration. Use SecretRef, the OpenClaw credential store, or a protected token file where possible; avoid pasting real secrets into shell commands, chats, logs, or support transcripts, and check permissions on ~/.openclaw/openclaw.json before storing credentials there.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:46
Finding
QQ Bot Secret Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:46-51` **Vulnerability Type**: Secret exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```markdown ## Interactive CLI Alternative ```bash openclaw channels add --channel qqbot --account <alias> --token "<appSecret>" ``` This stores credentials in the OpenClaw credentials store. Note: `--token-file` only sets AppSecret; you still need `appId` in config or `QQBOT_APP_ID` env var. ``` ### Technical Analysis The documented command directs the user to substitute a reusable QQ Bot application secret directly into a command-line argument. Quoting the secret only affects shell parsing; it does not prevent disclosure. Depending on the operating system, shell, and monitoring configuration, the secret may be exposed through: - Shell history files - Process listings or process-inspection interfaces while the command runs - Terminal session recordings - Command auditing and endpoint telemetry - CI/CD logs or copied troubleshooting transcripts The document mentions `--token-file`, but the shown primary command still uses the insecure `--token` argument pattern. ### Attack Path 1. A user replaces `<appSecret>` with the real QQ Bot secret. 2. The user executes the documented command. 3. The shell records the command in history, or local process/audit tooling captures its arguments. 4. A local user, administrator, monitoring operator, or attacker with access to those records obtains the secret. 5. The exposed credential may be used to authenticate as the associated QQ Bot, subject to the permissions and controls imposed by the QQ platform. ### Impact Assessment Successful exploitation discloses the QQ Bot application secret. The attacker does not automatically gain operating-system privileges, but may obtain the bot identity's remote API privileges and access to functionality authorized for that application. The scope is limited to the account associated ...[truncated 84 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace the command-line secret example with a protected credential prompt, SecretRef, or securely permissioned token-file workflow. - Avoid passing secrets through command arguments, including in examples and automation. - If `--token-file` is used, require owner-only permissions before execution, such as mode `0600` on systems that support POSIX permissions. - Document how `appId` should be supplied without causing users to fall back to plaintext secrets. - Warn users not to paste secrets into terminal transcripts, issue reports, logs, or chat messages. - If command-line exposure has already occurred, remove affected shell-history entries and rotate the secret because copies may remain in audit or monitoring systems. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:53
Finding
QQ Bot Credentials Stored in Plaintext Configuration<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:53-59` and `SKILL.md:107-109` **Vulnerability Type**: Plaintext storage of reusable credentials **Risk Level**: Medium ### Vulnerable Code ```markdown ## Workflow: Adding via Config Edit 1. **Read current config** — open `~/.openclaw/openclaw.json` and locate the `channels.qqbot` block 2. **Identify last existing account** — find the last entry in `accounts` (or note there are none yet) 3. **Add new entry** — insert a new account with `enabled: true`, `appId`, and `clientSecret`, comma-separated from the previous entry 4. **Validate** — verify the JSON is well-formed (commas, braces balance) 5. **Save** — Gateway hot-reloads automatically; no restart needed ``` The risk is explicitly acknowledged later in the document: ```markdown - **Credentials are in plaintext** in `openclaw.json` by default. For production, consider SecretRef (env var or file-backed). ``` ### Technical Analysis The config-edit workflow instructs users to store `clientSecret` directly in `~/.openclaw/openclaw.json`. A reusable application secret stored as plaintext is recoverable by any principal or process able to read the file or a copy of it. The document acknowledges plaintext storage and suggests considering SecretRef for production, but it does not make protected secret storage the default. It also does not require verification of restrictive file permissions. Potential exposure sources include permissive file modes, local malware, backups, synchronization services, diagnostic bundles, and accidental configuration sharing. Because multiple QQ Bot accounts can be configured in the same file, compromise of one configuration file may disclose several independent bot credentials. ### Attack Path 1. A user follows the config-edit workflow and writes one or more real `clientSecret` values into `~/.openclaw/openclaw.json`. 2. The file or a copied version is made accessible through permissive local permissions, backup ...[truncated 766 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Make SecretRef or the OpenClaw credential store the default workflow rather than plaintext `clientSecret` fields. - Keep only non-secret identifiers and secret references in `openclaw.json`. - For file-backed secrets, use a dedicated secret file with owner-only read/write permissions and exclude it from backups, synchronization, source control, and support bundles where appropriate. - Verify and document restrictive permissions for both `~/.openclaw` and any credential files. - Ensure logs, validation output, and diagnostics redact `clientSecret` values. - Avoid displaying or rewriting existing secrets while modifying account configuration. - Rotate credentials that were stored in files with uncertain access controls or that may have been copied. - Add explicit validation guidance for confirming that the gateway resolves the secret reference without printing the resolved value. ]]>
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The instructions in this section are written in Chinese while the rest of the skill is in English, and there is no opt-in or indication that the skill is intended only for Chinese-speaking users. This can violate language/locale policy by forcing a specific language for part of the workflow without user choice.

Session Persistence

Medium
Category
Rogue Agent
Content
3. 为新 agent 创建工作区目录:

```bash
mkdir -p ~/.openclaw/workspaces/<accountId>/skills
```

4. 在该工作区中放置 `SOUL.md`、`USER.md` 等文件定义其人格。
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.

Static analysis

No suspicious patterns detected.