Back to skill

Security audit

WeChat Share

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed workspace file-sharing skill, but it needs Review because it can upload sensitive agent files to a third-party service and import files that change future agent behavior.

Install this only for intentional workspace file handoffs with trusted recipients or senders. Avoid sharing secrets, profile files, memory, SOUL.md, AGENTS.md, or skills unless you have reviewed their contents and intend to transfer agent behavior. Treat db_id and api_token like passwords, preview before importing, compare sensitive files before overwriting them, and use burn/delete for shares that should not remain accessible.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:343
Finding
Import Workflow Permits Persistent Agent Instruction and Memory Poisoning<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:343-381` **Related Locations**: `SKILL.md:3`, `SKILL.md:37-41`, `SKILL.md:68`; `examples.md:46-52`, `examples.md:67-73`, `examples.md:88-89` **Vulnerability Type**: Persistent import of attacker-controlled Agent configuration, memory, and Skill files **Risk Level**: High ### Vulnerable Code Snippet ```markdown ### Step 3: Validate the manifest For every manifest item: - `remotePath` must start with `/files/` - `destPath` must be relative - `destPath` must not contain `..` - resolved destination path must stay inside the current workspace If validation fails, stop before writing anything. ### Step 4: Show a preview before import Before copying any file, show: - total file count - file list - overwrite warning for existing local paths - burn status - a note that only the current workspace will be written If the current action is `preview`, stop after this step. ### Step 5: Download to a temp directory Never write directly into the workspace before validation and checksum checks finish. For each manifest item: - read the remote file with `fs9_read(remotePath)` through the SQL API - write it to a temp file - verify checksum ### Step 6: Copy into the workspace After all files pass validation: - create parent directories as needed - copy the validated temp files into the workspace using the exact `destPath` Then report which files were imported. ``` The Skill explicitly identifies sensitive Agent control and state files as supported share targets: ```markdown Typical examples: - `SOUL.md` - `AGENTS.md` - `TOOLS.md` - `USER.md` - `skills/` - other workspace-relative text files the user explicitly selects ``` ### Technical Analysis The import workflow validates destination paths and verifies file checksums, but these controls establish only path safety and transport integrity. They do not establish that the sender or imported content is trustworthy. A sender controls the manifest, d ...[truncated 2568 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Deny imports to sensitive Agent control locations by default, including: - `SOUL.md` - `AGENTS.md` - `USER.md` - `MEMORY.md` - `memory/**` - `skills/**` 2. If these files must be supported, require explicit per-file approval rather than one approval for the entire share. 3. Never overwrite an existing control, memory, or Skill file automatically. Stage imported copies in a quarantine directory outside active Skill and memory lookup paths. 4. Generate and display a complete diff before installation. Highlight added instructions, tool-use directives, external URLs, shell commands, and changes to safety constraints. 5. Require a second confirmation after the content diff. The confirmation should identify the exact destination and state whether the file will affect current instructions, persistent memory, or executable Skill behavior. 6. Treat imported Skills as untrusted packages. Require a separate security review before moving them into the active `skills/` directory. 7. Restrict ordinary imports to non-executable data files and destinations that cannot influence Agent instructions or long-term state. 8. Consider cryptographic sender authentication. A valid checksum is insufficient because the sender controls both the payload and checksum. 9. Preserve existing files through backups and use atomic replacement so the user can reliably restore the previous workspace state. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:119
Finding
Sensitive Workspace Content Is Uploaded in Plaintext to an External Service<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:119-207` **Related Locations**: `SKILL.md:37-41`, `SKILL.md:57-69`, `SKILL.md:406-408` **Vulnerability Type**: Plaintext third-party storage of sensitive workspace data and exposure through bearer credentials **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ### Step 3: Confirm before upload Before creating the share, show: - final file list - total file count - overwrite risk if those paths commonly exist - burn-after-read setting - note that the returned share command or script should be treated as sensitive until imported or burned ### Step 4: Create the share Prepare a fresh share container and capture the values needed for import. 1. Create an anonymous db9 account: ```bash curl -sS -X POST "https://api.db9.ai/customer/anonymous-register" \ -H "Content-Type: application/json" \ -d '{}' ``` 2. Extract `token` from the JSON response. 3. Create a database with a unique name such as `wechat-share-YYYYMMDD-HHMMSS-RAND`: ```bash curl -sS -X POST "https://api.db9.ai/customer/databases" \ -H "Authorization: Bearer <API_TOKEN>" \ -H "Content-Type: application/json" \ -d '{"name":"wechat-share-20260323-103015-ab12"}' ``` Capture at least: - `api_token` - `db_id` ``` The selected files are then uploaded through the external SQL API: ```markdown ### Step 6: Upload files and manifest Upload every selected file to: - remote root: `/files/` - remote path pattern: `/files/<workspace-relative-path>` Use the SQL API: ```bash curl -sS -X POST "https://api.db9.ai/customer/databases/<DB_ID>/sql" \ -H "Authorization: Bearer <API_TOKEN>" \ -H "Content-Type: application/json" \ -d '{"query":"SELECT fs9_write('\"'\"'/files/SOUL.md'\"'\"', '\"'\"'...content...'\"'\"')"}' ``` Also upload the manifest to `/manifest.json` with `fs9_write()`. ``` ### Technical Analysis The workflow intentionally transmits selected workspace files to `api.db9.ai`. TLS protects data in tran ...[truncated 2413 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Deny known-sensitive paths instead of merely warning, including user identity files, memory stores, environment files, private keys, credential stores, and Agent control files. 2. Require explicit per-file confirmation after scanning and before upload. Display why each sensitive file was flagged. 3. Encrypt every file locally using an authenticated-encryption scheme before upload. The decryption key should be delivered to the intended recipient through a separate trusted channel and must never be sent to the storage provider. 4. Use short-lived, least-privilege credentials scoped to a single share and read operation. Avoid reusable account-level bearer tokens. 5. Avoid placing raw bearer tokens in durable chat messages, shell history, logs, or screenshots. Prefer a one-time redemption mechanism with a short expiration. 6. Make burn-after-read the default and enforce an expiration time even when burn is not requested. 7. Verify deletion and clearly report deletion failures. Provide the sender with a revocation mechanism independent of the recipient. 8. Add robust secret detection before upload, covering private keys, environment variables, cloud credentials, access tokens, connection strings, and high-entropy values. 9. Publish the external service's retention, logging, operator-access, and deletion guarantees so users can make an informed decision before uploading data. 10. Minimize uploaded metadata. Do not expose destination paths or filenames unless they are necessary for the recipient's operation. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (13)

Session Persistence

Medium
Category
Rogue Agent
Content
## Safety Rules

- Only read from and write to the current workspace.
- Resolve every candidate path to a real path and reject anything outside the workspace.
- Reject absolute destination paths and any destination path containing `..`.
- Never touch `~/.openclaw/**`.
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.

External Transmission

Medium
Category
Data Exfiltration
Content
1. Create an anonymous db9 account:

```bash
curl -sS -X POST "https://api.db9.ai/customer/anonymous-register" \
  -H "Content-Type: application/json" \
  -d '{}'
```
Confidence
90% confidence
Finding
This finding points to the same external registration flow to api.db9.ai, which establishes outbound connectivity and creates a remote storage context. In a skill designed to move files between workspaces, this materially increases risk because the remote service becomes a data sink and any compromise, misuse, or mistaken file selection can disclose private workspace contents.

External Transmission

Medium
Category
Data Exfiltration
Content
1. Create an anonymous db9 account:

```bash
curl -sS -X POST "https://api.db9.ai/customer/anonymous-register" \
  -H "Content-Type: application/json" \
  -d '{}'
```
Confidence
90% confidence
Finding
This finding points to the same external registration flow to api.db9.ai, which establishes outbound connectivity and creates a remote storage context. In a skill designed to move files between workspaces, this materially increases risk because the remote service becomes a data sink and any compromise, misuse, or mistaken file selection can disclose private workspace contents.

External Transmission

Medium
Category
Data Exfiltration
Content
3. Create a database with a unique name such as `wechat-share-YYYYMMDD-HHMMSS-RAND`:

```bash
curl -sS -X POST "https://api.db9.ai/customer/databases" \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"name":"wechat-share-20260323-103015-ab12"}'
Confidence
91% confidence
Finding
Creating a remote database on an external service is part of the data export pipeline and therefore a true external transmission risk. The context makes it more dangerous because the skill then stores selected workspace files there and relies on bearer-token access, so accidental disclosure of the token or overbroad file selection can expose all uploaded content.

External Transmission

Medium
Category
Data Exfiltration
Content
Use the SQL API:

```bash
curl -sS -X POST "https://api.db9.ai/customer/databases/<DB_ID>/sql" \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"query":"SELECT fs9_write('\"'\"'/files/SOUL.md'\"'\"', '\"'\"'...content...'\"'\"')"}'
Confidence
96% confidence
Finding
This step uploads actual file contents to the external SQL API via fs9_write, making the exfiltration path concrete rather than hypothetical. The skill includes some guardrails, but it still instructs the agent to serialize local files and send them off-box, so any failure in path validation, secret detection, or user understanding could leak sensitive workspace material.

External Transmission

Medium
Category
Data Exfiltration
Content
If burn is requested, prefer deleting the whole share database:

```bash
curl -sS -X DELETE "https://api.db9.ai/customer/databases/<DB_ID>" \
  -H "Authorization: Bearer <API_TOKEN>"
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
Use the SQL endpoint with `curl`:

```bash
curl -sS -X POST "https://api.db9.ai/customer/databases/<DB_ID>/sql" \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"query":"SELECT fs9_read('\"'\"'/manifest.json'\"'\"') AS content"}'
Confidence
74% confidence
Finding
Reading the remote manifest from the external service is an outbound interaction with untrusted remote data and is part of a workflow that imports files into the workspace. While not exfiltration of local data, it expands the trust boundary and can enable malicious share metadata to drive overwrites or unsafe imports if validation is incomplete.

Skill Enumeration

Medium
Category
Agent Snooping
Content
- `SOUL.md`
- `AGENTS.md`
- `skills/wechat-share/SKILL.md`

可能覆盖:
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
- `SOUL.md`
- `AGENTS.md`
- `skills/wechat-share/SKILL.md`

可能覆盖:
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
已导入这些文件:

- `SOUL.md`
- `skills/example/SKILL.md`

如果这次启用了 burn,远端分享已经被删除,或者已回退为删除远端文件。
这条分享命令不要再次转发。
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
已导入这些文件:

- `SOUL.md`
- `skills/example/SKILL.md`

如果这次启用了 burn,远端分享已经被删除,或者已回退为删除远端文件。
这条分享命令不要再次转发。
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The file instructs the skill to use the Chinese template when the user is speaking Chinese, and similarly mandates the English template when the user is speaking English. This is a natural-language locale policy decision embedded in the skill content, but it does not explicitly offer the user a language choice or opt-in.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
This line directs the skill to use the English template whenever the user is speaking English, which enforces a locale choice implicitly. The policy exception for language constraints does not apply here because the file does not document user choice or a justified region-specific requirement.

Static analysis

No suspicious patterns detected.