Back to skill

Security audit

Feishu Channel Cleaner

Security checks for vulnerabilities and agentic risk

Overview

The skill is focused on fixing Feishu channel conflicts, but it can change access-control settings and re-enable a bot channel without a user-reviewed diff or confirmation.

Review the planned OpenClaw config changes before running this skill. It should only be used by an operator who understands the Feishu channel entries and is comfortable merging allowlists, changing dmPolicy, deleting the duplicate channel, and re-enabling the retained channel. Keep the generated backup so the configuration can be restored if access becomes too broad or the bot behaves unexpectedly.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
cleaner.py:56
Finding
Unvalidated Access-Control Expansion During Channel Merge## Vulnerability Details **File Location**: `cleaner.py`, lines 56–66 **Vulnerability Type**: Unvalidated access-control modification **Risk Level**: Medium ```python if "allowlist" in remove_channel: old = keep_channel.get("allowlist", []) new = remove_channel["allowlist"] merged = list(set(old + new)) keep_channel["allowlist"] = merged print(f"✅ 合并白名单: {merged}") if "dmPolicy" in remove_channel: keep_channel["dmPolicy"] = remove_channel["dmPolicy"] print(f"✅ 设置 dmPolicy: {keep_channel['dmPolicy']}") keep_channel["enabled"] = True ``` ### Technical Analysis The cleaner automatically applies security-sensitive values from the channel selected for removal to the retained channel. It unions both allowlists without validating their types, entries, provenance, or intended authorization scope. It also replaces the retained channel's `dmPolicy` with the discarded channel's policy and unconditionally enables the retained channel. Consequently, a stale, incorrectly configured, or attacker-modified redundant channel can broaden access to the active bot configuration. The merge does not compare policy restrictiveness, request operator approval, or present a security-sensitive configuration diff before writing the changes. ### Attack Path 1. A conflicting `feishu` or `openclaw-feishu` entry exists in `~/.openclaw/openclaw.json`. 2. An attacker or prior unsafe configuration places unauthorized identities in the redundant channel's `allowlist`, assigns it a less restrictive `dmPolicy`, or relies on the active channel currently being disabled. 3. An operator invokes the cleaner to resolve the channel conflict. 4. The cleaner copies the redundant channel's allowlist and direct-message policy into the retained channel without validation or confirmation. 5. The cleaner sets `enabled` to `True` and writes the resulting configuration. 6. After the operator restarts the gateway as instructed, the ...[truncated 634 chars]
Remediation
## Remediation Suggestions - Validate that both channel objects are dictionaries and that each allowlist is a list containing only identifiers of the expected type and format. - Validate `dmPolicy` against an explicit allowlist of supported policy values. - Preserve the retained channel's existing `dmPolicy` by default. Never replace it with a potentially less restrictive policy automatically. - Require explicit operator confirmation before adding identities, weakening a policy, or changing a channel from disabled to enabled. - Do not force `enabled = True`; preserve the retained channel's existing state unless the operator explicitly requests activation. - Calculate and display a redacted configuration diff before applying security-sensitive changes. - Prefer intersection or a documented conflict-resolution rule over an unconditional allowlist union when the authorization intent cannot be established. - Write the updated configuration through a permission-restricted temporary file, flush and synchronize it, and then atomically replace the original file to reduce corruption risk.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (3)

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger condition explicitly includes "或类似关键词 / or similar keywords," which creates ambiguous activation boundaries for a skill that can modify configuration and prompt a gateway restart. Overbroad triggering increases the chance of unintended invocation on loosely related user requests, causing unauthorized or surprising config changes in a sensitive operational context.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The workflow performs destructive and privileged actions—backing up, merging, deleting channel entries, cleaning fields, and leading to a restart requirement—but the skill description does not clearly warn users that it will write configuration and remove redundant entries. In a skill with config:write and gateway:restart permissions, insufficient disclosure raises the risk of users triggering impactful changes without informed consent.

Natural-Language Policy Violations

Low
Confidence
97% confidence
Finding
This code emits all natural-language status and warning messages in Chinese, including error, backup, cleanup, and restart guidance. That creates a locale/language policy concern because the skill does not offer a language choice or document that it is intended only for Chinese-speaking users.

Static analysis

No suspicious patterns detected.